結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー h_tyokinuhatah_tyokinuhata
提出日時 2016-01-22 22:13:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 615 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 1,738 ms
コンパイル使用メモリ 74,348 KB
実行使用メモリ 67,712 KB
最終ジャッジ日時 2023-10-21 13:47:34
合計ジャッジ時間 3,722 ms
ジャッジサーバーID
(参考情報)
judge12 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
57,460 KB
testcase_01 AC 97 ms
56,068 KB
testcase_02 AC 615 ms
67,452 KB
testcase_03 AC 563 ms
67,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String N = sc.next();
		
		char[] charN = N.toCharArray();
		
		Arrays.sort(charN);
		
		for(int i = charN.length - 1; i >= 0; i--) {
			System.out.print(charN[i]);
		}
		
		System.out.println();
	}
}
0