結果

問題 No.612 Move on grid
ユーザー cielciel
提出日時 2017-12-31 19:51:36
言語 Crystal
(1.11.2)
結果
WA  
実行時間 -
コード長 241 bytes
コンパイル時間 21,211 ms
コンパイル使用メモリ 257,352 KB
実行使用メモリ 11,328 KB
最終ジャッジ日時 2023-09-13 09:34:22
合計ジャッジ時間 21,525 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
10,076 KB
testcase_01 WA -
testcase_02 AC 8 ms
9,688 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 186 ms
10,020 KB
testcase_09 AC 147 ms
10,072 KB
testcase_10 WA -
testcase_11 AC 45 ms
9,968 KB
testcase_12 WA -
testcase_13 AC 65 ms
9,884 KB
testcase_14 WA -
testcase_15 AC 49 ms
9,932 KB
testcase_16 AC 180 ms
9,996 KB
testcase_17 WA -
testcase_18 AC 153 ms
10,020 KB
testcase_19 WA -
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

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
x=[1_i64]+[0_i64]*200001
t.times{|i|
	y=[0_i64]*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
}
p x[d..e].sum%M
0