結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー kenji_shioyakenji_shioya
提出日時 2016-06-05 17:22:14
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,150 ms / 2,000 ms
コード長 376 bytes
コンパイル時間 4,616 ms
コンパイル使用メモリ 80,052 KB
実行使用メモリ 56,368 KB
最終ジャッジ日時 2024-04-17 05:00:41
合計ジャッジ時間 6,751 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
40,972 KB
testcase_01 AC 131 ms
41,316 KB
testcase_02 AC 1,127 ms
56,368 KB
testcase_03 AC 1,150 ms
54,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Exercise62{
  public static void main (String[] args){

    Scanner sc = new Scanner(System.in);

    String str = sc.next();

    String[] array = str.split("");
    
    Arrays.sort(array, Comparator.reverseOrder());

    str = "";
    for (int i = 0; i < array.length; i++){
      str += array[i];
    }

    System.out.println(str);
  }
}
0