結果

問題 No.336 門松列列
ユーザー cielciel
提出日時 2016-10-21 00:37:34
言語 Ruby
(3.2.2)
結果
AC  
実行時間 553 ms / 2,000 ms
コード長 136 bytes
コンパイル時間 56 ms
コンパイル使用メモリ 11,236 KB
実行使用メモリ 15,284 KB
最終ジャッジ日時 2023-09-02 18:45:20
合計ジャッジ時間 4,936 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 454 ms
15,128 KB
testcase_01 AC 80 ms
15,148 KB
testcase_02 AC 81 ms
15,124 KB
testcase_03 AC 82 ms
15,284 KB
testcase_04 AC 548 ms
15,252 KB
testcase_05 AC 82 ms
15,080 KB
testcase_06 AC 133 ms
15,160 KB
testcase_07 AC 245 ms
15,028 KB
testcase_08 AC 375 ms
15,084 KB
testcase_09 AC 529 ms
15,136 KB
testcase_10 AC 546 ms
15,284 KB
testcase_11 AC 553 ms
15,164 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%(10**9+7);k+=e}}
p n<3?0:[a[-n/2],a[n/2]][n%2]
0