結果

問題 No.478 一般門松列列
ユーザー nebukuro09nebukuro09
提出日時 2017-01-27 22:35:12
言語 Python2
(2.7.18)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 295 bytes
コンパイル時間 1,093 ms
コンパイル使用メモリ 7,048 KB
実行使用メモリ 8,152 KB
最終ジャッジ日時 2023-08-25 04:06:49
合計ジャッジ時間 2,957 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,996 KB
testcase_01 AC 11 ms
5,916 KB
testcase_02 AC 12 ms
5,952 KB
testcase_03 AC 11 ms
5,964 KB
testcase_04 AC 11 ms
5,856 KB
testcase_05 AC 12 ms
5,832 KB
testcase_06 AC 12 ms
5,916 KB
testcase_07 AC 12 ms
5,868 KB
testcase_08 AC 11 ms
5,908 KB
testcase_09 AC 11 ms
5,904 KB
testcase_10 AC 11 ms
5,936 KB
testcase_11 AC 27 ms
8,016 KB
testcase_12 AC 21 ms
8,100 KB
testcase_13 AC 25 ms
8,152 KB
testcase_14 AC 23 ms
8,028 KB
testcase_15 AC 21 ms
8,024 KB
testcase_16 AC 17 ms
6,544 KB
testcase_17 AC 23 ms
7,912 KB
testcase_18 AC 20 ms
7,208 KB
testcase_19 AC 23 ms
7,976 KB
testcase_20 AC 22 ms
7,500 KB
testcase_21 AC 20 ms
7,396 KB
testcase_22 AC 17 ms
6,824 KB
testcase_23 AC 17 ms
6,812 KB
testcase_24 AC 18 ms
7,076 KB
testcase_25 AC 20 ms
7,692 KB
testcase_26 AC 13 ms
6,240 KB
testcase_27 AC 14 ms
6,256 KB
testcase_28 AC 12 ms
6,120 KB
testcase_29 AC 12 ms
6,092 KB
testcase_30 AC 18 ms
6,944 KB
testcase_31 AC 16 ms
6,724 KB
testcase_32 AC 13 ms
6,400 KB
testcase_33 AC 16 ms
6,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, raw_input().split())
a = [0 for _ in xrange(n)]
for i in xrange(k+2):
    a[i] = i
for i in xrange(k+2, n):
    if i < 2:
        a[i] = i
    elif a[i-1] - a[i-2] > 0:
        a[i] = a[i-2]-1
    else:
        a[i] = a[i-2]+1
print ' '.join(map(str, map(lambda x:x+100000, a)))
0