結果

問題 No.478 一般門松列列
ユーザー Tsuneo YoshiokaTsuneo Yoshioka
提出日時 2017-01-27 22:53:22
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 226 bytes
コンパイル時間 39 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 12,672 KB
最終ジャッジ日時 2024-12-23 16:39:28
合計ジャッジ時間 8,774 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 31
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,k=gets.split.map(&:to_i)
sign=1
cur=10000
result=[]
n.times{|i|
    cur += sign
    result << cur
    # puts "cur=#{cur}, sign=#{sign}, i=#{i} n-k-1=#{n-k-1}"
    if i<n-k-1
        sign *=-1
    end
}
puts result.join(' ')
0