結果
問題 | No.498 ワープクリスタル (給料日編) |
ユーザー |
|
提出日時 | 2024-07-14 09:23:38 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 742 bytes |
コンパイル時間 | 452 ms |
コンパイル使用メモリ | 82,152 KB |
実行使用メモリ | 449,112 KB |
最終ジャッジ日時 | 2024-07-14 09:23:56 |
合計ジャッジ時間 | 15,862 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 WA * 2 |
ソースコード
from collections import defaultdictMOD = 10**9 + 7MAX = 76fac = [1] * MAXfor i in range(1, MAX):fac[i] = fac[i - 1] * i % MODGx, Gy, K = map(int, input().split())cand = defaultdict(list)cand[(0, 0)] = [[]]for _ in range(K):nx, ny, n = map(int, input().split())new_cand = defaultdict(list)for (x, y), lst in cand.items():for crystal in lst:new_cand[(x, y)].append(crystal + [0])for i in range(1, n + 1):new_cand[(x + i * nx, y + i * ny)].append(crystal + [i])cand = new_candres = cand[(Gx, Gy)]ans = 0for crystal in res:tmp = fac[sum(crystal)]for x in crystal:tmp *= pow(fac[x], -1, MOD)tmp %= MODans += tmpprint(ans)