結果

問題 No.612 Move on grid
ユーザー cielciel
提出日時 2020-02-09 01:13:25
言語 Crystal
(1.11.2)
結果
AC  
実行時間 192 ms / 2,500 ms
コード長 257 bytes
コンパイル時間 21,195 ms
コンパイル使用メモリ 257,456 KB
実行使用メモリ 11,120 KB
最終ジャッジ日時 2023-09-13 10:28:22
合計ジャッジ時間 23,362 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
9,032 KB
testcase_01 AC 8 ms
9,812 KB
testcase_02 AC 9 ms
9,608 KB
testcase_03 AC 36 ms
10,704 KB
testcase_04 AC 190 ms
9,876 KB
testcase_05 AC 189 ms
10,104 KB
testcase_06 AC 192 ms
9,988 KB
testcase_07 AC 191 ms
9,952 KB
testcase_08 AC 190 ms
10,076 KB
testcase_09 AC 150 ms
10,020 KB
testcase_10 AC 100 ms
9,912 KB
testcase_11 AC 45 ms
9,904 KB
testcase_12 AC 130 ms
9,940 KB
testcase_13 AC 66 ms
9,940 KB
testcase_14 AC 159 ms
10,008 KB
testcase_15 AC 50 ms
9,796 KB
testcase_16 AC 184 ms
10,080 KB
testcase_17 AC 71 ms
10,080 KB
testcase_18 AC 160 ms
11,120 KB
testcase_19 AC 114 ms
10,100 KB
testcase_20 AC 157 ms
10,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

M=10**9+7
t,a,b,c,d,e=ARGF.gets_to_end.split.map(&.to_i)
w=[a.abs,b.abs,c.abs].max
r=0_i64
x=[1_i64]+[r]*200001
t.times{|i|
	y=[r]*200002
	(-w*-~i..w*-~i).map{|j|
		y[j]=(x[j-a]+x[j+a]+x[j-b]+x[j+b]+x[j-c]+x[j+c])%M
	}
	x=y
}
(d..e).map{|i|r=(r+x[i])%M}
p r
0