結果

問題 No.478 一般門松列列
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-25 02:13:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 394 ms / 2,000 ms
コード長 546 bytes
コンパイル時間 2,467 ms
コンパイル使用メモリ 76,116 KB
実行使用メモリ 50,288 KB
最終ジャッジ日時 2024-04-24 13:31:10
合計ジャッジ時間 11,586 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
41,240 KB
testcase_01 AC 106 ms
39,872 KB
testcase_02 AC 116 ms
40,976 KB
testcase_03 AC 114 ms
41,300 KB
testcase_04 AC 119 ms
41,192 KB
testcase_05 AC 119 ms
41,140 KB
testcase_06 AC 104 ms
40,120 KB
testcase_07 AC 103 ms
40,228 KB
testcase_08 AC 117 ms
41,404 KB
testcase_09 AC 116 ms
41,112 KB
testcase_10 AC 110 ms
39,976 KB
testcase_11 AC 364 ms
50,064 KB
testcase_12 AC 394 ms
49,828 KB
testcase_13 AC 373 ms
50,288 KB
testcase_14 AC 386 ms
49,876 KB
testcase_15 AC 348 ms
49,088 KB
testcase_16 AC 260 ms
48,200 KB
testcase_17 AC 361 ms
49,792 KB
testcase_18 AC 304 ms
49,616 KB
testcase_19 AC 381 ms
50,048 KB
testcase_20 AC 338 ms
50,168 KB
testcase_21 AC 317 ms
49,788 KB
testcase_22 AC 267 ms
48,996 KB
testcase_23 AC 275 ms
48,988 KB
testcase_24 AC 320 ms
49,628 KB
testcase_25 AC 394 ms
49,632 KB
testcase_26 AC 222 ms
45,032 KB
testcase_27 AC 232 ms
46,148 KB
testcase_28 AC 165 ms
41,108 KB
testcase_29 AC 163 ms
41,180 KB
testcase_30 AC 308 ms
49,352 KB
testcase_31 AC 269 ms
48,708 KB
testcase_32 AC 249 ms
47,484 KB
testcase_33 AC 258 ms
48,532 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