結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー shinwisteriashinwisteria
提出日時 2018-03-14 20:36:51
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 445 bytes
コンパイル時間 3,521 ms
コンパイル使用メモリ 74,564 KB
実行使用メモリ 57,052 KB
最終ジャッジ日時 2023-08-19 11:04:53
合計ジャッジ時間 5,088 ms
ジャッジサーバーID
(参考情報)
judge15 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,764 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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);

	}

}
0