結果

問題 No.478 一般門松列列
コンテスト
ユーザー nebukuro09
提出日時 2017-01-27 22:35:12
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 295 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 77,364 KB
最終ジャッジ日時 2025-12-03 23:01:59
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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