結果

問題 No.478 一般門松列列
ユーザー amowweeamowwee
提出日時 2017-01-28 00:02:13
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 433 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 10,692 KB
実行使用メモリ 9,368 KB
最終ジャッジ日時 2023-08-25 11:12:07
合計ジャッジ時間 2,913 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,912 KB
testcase_01 AC 16 ms
7,824 KB
testcase_02 AC 16 ms
7,860 KB
testcase_03 AC 15 ms
7,856 KB
testcase_04 AC 16 ms
7,784 KB
testcase_05 AC 16 ms
7,824 KB
testcase_06 AC 15 ms
7,952 KB
testcase_07 AC 15 ms
7,816 KB
testcase_08 AC 16 ms
7,804 KB
testcase_09 AC 17 ms
7,816 KB
testcase_10 AC 16 ms
7,792 KB
testcase_11 AC 32 ms
9,360 KB
testcase_12 AC 30 ms
9,300 KB
testcase_13 AC 31 ms
9,348 KB
testcase_14 AC 30 ms
9,240 KB
testcase_15 AC 29 ms
9,112 KB
testcase_16 AC 21 ms
8,616 KB
testcase_17 AC 29 ms
9,096 KB
testcase_18 AC 25 ms
8,820 KB
testcase_19 AC 31 ms
9,368 KB
testcase_20 AC 27 ms
9,260 KB
testcase_21 AC 26 ms
9,148 KB
testcase_22 AC 22 ms
8,640 KB
testcase_23 AC 22 ms
8,772 KB
testcase_24 AC 25 ms
8,756 KB
testcase_25 AC 27 ms
8,996 KB
testcase_26 AC 18 ms
8,452 KB
testcase_27 AC 19 ms
8,528 KB
testcase_28 AC 17 ms
8,264 KB
testcase_29 AC 17 ms
8,244 KB
testcase_30 AC 24 ms
8,696 KB
testcase_31 AC 22 ms
8,724 KB
testcase_32 AC 20 ms
8,584 KB
testcase_33 AC 21 ms
8,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int, input().split(" "))
a_list = [1]
kadomatsu_elem_count = n-k-1
last_elem = 1
while kadomatsu_elem_count:
    if kadomatsu_elem_count %2:
        last_elem += 2
        a_list.append(last_elem)
    else:
        last_elem -= 1
        a_list.append(last_elem)
    
    kadomatsu_elem_count -= 1
    
tail_count = k
while tail_count:
    last_elem += 1
    a_list.append(last_elem)
    tail_count -= 1
    
print(*a_list)
0