結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー shinwisteriashinwisteria
提出日時 2018-03-14 20:49:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 727 ms / 2,000 ms
コード長 461 bytes
コンパイル時間 4,464 ms
コンパイル使用メモリ 72,980 KB
実行使用メモリ 66,836 KB
最終ジャッジ日時 2023-08-19 11:37:17
合計ジャッジ時間 6,815 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,700 KB
testcase_01 AC 122 ms
55,980 KB
testcase_02 AC 706 ms
66,836 KB
testcase_03 AC 727 ms
66,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package m.shin;
import java.util.Arrays;
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[n.length()];
		for(int i = 0;i < n.length();i++){
			a[i] = -1 * Integer.parseInt(n.substring(i, i+1));
		}
		Arrays.sort(a);
		for(int i = 0;i < n.length();i++){
			System.out.print(-1 * a[i]);
		}
		System.out.println();

	}

}
0