結果

問題 No.1689 Set Cards
ユーザー とりゐとりゐ
提出日時 2021-09-24 21:46:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 77,768 KB
最終ジャッジ日時 2023-09-18 21:05:05
合計ジャッジ時間 4,135 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
76,684 KB
testcase_01 AC 89 ms
76,364 KB
testcase_02 AC 89 ms
76,836 KB
testcase_03 AC 90 ms
76,380 KB
testcase_04 AC 89 ms
76,640 KB
testcase_05 AC 90 ms
76,600 KB
testcase_06 AC 90 ms
76,584 KB
testcase_07 AC 87 ms
76,668 KB
testcase_08 AC 85 ms
76,648 KB
testcase_09 AC 89 ms
76,676 KB
testcase_10 AC 90 ms
76,708 KB
testcase_11 AC 118 ms
77,168 KB
testcase_12 AC 115 ms
77,540 KB
testcase_13 AC 114 ms
77,452 KB
testcase_14 AC 115 ms
77,096 KB
testcase_15 AC 100 ms
76,836 KB
testcase_16 AC 113 ms
77,768 KB
testcase_17 AC 93 ms
76,512 KB
testcase_18 AC 117 ms
76,968 KB
testcase_19 AC 122 ms
77,152 KB
testcase_20 AC 124 ms
76,976 KB
testcase_21 AC 103 ms
76,652 KB
testcase_22 AC 106 ms
76,644 KB
testcase_23 AC 104 ms
76,416 KB
testcase_24 AC 120 ms
77,108 KB
testcase_25 AC 119 ms
77,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
cnt=[0]*(2**13)
a=[]
for i in range(n):
  b=list(map(int,input().split()))
  tmp=0
  for j in b[1:]:
    tmp+=2**j
  a.append(tmp)
mod=998244353
ans=0
for bit in range(1,2**13):
  tmp=0
  for i in a:
    if bit&i==bit:
      tmp+=1
  num=pow(2,tmp,mod)-1
  c=0
  for i in range(13):
    if bit&(1<<i)!=0:
      c+=1
  if c%2==0:
    ans-=num
  else:
    ans+=num
print((pow(2,n,mod)-ans-1)%mod)
0