結果

問題 No.478 一般門松列列
ユーザー kohei2019kohei2019
提出日時 2022-01-30 11:48:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 239 bytes
コンパイル時間 376 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 77,676 KB
最終ジャッジ日時 2023-09-02 01:31:04
合計ジャッジ時間 5,108 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,420 KB
testcase_01 AC 73 ms
71,636 KB
testcase_02 AC 73 ms
71,168 KB
testcase_03 AC 72 ms
71,528 KB
testcase_04 AC 73 ms
71,168 KB
testcase_05 AC 72 ms
71,164 KB
testcase_06 AC 73 ms
71,524 KB
testcase_07 AC 72 ms
71,708 KB
testcase_08 AC 70 ms
71,316 KB
testcase_09 AC 71 ms
71,320 KB
testcase_10 AC 72 ms
71,632 KB
testcase_11 AC 85 ms
77,676 KB
testcase_12 AC 83 ms
77,144 KB
testcase_13 AC 84 ms
77,480 KB
testcase_14 AC 85 ms
77,604 KB
testcase_15 AC 86 ms
77,116 KB
testcase_16 AC 85 ms
76,736 KB
testcase_17 AC 85 ms
77,088 KB
testcase_18 AC 83 ms
76,776 KB
testcase_19 AC 85 ms
77,116 KB
testcase_20 AC 85 ms
77,012 KB
testcase_21 AC 85 ms
76,712 KB
testcase_22 AC 84 ms
76,772 KB
testcase_23 AC 84 ms
76,636 KB
testcase_24 AC 82 ms
76,804 KB
testcase_25 AC 83 ms
77,028 KB
testcase_26 AC 80 ms
76,376 KB
testcase_27 AC 84 ms
76,632 KB
testcase_28 AC 82 ms
76,536 KB
testcase_29 AC 81 ms
76,840 KB
testcase_30 AC 83 ms
76,968 KB
testcase_31 AC 83 ms
76,872 KB
testcase_32 AC 79 ms
76,576 KB
testcase_33 AC 84 ms
76,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
if K == N-2:
    print(*[1]*(N))
    exit()
ls = [1,3,2]
for i in range(N-K-3):
    if ls[-2] > ls[-1]:
        ls.append(ls[-1]+2)
    else:
        ls.append(ls[-1]-1)
ls += [ls[-1]]*(N-len(ls))
print(*ls)
0