結果

問題 No.2442 線形写像
ユーザー FromBooskaFromBooska
提出日時 2023-08-25 22:55:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,063 bytes
コンパイル時間 785 ms
コンパイル使用メモリ 82,444 KB
実行使用メモリ 92,708 KB
最終ジャッジ日時 2024-06-06 17:41:03
合計ジャッジ時間 7,552 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
54,016 KB
testcase_01 AC 38 ms
51,584 KB
testcase_02 AC 37 ms
52,096 KB
testcase_03 AC 41 ms
53,760 KB
testcase_04 AC 43 ms
54,144 KB
testcase_05 WA -
testcase_06 AC 40 ms
54,144 KB
testcase_07 WA -
testcase_08 AC 54 ms
64,000 KB
testcase_09 AC 59 ms
68,736 KB
testcase_10 AC 70 ms
76,672 KB
testcase_11 AC 86 ms
76,672 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 87 ms
76,672 KB
testcase_15 AC 711 ms
79,488 KB
testcase_16 WA -
testcase_17 TLE -
testcase_18 AC 1,294 ms
81,252 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

# わからない
# しかし確実なのはA0=0, A1=それ以後の2個ずつのxor
# すべての項が2**N未満
# あとはランダムに10**5回くらいテストするか、WAした
# 全iに対して100回ずつテストしよう

N = int(input())
A = []
max_test = True
for i in range(2**N):
    a = int(input())
    A.append(a)
    if a >= 2**N:
        max_test = False
A0_test = True
if A[0] != 0:
    A0_test = False
    
if N == 0:
    if A0_test == True:
        print('Yes')
    else:
        print('No')
    exit()
    
A1 = A[1]
A1_test = True
for i in range(1, 2**(N-1)):
    #print(A[i*2], A[i*2+1], A[i*2]^A[i*2+1])
    if A[i*2]^A[i*2+1] != A1:
        A1_test = False
        
#print(max_test, A0_test, A1_test)

import random
random_test = True
for i in range(1, 2**N):
    for r in range(100):
        j = random.randint(0, 2**N-1)
        if A[i^j] != A[i]^A[j]:
            random_test = False
            break

if max_test == True and A0_test == True and A1_test == True and random_test == True:
    print('Yes')
else:
    print('No')
0