結果
問題 | No.478 一般門松列列 |
ユーザー |
|
提出日時 | 2017-01-27 22:46:41 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 154 ms / 2,000 ms |
コード長 | 221 bytes |
コンパイル時間 | 678 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 12,544 KB |
最終ジャッジ日時 | 2024-12-23 16:34:16 |
合計ジャッジ時間 | 6,326 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 34 |
コンパイルメッセージ
Syntax OK
ソースコード
n,k=gets.split.map(&:to_i) ans=[0] x = 0 (n-k).times{|i| if i == 0 next end if i % 2 == 0 x -= 1 else x += 2 end ans.push(x) } ans.push([ans[-1]] * k) puts ans.join(' ')