結果

問題 No.490 yukiソート
ユーザー omi_UTomi_UT
提出日時 2017-03-10 22:26:11
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 762 bytes
コンパイル時間 2,390 ms
コンパイル使用メモリ 74,656 KB
実行使用メモリ 57,936 KB
最終ジャッジ日時 2023-09-06 15:31:52
合計ジャッジ時間 8,031 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
54,612 KB
testcase_01 WA -
testcase_02 AC 65 ms
50,824 KB
testcase_03 AC 67 ms
48,564 KB
testcase_04 AC 141 ms
53,372 KB
testcase_05 AC 145 ms
52,192 KB
testcase_06 AC 142 ms
53,688 KB
testcase_07 AC 147 ms
52,416 KB
testcase_08 AC 146 ms
52,364 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args)throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		String line[] = br.readLine().split(" ");
		int[] a = new int [n];

		for (int i=0;i<n;i++){
			a[i] = Integer.parseInt(line[i]);
		}

		for(int i=0; i<2*n-3; i++){
			for(int p=0; p<n-1; p++){
				for(int q=p+1;q<n; q++){
					if(a[p] > a[q]){
						int temp = a[p];
						a[p] = a[q];
						a[q] = temp;
					}
				}
			}
		}
		// Arrays.sort(a)
		
		System.out.print(a[0]);
		for(int i=1; i<n; i++){
			System.out.print(" "+a[i]);
		}
		System.out.println();
	}
}
0