結果

問題 No.478 一般門松列列
ユーザー FromBooskaFromBooska
提出日時 2023-04-08 09:51:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 316 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 82,140 KB
実行使用メモリ 68,792 KB
最終ジャッジ日時 2024-04-14 08:41:46
合計ジャッジ時間 3,507 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,620 KB
testcase_01 AC 38 ms
52,908 KB
testcase_02 AC 38 ms
53,160 KB
testcase_03 AC 38 ms
52,280 KB
testcase_04 AC 38 ms
52,352 KB
testcase_05 AC 38 ms
52,012 KB
testcase_06 AC 38 ms
53,152 KB
testcase_07 AC 38 ms
53,132 KB
testcase_08 AC 38 ms
52,688 KB
testcase_09 AC 38 ms
53,356 KB
testcase_10 AC 37 ms
52,028 KB
testcase_11 AC 52 ms
68,792 KB
testcase_12 AC 51 ms
67,664 KB
testcase_13 AC 53 ms
68,532 KB
testcase_14 AC 54 ms
68,288 KB
testcase_15 AC 52 ms
67,912 KB
testcase_16 AC 50 ms
64,748 KB
testcase_17 AC 52 ms
67,572 KB
testcase_18 AC 52 ms
66,076 KB
testcase_19 AC 54 ms
67,528 KB
testcase_20 AC 52 ms
67,864 KB
testcase_21 AC 51 ms
67,048 KB
testcase_22 AC 49 ms
64,496 KB
testcase_23 AC 50 ms
64,712 KB
testcase_24 AC 50 ms
64,836 KB
testcase_25 AC 52 ms
67,852 KB
testcase_26 AC 49 ms
63,096 KB
testcase_27 AC 50 ms
64,008 KB
testcase_28 AC 48 ms
62,496 KB
testcase_29 AC 50 ms
61,928 KB
testcase_30 AC 52 ms
65,280 KB
testcase_31 AC 51 ms
65,296 KB
testcase_32 AC 49 ms
63,612 KB
testcase_33 AC 51 ms
65,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 1, 3, 2, 4, 1, 3, 2, 4, 1を続けて、非門松部分は同じ数字とすればいいか

N, K = map(int, input().split())
nxt = [0, 3, 4, 2, 1]
ans = []
for i in range(N):
    if i == 0:
        ans.append(1)
    elif i < N-K:
        ans.append(nxt[ans[-1]])
    else:
        ans.append(ans[-1])

print(*ans)
0