結果

問題 No.490 yukiソート
ユーザー fjafjafjafjafjafja
提出日時 2017-08-31 15:04:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 330 ms / 2,000 ms
コード長 489 bytes
コンパイル時間 3,839 ms
コンパイル使用メモリ 78,228 KB
実行使用メモリ 44,744 KB
最終ジャッジ日時 2024-04-24 09:09:32
合計ジャッジ時間 12,669 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 150 ms
41,460 KB
testcase_01 AC 149 ms
41,624 KB
testcase_02 AC 149 ms
41,524 KB
testcase_03 AC 149 ms
41,348 KB
testcase_04 AC 190 ms
42,164 KB
testcase_05 AC 195 ms
42,040 KB
testcase_06 AC 192 ms
42,260 KB
testcase_07 AC 194 ms
42,316 KB
testcase_08 AC 199 ms
42,180 KB
testcase_09 AC 198 ms
42,296 KB
testcase_10 AC 194 ms
42,176 KB
testcase_11 AC 194 ms
42,204 KB
testcase_12 AC 196 ms
42,068 KB
testcase_13 AC 191 ms
42,048 KB
testcase_14 AC 330 ms
44,464 KB
testcase_15 AC 305 ms
44,512 KB
testcase_16 AC 300 ms
44,420 KB
testcase_17 AC 297 ms
44,444 KB
testcase_18 AC 307 ms
44,280 KB
testcase_19 AC 304 ms
44,744 KB
testcase_20 AC 310 ms
44,712 KB
testcase_21 AC 304 ms
44,412 KB
testcase_22 AC 311 ms
44,148 KB
testcase_23 AC 309 ms
44,472 KB
testcase_24 AC 150 ms
41,808 KB
testcase_25 AC 145 ms
41,420 KB
testcase_26 AC 135 ms
40,404 KB
testcase_27 AC 147 ms
41,680 KB
testcase_28 AC 147 ms
41,468 KB
testcase_29 AC 149 ms
41,928 KB
testcase_30 AC 134 ms
40,316 KB
testcase_31 AC 144 ms
41,348 KB
testcase_32 AC 144 ms
41,688 KB
testcase_33 AC 147 ms
41,244 KB
testcase_34 AC 148 ms
41,724 KB
testcase_35 AC 147 ms
41,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class N490
{
	public static void main(String[] args)
	{
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int buf=0;
		int[] a=new int[N];
		for(int i=0;i<N;i++)
		{
			a[i]=sc.nextInt();
		}

		for(int i=0;i<2*N-3;i++)
		{
			int s=0,t=i;
			while(s<t)
			{
				if(t<=N-1&&a[s]>a[t]){buf=a[s];a[s]=a[t];a[t]=buf;}
				s++;
				t=i-s;
			}
		}
		for(int aa:a)
		{
			System.out.print(aa+" ");
		}System.out.println();

	}

}
0