結果

問題 No.2442 線形写像
ユーザー 👑 KazunKazun
提出日時 2023-08-25 22:23:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 187 ms / 2,000 ms
コード長 526 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 87,336 KB
実行使用メモリ 84,588 KB
最終ジャッジ日時 2023-08-26 12:18:24
合計ジャッジ時間 3,639 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,448 KB
testcase_01 AC 67 ms
71,420 KB
testcase_02 AC 76 ms
71,288 KB
testcase_03 AC 67 ms
71,328 KB
testcase_04 AC 69 ms
71,520 KB
testcase_05 AC 67 ms
71,652 KB
testcase_06 AC 68 ms
71,384 KB
testcase_07 AC 69 ms
71,416 KB
testcase_08 AC 71 ms
71,408 KB
testcase_09 AC 71 ms
71,300 KB
testcase_10 AC 72 ms
75,464 KB
testcase_11 AC 74 ms
75,800 KB
testcase_12 AC 74 ms
75,672 KB
testcase_13 AC 76 ms
75,732 KB
testcase_14 AC 75 ms
75,756 KB
testcase_15 AC 100 ms
77,384 KB
testcase_16 AC 99 ms
77,388 KB
testcase_17 AC 184 ms
84,588 KB
testcase_18 AC 132 ms
78,020 KB
testcase_19 AC 130 ms
78,088 KB
testcase_20 AC 131 ms
78,008 KB
testcase_21 AC 187 ms
84,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    N = int(input())

    A = [0] * (1 << N)
    for i in range(1 << N):
        A[i] = int(input())

    if A[0] != 0:
        return False

    for S in range(1 << N):
        SS = S; b = 1
        f = 0
        while SS:
            if SS & 1:
                f ^= A[b]
            SS >>= 1; b <<= 1
        if A[S] != f:
            return False
    return True

#==================================================
import sys
input=sys.stdin.readline
write=sys.stdout.write

print("Yes" if solve() else "No")
0