結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー marumaru
提出日時 2016-03-23 17:13:09
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 808 bytes
コンパイル時間 2,824 ms
コンパイル使用メモリ 75,136 KB
実行使用メモリ 66,700 KB
最終ジャッジ日時 2024-04-09 21:06:33
合計ジャッジ時間 6,786 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.util.Scanner;

public class yukicoder_256 {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		String str = stdIn.next();
		
		String[] array = new String[str.length()];
		int[] seisu = new int[array.length];
		
		for (int i = 0; i < array.length; i++) {
			array[i] = str.substring(i, i + 1);
			seisu[i] = Integer.parseInt(array[i]);
		}
		
		for (int i = 1; i <= seisu.length; i++) {
            for (int j = 0; j < seisu.length - 1; j++) {
            	if (seisu[j] > seisu[j+1]) {
                	int t;
                    t = seisu[j];
                    seisu[j] = seisu[j+1];
                    seisu[j+1] = t;
                }
            }
        }
		
		for (int i = seisu.length - 1; i >= 0; i--) {
			System.out.print(seisu[i]);
		}
		
	}
}
0