結果

問題 No.478 一般門松列列
ユーザー magurogumamaguroguma
提出日時 2017-08-20 17:50:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,648 KB
最終ジャッジ日時 2024-04-22 18:21:51
合計ジャッジ時間 3,051 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
10,752 KB
testcase_01 AC 30 ms
10,880 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 30 ms
10,880 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 31 ms
10,752 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 AC 31 ms
10,752 KB
testcase_08 AC 31 ms
10,752 KB
testcase_09 AC 30 ms
10,880 KB
testcase_10 AC 31 ms
10,880 KB
testcase_11 AC 56 ms
11,648 KB
testcase_12 AC 59 ms
11,520 KB
testcase_13 AC 57 ms
11,520 KB
testcase_14 AC 57 ms
11,520 KB
testcase_15 AC 56 ms
11,520 KB
testcase_16 AC 40 ms
11,008 KB
testcase_17 AC 56 ms
11,520 KB
testcase_18 AC 47 ms
11,264 KB
testcase_19 AC 57 ms
11,520 KB
testcase_20 AC 52 ms
11,392 KB
testcase_21 AC 49 ms
11,264 KB
testcase_22 AC 42 ms
11,136 KB
testcase_23 AC 41 ms
11,136 KB
testcase_24 AC 48 ms
11,264 KB
testcase_25 AC 54 ms
11,392 KB
testcase_26 AC 35 ms
10,880 KB
testcase_27 AC 36 ms
10,880 KB
testcase_28 AC 34 ms
11,008 KB
testcase_29 AC 33 ms
10,752 KB
testcase_30 AC 45 ms
11,136 KB
testcase_31 AC 41 ms
11,008 KB
testcase_32 AC 38 ms
11,008 KB
testcase_33 AC 40 ms
11,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

n, k = map(int, input().split())

l = [1, 25000]
for i in range(1, n-1):
    a = l[i-1]
    b = l[i]
    # 門松列を作らない
    if k>0:
        c = a+25000 if a>b else b+25000
        l.append(c)
        k -= 1
    # 門松列を作る
    else:
        c = a-1 if a>b else a+1
        l.append(c)
for num in l:
    print(num)
0