結果
問題 | No.612 Move on grid |
ユーザー |
![]() |
提出日時 | 2020-06-04 18:18:47 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,192 ms / 2,500 ms |
コード長 | 424 bytes |
コンパイル時間 | 156 ms |
コンパイル使用メモリ | 82,580 KB |
実行使用メモリ | 144,176 KB |
最終ジャッジ日時 | 2024-11-29 17:51:54 |
合計ジャッジ時間 | 10,855 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 |
ソースコード
from collections import defaultdictt=int(input())a,b,c,d,e=map(int,input().split())md=10**9+7dp=defaultdict(int)dp[0]=1for i in range(t):ndp=defaultdict(int)for s,k in dp.items():ndp[s+a]+=kndp[s-a]+=kndp[s+b]+=kndp[s-b]+=kndp[s+c]+=kndp[s-c]+=kfor s in ndp.keys():ndp[s]%=mddp=ndpans=0for s in range(d,e+1):ans=(ans+dp[s])%mdprint(ans)