結果
| 問題 | No.612 Move on grid |
| コンテスト | |
| ユーザー |
りあん
|
| 提出日時 | 2017-12-01 18:46:20 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 624 bytes |
| 記録 | |
| コンパイル時間 | 609 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 15,356 KB |
| 最終ジャッジ日時 | 2026-05-22 03:27:02 |
| 合計ジャッジ時間 | 7,297 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 1 TLE * 1 -- * 16 |
ソースコード
t = int(input())
a, b, c, d, e = map(int, input().split())
M = 1000000007
m = 20020
s = 10010
dp = [0 for i in range(m)]
dp[s] = 1
for i in range(t):
nex = [0 for i in range(m)]
for j in range(m):
if dp[j] > 0:
nex[j + a] = (nex[j + a] + dp[j]) % M
nex[j - a] = (nex[j - a] + dp[j]) % M
nex[j + b] = (nex[j + b] + dp[j]) % M
nex[j - b] = (nex[j - b] + dp[j]) % M
nex[j + c] = (nex[j + c] + dp[j]) % M
nex[j - c] = (nex[j - c] + dp[j]) % M
dp = nex
ans = 0
for i in range(s + d, s + e + 1):
ans = (ans + dp[i]) % M
print(ans)
りあん