結果

問題 No.2442 線形写像
ユーザー lloyzlloyz
提出日時 2023-08-25 21:54:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 413 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 88,068 KB
最終ジャッジ日時 2023-08-26 12:17:56
合計ジャッジ時間 3,528 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,476 KB
testcase_01 AC 62 ms
71,068 KB
testcase_02 AC 65 ms
71,292 KB
testcase_03 AC 64 ms
71,660 KB
testcase_04 AC 65 ms
71,484 KB
testcase_05 AC 66 ms
71,400 KB
testcase_06 AC 67 ms
71,176 KB
testcase_07 AC 66 ms
71,336 KB
testcase_08 AC 67 ms
71,408 KB
testcase_09 AC 67 ms
71,292 KB
testcase_10 AC 65 ms
71,468 KB
testcase_11 AC 66 ms
71,240 KB
testcase_12 AC 68 ms
71,448 KB
testcase_13 AC 67 ms
71,292 KB
testcase_14 AC 65 ms
71,352 KB
testcase_15 AC 81 ms
77,468 KB
testcase_16 AC 86 ms
77,468 KB
testcase_17 AC 132 ms
87,688 KB
testcase_18 AC 103 ms
78,020 KB
testcase_19 AC 106 ms
78,008 KB
testcase_20 AC 103 ms
78,024 KB
testcase_21 AC 131 ms
88,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

n = int(input())
A = [int(input()) for _ in range(pow(2, n))]
Pow2 = [pow(2, i) for i in range(n)]

if A[0] != 0:
    print("No")
    exit()
if n >= 2:
    for i in range(1, n):
        temp = A[Pow2[i]]
        for j in range(1, pow(2, i)):
            res = temp ^ A[Pow2[i] + j]
            if res != A[j]:
                print("No")
                exit()
print("Yes")
0