結果

問題 No.478 一般門松列列
ユーザー nanaenanae
提出日時 2017-01-27 22:52:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 573 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 10,828 KB
実行使用メモリ 9,616 KB
最終ジャッジ日時 2023-08-25 04:27:30
合計ジャッジ時間 2,642 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,064 KB
testcase_01 AC 16 ms
7,912 KB
testcase_02 AC 17 ms
7,908 KB
testcase_03 AC 17 ms
8,036 KB
testcase_04 AC 16 ms
8,000 KB
testcase_05 AC 16 ms
8,000 KB
testcase_06 AC 16 ms
7,960 KB
testcase_07 AC 16 ms
7,960 KB
testcase_08 AC 17 ms
8,032 KB
testcase_09 AC 17 ms
7,956 KB
testcase_10 AC 16 ms
7,964 KB
testcase_11 AC 34 ms
9,616 KB
testcase_12 AC 24 ms
9,060 KB
testcase_13 AC 31 ms
9,292 KB
testcase_14 AC 28 ms
9,120 KB
testcase_15 AC 27 ms
9,068 KB
testcase_16 AC 22 ms
8,592 KB
testcase_17 AC 28 ms
9,088 KB
testcase_18 AC 27 ms
9,044 KB
testcase_19 AC 29 ms
9,132 KB
testcase_20 AC 28 ms
9,032 KB
testcase_21 AC 27 ms
9,164 KB
testcase_22 AC 21 ms
8,700 KB
testcase_23 AC 23 ms
8,852 KB
testcase_24 AC 22 ms
8,804 KB
testcase_25 AC 24 ms
8,960 KB
testcase_26 AC 18 ms
8,568 KB
testcase_27 AC 19 ms
8,604 KB
testcase_28 AC 17 ms
8,560 KB
testcase_29 AC 17 ms
8,556 KB
testcase_30 AC 25 ms
8,880 KB
testcase_31 AC 22 ms
8,756 KB
testcase_32 AC 19 ms
8,648 KB
testcase_33 AC 21 ms
8,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG: {} -> {}'.format(name, val), file=sys.stderr)
            return None

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

if num_k == 0:
    a = [0] * n
    print(*a)
else:
    a = [1, 0, 2]
    num_k -= 1
    i = 3

    while num_k > 0:
        if i % 2 == 0:
            a.append(i // 2 + 1)
        else:
            a.append((i - 1) // 2)

        i += 1
        num_k -= 1

    fil_n = a[-1]

    a += [fil_n] * (n - len(a))

    print(*a)
0