結果

問題 No.1689 Set Cards
ユーザー mymelochanmymelochan
提出日時 2021-09-25 01:46:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 1,454 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 77,084 KB
最終ジャッジ日時 2023-09-18 22:44:25
合計ジャッジ時間 3,944 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
76,336 KB
testcase_01 AC 88 ms
76,284 KB
testcase_02 AC 86 ms
76,416 KB
testcase_03 AC 92 ms
76,304 KB
testcase_04 AC 85 ms
76,296 KB
testcase_05 AC 86 ms
76,552 KB
testcase_06 AC 84 ms
76,492 KB
testcase_07 AC 84 ms
76,308 KB
testcase_08 AC 87 ms
76,356 KB
testcase_09 AC 85 ms
76,352 KB
testcase_10 AC 84 ms
76,452 KB
testcase_11 AC 106 ms
76,924 KB
testcase_12 AC 116 ms
77,084 KB
testcase_13 AC 105 ms
77,044 KB
testcase_14 AC 111 ms
76,860 KB
testcase_15 AC 92 ms
76,304 KB
testcase_16 AC 105 ms
77,036 KB
testcase_17 AC 88 ms
76,532 KB
testcase_18 AC 112 ms
77,076 KB
testcase_19 AC 105 ms
76,908 KB
testcase_20 AC 104 ms
76,920 KB
testcase_21 AC 93 ms
76,424 KB
testcase_22 AC 95 ms
76,536 KB
testcase_23 AC 95 ms
76,296 KB
testcase_24 AC 109 ms
76,868 KB
testcase_25 AC 108 ms
76,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
MOD = 998244353
B = []
for _ in range(N):
    L = list(map(int,input().split()))
    C = L[1:]
    b = 0
    for c in C:
        b += 1<<(c-1)
    B.append(b)

ans = 0
for bit in range(1<<12):
    cnt = 0
    sgn = (-1)**bin(bit).count("1")
    for b in B:
        if bit&b == bit:
            cnt += 1
    ans += pow(2,cnt,MOD)*sgn
    ans %= MOD
print(ans)
0