結果

問題 No.478 一般門松列列
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-25 02:13:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 435 ms / 2,000 ms
コード長 546 bytes
コンパイル時間 3,509 ms
コンパイル使用メモリ 72,008 KB
実行使用メモリ 65,828 KB
最終ジャッジ日時 2023-08-06 18:45:14
合計ジャッジ時間 14,106 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,888 KB
testcase_01 AC 122 ms
55,620 KB
testcase_02 AC 124 ms
56,004 KB
testcase_03 AC 126 ms
55,496 KB
testcase_04 AC 123 ms
55,796 KB
testcase_05 AC 125 ms
57,652 KB
testcase_06 AC 126 ms
55,820 KB
testcase_07 AC 122 ms
55,568 KB
testcase_08 AC 124 ms
55,828 KB
testcase_09 AC 125 ms
55,784 KB
testcase_10 AC 124 ms
55,740 KB
testcase_11 AC 394 ms
64,160 KB
testcase_12 AC 435 ms
64,528 KB
testcase_13 AC 406 ms
64,112 KB
testcase_14 AC 374 ms
63,764 KB
testcase_15 AC 370 ms
64,184 KB
testcase_16 AC 273 ms
63,440 KB
testcase_17 AC 373 ms
64,188 KB
testcase_18 AC 325 ms
63,920 KB
testcase_19 AC 380 ms
64,184 KB
testcase_20 AC 356 ms
64,428 KB
testcase_21 AC 338 ms
63,852 KB
testcase_22 AC 294 ms
63,732 KB
testcase_23 AC 286 ms
63,940 KB
testcase_24 AC 353 ms
64,284 KB
testcase_25 AC 360 ms
64,000 KB
testcase_26 AC 235 ms
60,144 KB
testcase_27 AC 238 ms
60,148 KB
testcase_28 AC 185 ms
56,164 KB
testcase_29 AC 181 ms
56,052 KB
testcase_30 AC 310 ms
63,940 KB
testcase_31 AC 291 ms
65,828 KB
testcase_32 AC 264 ms
63,072 KB
testcase_33 AC 280 ms
63,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		int k = sc.nextInt();
		List<Integer> list = new ArrayList<>();
		for (int i=0; i<n; i++) {
			if (i%4==0) {list.add(1);}
			else if (i%4==1) {list.add(3);}
			else if (i%4==2) {list.add(2);}
			else if (i%4==3) {list.add(4);}
		}
		for (int i=0; i<k; i++) {
			list.add(0,1);
		}
		for (int i=0; i<n; i++) {
			System.out.print(list.get(i));
			if (i!=n-1) {System.out.print(" ");}
		}
	}
}
0