結果
問題 | No.3004 ヤング図形 |
ユーザー |
![]() |
提出日時 | 2025-01-17 22:01:20 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 508 bytes |
コンパイル時間 | 1,660 ms |
コンパイル使用メモリ | 81,152 KB |
実行使用メモリ | 914,688 KB |
最終ジャッジ日時 | 2025-01-17 22:02:55 |
合計ジャッジ時間 | 47,564 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 MLE * 1 |
other | WA * 4 RE * 15 TLE * 4 MLE * 2 |
ソースコード
mod = 998244353N = 5 * 10 ** 7 + 2F = [1] * Nfor i in range(2, N):F[i] = F[i-1]*i%moddef comb(a, b): #組合せif b < 0:return 0if a < b:return 0return F[a] * pow(F[a], -1, mod) * pow(F[a-b], -1, mod) % modans = 1k = int(input())cnt = 0for _ in range(k):l, m = map(int, input().split())tmp = 1for i in range(m):tmp = comb(l*(i+1)-1, l-1) * tmp % modans = ans * tmp * comb(l * m + cnt, cnt) % modcnt += l*mprint(ans)