結果

問題 No.2442 線形写像
ユーザー 👑 KazunKazun
提出日時 2023-08-26 00:50:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 174 ms / 2,000 ms
コード長 486 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 84,444 KB
最終ジャッジ日時 2023-08-26 12:19:04
合計ジャッジ時間 3,585 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,096 KB
testcase_01 AC 66 ms
71,620 KB
testcase_02 AC 64 ms
71,468 KB
testcase_03 AC 64 ms
71,096 KB
testcase_04 AC 62 ms
71,340 KB
testcase_05 AC 65 ms
71,496 KB
testcase_06 AC 69 ms
71,096 KB
testcase_07 AC 65 ms
71,568 KB
testcase_08 AC 66 ms
71,236 KB
testcase_09 AC 65 ms
71,436 KB
testcase_10 AC 68 ms
75,480 KB
testcase_11 AC 72 ms
75,532 KB
testcase_12 AC 71 ms
75,812 KB
testcase_13 AC 70 ms
75,692 KB
testcase_14 AC 72 ms
75,776 KB
testcase_15 AC 95 ms
77,316 KB
testcase_16 AC 99 ms
77,348 KB
testcase_17 AC 173 ms
84,444 KB
testcase_18 AC 125 ms
78,040 KB
testcase_19 AC 124 ms
77,656 KB
testcase_20 AC 129 ms
78,040 KB
testcase_21 AC 174 ms
84,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

    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