結果

問題 No.2442 線形写像
ユーザー MasKoaTSMasKoaTS
提出日時 2023-08-25 21:33:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 282 ms / 2,000 ms
コード長 971 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 87,356 KB
実行使用メモリ 96,556 KB
最終ジャッジ日時 2023-08-26 12:17:35
合計ジャッジ時間 6,655 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 201 ms
80,992 KB
testcase_01 AC 199 ms
80,972 KB
testcase_02 AC 199 ms
80,828 KB
testcase_03 AC 201 ms
80,900 KB
testcase_04 AC 195 ms
80,996 KB
testcase_05 AC 199 ms
80,736 KB
testcase_06 AC 200 ms
80,860 KB
testcase_07 AC 201 ms
80,972 KB
testcase_08 AC 197 ms
80,872 KB
testcase_09 AC 200 ms
80,996 KB
testcase_10 AC 197 ms
80,900 KB
testcase_11 AC 200 ms
81,000 KB
testcase_12 AC 201 ms
80,992 KB
testcase_13 AC 198 ms
80,876 KB
testcase_14 AC 202 ms
81,032 KB
testcase_15 AC 224 ms
85,356 KB
testcase_16 AC 222 ms
85,348 KB
testcase_17 AC 280 ms
96,520 KB
testcase_18 AC 245 ms
86,444 KB
testcase_19 AC 245 ms
86,452 KB
testcase_20 AC 250 ms
86,260 KB
testcase_21 AC 282 ms
96,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools as iter
import collections as coll
import heapq as hq
import bisect as bis
from decimal import Decimal as dec
from functools import cmp_to_key
import math
import sys
#import pypyjit
#pypyjit.set_param('max_unroll_recursion=-1')
sys.setrecursionlimit(10 ** 6)
inp = sys.stdin.readline
input = lambda : inp()[:-1]
getN = lambda : int(inp())
getNs = lambda : map(int, inp().split())
getList = lambda :list(map(int, inp().split()))
getStrs = lambda n : [input() for _ in [0] * n]
getEdges = lambda n : [[x - 1 for x in getNs()] for _ in [0] * n]
def yexit(): print("Yes"); exit(0)
def nexit(): print("No"); exit(0)
pi = 3.141592653589793
mod = 1000000007
MOD = 998244353
INF = 4611686018427387903
dx = [1, 0, -1, 0];  dy = [0, 1, 0, -1]
#di = coll.defaultdict(int)
 
 
"""
Main Code
"""

n = getN()
a = [getN() for _ in [0] * (1 << n)]

if(a[0] != 0):
    nexit()
for i in range(1, 1 << n):
    if(a[i ^ (i - 1)] != a[i] ^ a[i - 1]):
        nexit()
yexit()
0