結果
問題 | No.2136 Dice Calendar? |
ユーザー |
![]() |
提出日時 | 2022-12-03 20:52:24 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 486 bytes |
コンパイル時間 | 199 ms |
コンパイル使用メモリ | 82,656 KB |
実行使用メモリ | 443,212 KB |
最終ジャッジ日時 | 2024-10-11 00:24:36 |
合計ジャッジ時間 | 29,498 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 TLE * 1 |
ソースコード
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.sort() 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)