結果
| 問題 | No.2442 線形写像 |
| コンテスト | |
| ユーザー |
FromBooska
|
| 提出日時 | 2023-08-25 22:30:03 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 994 bytes |
| 記録 | |
| コンパイル時間 | 236 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 97,592 KB |
| 最終ジャッジ日時 | 2026-05-30 06:09:07 |
| 合計ジャッジ時間 | 15,733 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 WA * 5 TLE * 1 -- * 4 |
ソースコード
# わからない
# しかし確実なのはA0=0, A1=それ以後の2個ずつのxor
# すべての項が2**N未満
# あとはランダムに10**5回くらいテストするか
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 r in range(10**7):
i = random.randint(0, 2**N-1)
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')
FromBooska