問題一覧 > 通常問題

No.256 Swapping Digits (2)

レベル : / AI推定難易度 : 130 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 256 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 505
作問者 : LayCurse
お気に入りにしたユーザー ProblemId : 694 / 自分の提出
問題文最終更新日: 2026-06-25 01:04:48
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder 1周年記念 復習コンテスト R2 (順位表) の他の問題:

Problem Statement

You are given a positive integer $N$ with at least $2$ digits and at most $10^5$ digits.
You may, any number of times, choose $2$ digits and swap them.
It is also allowed not to swap even $1$ time.
When trying to make the largest possible integer, what is that largest integer?

Note that $N$ may be a number that cannot be handled by a 32-bit integer type.

Input

$N$
$10\le N < 10^{100000}$

Output

Output the largest integer.

Sample

Sample 1
Input
12
Output
21
Sample 2
Input
21
Output
21
Sample 3
Input
1122
Output
2211

Note that, unlike No. 39, swapping 2 times is allowed.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。