結果

問題 No.93 ペガサス
ユーザー gigurururugigurururu
提出日時 2014-12-17 22:19:05
言語 Ruby
(3.2.2)
結果
AC  
実行時間 2,613 ms / 5,000 ms
コード長 303 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 11,336 KB
実行使用メモリ 52,788 KB
最終ジャッジ日時 2023-08-27 05:25:04
合計ジャッジ時間 14,694 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,244 KB
testcase_01 AC 82 ms
15,112 KB
testcase_02 AC 82 ms
15,264 KB
testcase_03 AC 82 ms
15,336 KB
testcase_04 AC 360 ms
28,440 KB
testcase_05 AC 168 ms
21,636 KB
testcase_06 AC 138 ms
20,180 KB
testcase_07 AC 1,289 ms
44,548 KB
testcase_08 AC 572 ms
32,928 KB
testcase_09 AC 2,522 ms
51,180 KB
testcase_10 AC 92 ms
17,068 KB
testcase_11 AC 113 ms
19,324 KB
testcase_12 AC 2,018 ms
49,128 KB
testcase_13 AC 488 ms
31,352 KB
testcase_14 AC 208 ms
23,532 KB
testcase_15 AC 1,698 ms
47,300 KB
testcase_16 AC 258 ms
27,164 KB
testcase_17 AC 82 ms
15,216 KB
testcase_18 AC 81 ms
15,096 KB
testcase_19 AC 2,613 ms
52,788 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
p n<3?n:(3..n).inject([[2,0,0,0]]){|s,i|
  j=0
  s.inject([[0]*4]*2){|(*t,u,v),(a,b,c,d)|
    j+=1
    t+[[u[0]+a*(j-1)+b+c*(j-2)+d,u[1],u[2]+b*(j-2)+d*(j-3),u[3]],[a*(i-1-j)+c*(i-j),c+v[1],b*(i-1-j)+d*(i-j),d+v[3]],[0,a*2+c,0,b*2+d]].map{|k|k.map{|l|l%1000000007}}
  }[1..-1]
}[0][0]
0