結果

問題 No.490 yukiソート
ユーザー Mcpu3Mcpu3
提出日時 2018-09-01 19:59:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 375 ms / 2,000 ms
コード長 481 bytes
コンパイル時間 2,596 ms
コンパイル使用メモリ 76,948 KB
実行使用メモリ 61,912 KB
最終ジャッジ日時 2023-10-19 22:39:14
合計ジャッジ時間 11,399 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 153 ms
57,268 KB
testcase_01 AC 152 ms
57,224 KB
testcase_02 AC 154 ms
57,296 KB
testcase_03 AC 155 ms
57,516 KB
testcase_04 AC 199 ms
57,996 KB
testcase_05 AC 196 ms
58,076 KB
testcase_06 AC 207 ms
58,000 KB
testcase_07 AC 198 ms
57,972 KB
testcase_08 AC 198 ms
58,040 KB
testcase_09 AC 190 ms
57,992 KB
testcase_10 AC 197 ms
57,648 KB
testcase_11 AC 202 ms
56,124 KB
testcase_12 AC 202 ms
57,804 KB
testcase_13 AC 201 ms
58,088 KB
testcase_14 AC 334 ms
61,072 KB
testcase_15 AC 314 ms
60,796 KB
testcase_16 AC 320 ms
60,640 KB
testcase_17 AC 324 ms
60,664 KB
testcase_18 AC 324 ms
60,604 KB
testcase_19 AC 319 ms
60,588 KB
testcase_20 AC 324 ms
60,632 KB
testcase_21 AC 375 ms
61,912 KB
testcase_22 AC 314 ms
60,696 KB
testcase_23 AC 328 ms
60,864 KB
testcase_24 AC 156 ms
57,728 KB
testcase_25 AC 152 ms
57,288 KB
testcase_26 AC 154 ms
57,328 KB
testcase_27 AC 153 ms
57,628 KB
testcase_28 AC 152 ms
57,740 KB
testcase_29 AC 153 ms
57,252 KB
testcase_30 AC 152 ms
57,820 KB
testcase_31 AC 151 ms
57,596 KB
testcase_32 AC 153 ms
57,264 KB
testcase_33 AC 154 ms
57,848 KB
testcase_34 AC 154 ms
57,744 KB
testcase_35 AC 152 ms
57,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt(),a[]=new int[2000],t,i,j;
		for(i=0;i<n;i++) a[i]=sc.nextInt();
		sc.close();
		for(i=1;i<2*n-3;i++) {
			for(j=0;j<n;j++) {
				if(i-j>n-1||0>i-j) continue;
				if(a[i-j]>a[j]) {
					t=a[j];
					a[j]=a[i-j];
					a[i-j]=t;
				}
			}
		}
		for(i=0;i<n-1;i++) System.out.print(a[i]+" ");
		System.out.print(a[n-1]);
	}
}
0