結果

問題 No.612 Move on grid
ユーザー cielciel
提出日時 2017-12-31 20:18:32
言語 Crystal
(1.11.2)
結果
AC  
実行時間 187 ms / 2,500 ms
コード長 280 bytes
コンパイル時間 19,764 ms
コンパイル使用メモリ 258,100 KB
実行使用メモリ 11,052 KB
最終ジャッジ日時 2023-09-13 09:33:27
合計ジャッジ時間 21,840 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
9,108 KB
testcase_01 AC 7 ms
10,672 KB
testcase_02 AC 8 ms
9,732 KB
testcase_03 AC 36 ms
9,812 KB
testcase_04 AC 187 ms
10,048 KB
testcase_05 AC 187 ms
9,960 KB
testcase_06 AC 186 ms
10,008 KB
testcase_07 AC 185 ms
11,052 KB
testcase_08 AC 187 ms
10,120 KB
testcase_09 AC 150 ms
9,936 KB
testcase_10 AC 100 ms
9,952 KB
testcase_11 AC 45 ms
10,816 KB
testcase_12 AC 127 ms
9,948 KB
testcase_13 AC 66 ms
10,764 KB
testcase_14 AC 155 ms
10,128 KB
testcase_15 AC 48 ms
9,968 KB
testcase_16 AC 176 ms
9,952 KB
testcase_17 AC 68 ms
10,124 KB
testcase_18 AC 152 ms
10,576 KB
testcase_19 AC 109 ms
9,984 KB
testcase_20 AC 150 ms
10,024 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}
p r
0