結果

問題 No.478 一般門松列列
ユーザー Mr.FukuMr.Fuku
提出日時 2018-07-13 21:02:06
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 10,620 KB
実行使用メモリ 8,512 KB
最終ジャッジ日時 2023-07-30 09:36:07
合計ジャッジ時間 3,279 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,820 KB
testcase_01 AC 17 ms
7,920 KB
testcase_02 AC 15 ms
7,816 KB
testcase_03 AC 16 ms
7,764 KB
testcase_04 AC 16 ms
7,816 KB
testcase_05 AC 16 ms
7,856 KB
testcase_06 AC 16 ms
7,972 KB
testcase_07 AC 15 ms
7,888 KB
testcase_08 AC 16 ms
7,760 KB
testcase_09 AC 16 ms
7,824 KB
testcase_10 AC 15 ms
7,872 KB
testcase_11 AC 114 ms
8,360 KB
testcase_12 AC 36 ms
8,372 KB
testcase_13 AC 112 ms
8,300 KB
testcase_14 AC 110 ms
8,512 KB
testcase_15 AC 81 ms
8,476 KB
testcase_16 AC 24 ms
8,352 KB
testcase_17 AC 83 ms
8,424 KB
testcase_18 AC 34 ms
8,244 KB
testcase_19 AC 96 ms
8,400 KB
testcase_20 AC 56 ms
8,336 KB
testcase_21 AC 39 ms
8,284 KB
testcase_22 AC 26 ms
8,256 KB
testcase_23 AC 26 ms
8,296 KB
testcase_24 AC 30 ms
8,316 KB
testcase_25 AC 40 ms
8,312 KB
testcase_26 AC 18 ms
7,764 KB
testcase_27 AC 18 ms
7,832 KB
testcase_28 AC 17 ms
7,788 KB
testcase_29 AC 17 ms
7,832 KB
testcase_30 AC 30 ms
8,260 KB
testcase_31 AC 24 ms
8,324 KB
testcase_32 AC 20 ms
7,936 KB
testcase_33 AC 23 ms
8,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
count = n-k-2

a,b = 2,1
ans = str(a) + " " + str(b)
for i in range(n-2):
    if count > 0:
        count -= 1
        if a>b:
            a,b = b,a+1
        else:
            a,b = b,b-1
    ans += " " + str(b)

print(ans)
0