結果

問題 No.478 一般門松列列
ユーザー imulanimulan
提出日時 2017-01-28 02:42:40
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 694 ms
コンパイル使用メモリ 10,724 KB
実行使用メモリ 9,212 KB
最終ジャッジ日時 2023-08-25 12:41:12
合計ジャッジ時間 3,338 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,788 KB
testcase_01 AC 13 ms
7,856 KB
testcase_02 AC 14 ms
7,836 KB
testcase_03 AC 13 ms
7,812 KB
testcase_04 AC 13 ms
7,844 KB
testcase_05 AC 13 ms
7,744 KB
testcase_06 AC 13 ms
7,716 KB
testcase_07 AC 12 ms
7,900 KB
testcase_08 AC 13 ms
7,760 KB
testcase_09 AC 13 ms
7,860 KB
testcase_10 AC 13 ms
7,860 KB
testcase_11 AC 20 ms
8,916 KB
testcase_12 AC 21 ms
9,088 KB
testcase_13 AC 20 ms
8,924 KB
testcase_14 AC 20 ms
9,212 KB
testcase_15 AC 19 ms
8,804 KB
testcase_16 AC 15 ms
8,356 KB
testcase_17 AC 20 ms
9,212 KB
testcase_18 AC 17 ms
8,528 KB
testcase_19 AC 20 ms
8,888 KB
testcase_20 AC 18 ms
8,752 KB
testcase_21 AC 17 ms
8,704 KB
testcase_22 AC 16 ms
8,496 KB
testcase_23 AC 15 ms
8,400 KB
testcase_24 AC 17 ms
8,620 KB
testcase_25 AC 19 ms
8,844 KB
testcase_26 AC 14 ms
8,200 KB
testcase_27 AC 13 ms
8,128 KB
testcase_28 AC 15 ms
7,800 KB
testcase_29 AC 13 ms
7,768 KB
testcase_30 AC 17 ms
8,532 KB
testcase_31 AC 17 ms
8,436 KB
testcase_32 AC 14 ms
8,284 KB
testcase_33 AC 17 ms
8,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n,k = map(int,input().split())

    w = [0 for _ in range(n)]

    now = 0
    for i in range(0,n,2):
        w[i] = now
        now += 1

    now = 10**9
    for i in range(1,n,2):
        w[i] = now
        now -= 1

    idx = n-1-k
    for i in range(idx+1,n):
        w[i] = w[idx]

    ans = ''
    for i in range(n):
        if i > 0:
            ans += ' '
        ans += str(w[i])

    return ans

if __name__ == '__main__':
    print(main())
0