結果

問題 No.336 門松列列
ユーザー cielciel
提出日時 2016-01-16 15:33:13
言語 Ruby
(3.3.0)
結果
AC  
実行時間 470 ms / 2,000 ms
コード長 137 bytes
コンパイル時間 1,329 ms
コンパイル使用メモリ 11,496 KB
実行使用メモリ 15,328 KB
最終ジャッジ日時 2023-09-02 18:45:04
合計ジャッジ時間 4,511 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 384 ms
15,040 KB
testcase_01 AC 83 ms
15,288 KB
testcase_02 AC 84 ms
15,328 KB
testcase_03 AC 82 ms
15,128 KB
testcase_04 AC 461 ms
15,044 KB
testcase_05 AC 85 ms
15,124 KB
testcase_06 AC 124 ms
15,288 KB
testcase_07 AC 215 ms
15,080 KB
testcase_08 AC 321 ms
15,192 KB
testcase_09 AC 445 ms
15,304 KB
testcase_10 AC 458 ms
15,300 KB
testcase_11 AC 470 ms
15,196 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
a={-1=>k=0,0=>2};e=1
0.upto(n){|i|m=a[k+e]=0;e=-e
0.upto(i){|j|m+=a[k];a[k]=m%1000000007;k+=e}}
p n<3?0:[a[-n/2],a[n/2]][n%2]
0