結果

問題 No.612 Move on grid
ユーザー cielciel
提出日時 2017-12-31 20:19:09
言語 Crystal
(1.11.2)
結果
AC  
実行時間 194 ms / 2,500 ms
コード長 283 bytes
コンパイル時間 20,011 ms
コンパイル使用メモリ 256,936 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2023-09-13 09:33:51
合計ジャッジ時間 21,444 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
9,200 KB
testcase_01 AC 7 ms
10,584 KB
testcase_02 AC 8 ms
9,808 KB
testcase_03 AC 36 ms
10,880 KB
testcase_04 AC 194 ms
10,512 KB
testcase_05 AC 193 ms
10,048 KB
testcase_06 AC 192 ms
9,960 KB
testcase_07 AC 191 ms
9,980 KB
testcase_08 AC 190 ms
9,880 KB
testcase_09 AC 149 ms
9,988 KB
testcase_10 AC 99 ms
9,940 KB
testcase_11 AC 46 ms
9,928 KB
testcase_12 AC 131 ms
9,952 KB
testcase_13 AC 66 ms
10,048 KB
testcase_14 AC 158 ms
9,968 KB
testcase_15 AC 49 ms
10,020 KB
testcase_16 AC 180 ms
10,108 KB
testcase_17 AC 68 ms
9,956 KB
testcase_18 AC 157 ms
9,980 KB
testcase_19 AC 110 ms
9,964 KB
testcase_20 AC 151 ms
10,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env crystal
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}
puts r
0