結果

問題 No.478 一般門松列列
ユーザー ぴろずぴろず
提出日時 2017-01-27 22:30:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 380 ms / 2,000 ms
コード長 499 bytes
コンパイル時間 2,320 ms
コンパイル使用メモリ 71,240 KB
実行使用メモリ 66,068 KB
最終ジャッジ日時 2023-08-25 04:01:06
合計ジャッジ時間 12,356 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,196 KB
testcase_01 AC 121 ms
55,776 KB
testcase_02 AC 120 ms
55,648 KB
testcase_03 AC 119 ms
56,128 KB
testcase_04 AC 119 ms
55,556 KB
testcase_05 AC 121 ms
55,756 KB
testcase_06 AC 121 ms
55,764 KB
testcase_07 AC 125 ms
55,844 KB
testcase_08 AC 124 ms
55,896 KB
testcase_09 AC 122 ms
55,616 KB
testcase_10 AC 120 ms
55,636 KB
testcase_11 AC 380 ms
65,116 KB
testcase_12 AC 373 ms
64,568 KB
testcase_13 AC 371 ms
64,624 KB
testcase_14 AC 380 ms
64,668 KB
testcase_15 AC 361 ms
64,480 KB
testcase_16 AC 265 ms
66,068 KB
testcase_17 AC 364 ms
64,804 KB
testcase_18 AC 309 ms
64,096 KB
testcase_19 AC 362 ms
64,908 KB
testcase_20 AC 346 ms
64,352 KB
testcase_21 AC 328 ms
63,976 KB
testcase_22 AC 283 ms
62,636 KB
testcase_23 AC 288 ms
47,112 KB
testcase_24 AC 315 ms
47,776 KB
testcase_25 AC 347 ms
64,280 KB
testcase_26 AC 250 ms
60,612 KB
testcase_27 AC 243 ms
58,180 KB
testcase_28 AC 176 ms
56,276 KB
testcase_29 AC 176 ms
56,152 KB
testcase_30 AC 297 ms
64,260 KB
testcase_31 AC 277 ms
63,920 KB
testcase_32 AC 255 ms
63,968 KB
testcase_33 AC 266 ms
64,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no478;

import java.util.Scanner;

public class Main {
	public static int[] seed = {1,3,2,4};
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int[] ans = new int[n];
		for(int i=k;i<n;i++) {
			ans[i] = seed[i%4];
		}
		for(int i=k-1;i>=0;i--) {
			ans[i] = ans[i+2];
		}
		for(int i=0;i<n;i++) {
			if (i > 0) {
				System.out.print(' ');
			}
			System.out.print(ans[i]);
		}
		System.out.println();
	}

}
0