結果
問題 |
No.3004 ヤング図形
|
ユーザー |
![]() |
提出日時 | 2025-01-17 21:58:42 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 504 bytes |
コンパイル時間 | 326 ms |
コンパイル使用メモリ | 81,928 KB |
実行使用メモリ | 848,820 KB |
最終ジャッジ日時 | 2025-01-17 22:00:29 |
合計ジャッジ時間 | 50,433 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | MLE * 3 |
other | MLE * 25 |
ソースコード
mod = 998244353 N = 10 ** 8 + 2 F = [1] * N for i in range(2, N): F[i] = F[i-1]*i%mod def comb(a, b): #組合せ if b < 0: return 0 if a < b: return 0 return F[a] * pow(F[a], -1, mod) * pow(F[a-b], -1, mod) % mod ans = 1 k = int(input()) cnt = 0 for _ in range(k): l, m = map(int, input().split()) tmp = 1 for i in range(m): tmp = comb(l*(i+1)-1, l-1) * tmp % mod ans = ans * tmp * comb(l * m + cnt, cnt) % mod cnt += l*m print(ans)