結果

問題 No.2136 Dice Calendar?
ユーザー とりゐとりゐ
提出日時 2022-12-03 20:49:54
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 478 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 82,944 KB
実行使用メモリ 387,492 KB
最終ジャッジ日時 2024-04-19 07:44:00
合計ジャッジ時間 28,898 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,096 KB
testcase_01 AC 43 ms
52,096 KB
testcase_02 AC 65 ms
69,152 KB
testcase_03 AC 40 ms
52,480 KB
testcase_04 AC 40 ms
52,352 KB
testcase_05 AC 48 ms
61,132 KB
testcase_06 AC 47 ms
61,056 KB
testcase_07 AC 49 ms
61,696 KB
testcase_08 AC 50 ms
63,232 KB
testcase_09 AC 56 ms
66,432 KB
testcase_10 AC 62 ms
69,888 KB
testcase_11 AC 97 ms
91,392 KB
testcase_12 AC 118 ms
101,200 KB
testcase_13 AC 95 ms
90,496 KB
testcase_14 AC 142 ms
112,768 KB
testcase_15 AC 513 ms
207,968 KB
testcase_16 AC 669 ms
255,856 KB
testcase_17 AC 465 ms
208,628 KB
testcase_18 AC 1,771 ms
276,892 KB
testcase_19 AC 2,098 ms
289,652 KB
testcase_20 AC 2,728 ms
314,812 KB
testcase_21 AC 3,315 ms
363,272 KB
testcase_22 AC 4,458 ms
353,600 KB
testcase_23 TLE -
testcase_24 AC 38 ms
52,800 KB
testcase_25 AC 112 ms
91,304 KB
testcase_26 AC 4,746 ms
386,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0