結果

問題 No.490 yukiソート
ユーザー tsunabittsunabit
提出日時 2019-06-12 00:43:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 326 ms / 2,000 ms
コード長 516 bytes
コンパイル時間 3,618 ms
コンパイル使用メモリ 76,692 KB
実行使用メモリ 46,336 KB
最終ジャッジ日時 2024-04-16 22:23:00
合計ジャッジ時間 12,549 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
41,640 KB
testcase_01 AC 148 ms
41,792 KB
testcase_02 AC 151 ms
41,708 KB
testcase_03 AC 136 ms
40,624 KB
testcase_04 AC 197 ms
41,848 KB
testcase_05 AC 197 ms
42,328 KB
testcase_06 AC 208 ms
42,252 KB
testcase_07 AC 196 ms
42,008 KB
testcase_08 AC 199 ms
42,100 KB
testcase_09 AC 204 ms
42,312 KB
testcase_10 AC 198 ms
42,272 KB
testcase_11 AC 195 ms
42,340 KB
testcase_12 AC 199 ms
42,368 KB
testcase_13 AC 199 ms
42,440 KB
testcase_14 AC 326 ms
44,768 KB
testcase_15 AC 326 ms
44,544 KB
testcase_16 AC 319 ms
44,624 KB
testcase_17 AC 312 ms
44,568 KB
testcase_18 AC 325 ms
46,336 KB
testcase_19 AC 315 ms
44,400 KB
testcase_20 AC 310 ms
45,936 KB
testcase_21 AC 317 ms
44,380 KB
testcase_22 AC 312 ms
44,504 KB
testcase_23 AC 317 ms
44,740 KB
testcase_24 AC 150 ms
41,964 KB
testcase_25 AC 147 ms
41,832 KB
testcase_26 AC 148 ms
42,112 KB
testcase_27 AC 148 ms
41,824 KB
testcase_28 AC 134 ms
41,816 KB
testcase_29 AC 149 ms
41,940 KB
testcase_30 AC 148 ms
41,632 KB
testcase_31 AC 148 ms
42,024 KB
testcase_32 AC 146 ms
41,696 KB
testcase_33 AC 147 ms
42,136 KB
testcase_34 AC 146 ms
41,672 KB
testcase_35 AC 147 ms
41,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No490 {
    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