結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー koukonkokoukonko
提出日時 2015-12-22 14:10:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 568 ms / 2,000 ms
コード長 601 bytes
コンパイル時間 2,088 ms
コンパイル使用メモリ 74,176 KB
実行使用メモリ 65,484 KB
最終ジャッジ日時 2023-10-18 22:36:22
合計ジャッジ時間 3,893 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
52,492 KB
testcase_01 AC 60 ms
51,476 KB
testcase_02 AC 568 ms
65,484 KB
testcase_03 AC 559 ms
65,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));

		try {
			String line = buff.readLine();
			int[] count = new int[10];
			for(int i = 0; i < line.length(); ++i){
				++count[Integer.parseInt(String.valueOf(line.charAt(i)))];
			}

			for(int i = 9; i >= 0; --i){
				for(int j = 0; j < count[i]; ++j){
					System.out.print(i);
				}
			}

			System.out.println();
		} catch (Exception e) {
			e.getStackTrace();
		}
	}
}
0