結果
問題 | No.256 桁の数字を入れ替え (2) |
ユーザー | shinwisteria |
提出日時 | 2018-03-14 20:36:51 |
言語 | Java21 (openjdk 21) |
結果 |
RE
|
実行時間 | - |
コード長 | 445 bytes |
コンパイル時間 | 4,058 ms |
コンパイル使用メモリ | 77,028 KB |
実行使用メモリ | 54,944 KB |
最終ジャッジ日時 | 2024-05-06 18:18:08 |
合計ジャッジ時間 | 4,468 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 105 ms
54,300 KB |
testcase_01 | RE | - |
testcase_02 | RE | - |
testcase_03 | RE | - |
ソースコード
package m.shin; import java.util.Scanner; public class Con256 { public static void main(String[] args) { Scanner s = new Scanner(System.in); String n = s.nextLine(); s.close(); int[] a = new int[9]; for(int i = 0;i < n.length();i++){ a[Integer.parseInt(n.substring(i, i+1)) -1]++; } n = ""; for(int i = 8;i >= 0;i--){ for(int j = 0;j < a[i];j++){ n += Integer.toString(i+1); } } System.out.println(n); } }