結果

問題 No.336 門松列列
ユーザー cielciel
提出日時 2016-01-15 23:53:03
言語 Ruby
(3.3.0)
結果
AC  
実行時間 453 ms / 2,000 ms
コード長 139 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 11,496 KB
実行使用メモリ 15,332 KB
最終ジャッジ日時 2023-09-02 18:44:36
合計ジャッジ時間 4,375 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 378 ms
15,092 KB
testcase_01 AC 77 ms
15,160 KB
testcase_02 AC 79 ms
15,040 KB
testcase_03 AC 79 ms
15,068 KB
testcase_04 AC 453 ms
15,084 KB
testcase_05 AC 78 ms
15,332 KB
testcase_06 AC 119 ms
15,308 KB
testcase_07 AC 208 ms
15,072 KB
testcase_08 AC 315 ms
15,076 KB
testcase_09 AC 444 ms
15,028 KB
testcase_10 AC 450 ms
15,264 KB
testcase_11 AC 453 ms
15,092 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
a={-1=>0,0=>2};k=0;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