結果
問題 |
No.2136 Dice Calendar?
|
ユーザー |
![]() |
提出日時 | 2022-12-03 20:49:54 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 478 bytes |
コンパイル時間 | 220 ms |
コンパイル使用メモリ | 82,372 KB |
実行使用メモリ | 389,192 KB |
最終ジャッジ日時 | 2024-10-11 00:22:59 |
合計ジャッジ時間 | 26,879 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 TLE * 1 -- * 3 |
ソースコード
mod=998244353 fac=[1] for i in range(1,100): fac.append(fac[-1]*i%mod) finv=[] for i in range(100): finv.append(pow(fac[i],mod-2,mod)) n=int(input()) s=[] for i in range(n): s.append(list(map(lambda x:int(x)-1,input().split()))) S=set([0]) for si in s: nS=set() for i in S: for j in si: nS.add(i+(1<<(5*j))) S=nS ans=0 for bit in S: res=fac[n] for j in range(9): x=bit&31 res*=finv[x] res%=mod bit>>=5 ans+=res print(ans%mod)