結果

問題 No.2024 Xer
ユーザー AEnAEn
提出日時 2022-09-01 14:34:20
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 962 bytes
コンパイル時間 521 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 171,412 KB
最終ジャッジ日時 2024-04-26 16:33:32
合計ジャッジ時間 25,633 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,096 KB
testcase_01 AC 40 ms
52,608 KB
testcase_02 AC 42 ms
52,608 KB
testcase_03 AC 41 ms
52,608 KB
testcase_04 AC 42 ms
52,224 KB
testcase_05 AC 41 ms
52,608 KB
testcase_06 AC 41 ms
52,480 KB
testcase_07 TLE -
testcase_08 AC 1,709 ms
171,412 KB
testcase_09 AC 429 ms
136,628 KB
testcase_10 AC 1,702 ms
171,264 KB
testcase_11 AC 632 ms
97,268 KB
testcase_12 AC 1,167 ms
115,636 KB
testcase_13 AC 1,332 ms
122,668 KB
testcase_14 TLE -
testcase_15 AC 905 ms
104,948 KB
testcase_16 AC 1,493 ms
126,444 KB
testcase_17 AC 188 ms
94,312 KB
testcase_18 AC 767 ms
102,632 KB
testcase_19 TLE -
testcase_20 AC 279 ms
106,124 KB
testcase_21 AC 386 ms
137,248 KB
testcase_22 AC 386 ms
136,656 KB
testcase_23 AC 386 ms
136,772 KB
testcase_24 AC 387 ms
137,112 KB
testcase_25 AC 54 ms
63,360 KB
testcase_26 AC 68 ms
73,344 KB
testcase_27 AC 113 ms
76,828 KB
testcase_28 AC 67 ms
68,736 KB
testcase_29 AC 60 ms
66,432 KB
testcase_30 AC 72 ms
74,368 KB
testcase_31 AC 80 ms
77,612 KB
testcase_32 AC 136 ms
78,068 KB
testcase_33 AC 72 ms
72,320 KB
testcase_34 AC 49 ms
61,472 KB
testcase_35 AC 41 ms
52,480 KB
testcase_36 AC 70 ms
72,576 KB
testcase_37 AC 69 ms
73,728 KB
testcase_38 AC 79 ms
77,420 KB
testcase_39 AC 50 ms
61,056 KB
testcase_40 AC 66 ms
67,840 KB
testcase_41 AC 115 ms
76,968 KB
testcase_42 AC 70 ms
73,668 KB
testcase_43 AC 121 ms
76,928 KB
testcase_44 AC 130 ms
77,988 KB
testcase_45 AC 328 ms
118,240 KB
testcase_46 AC 120 ms
83,784 KB
testcase_47 AC 262 ms
105,920 KB
testcase_48 AC 40 ms
52,352 KB
testcase_49 AC 42 ms
52,864 KB
testcase_50 AC 41 ms
52,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heappop, heappush

N, X = map(int, input().split())
A = list(map(int, input().split()))
h = []
for i in range(N):
    heappush(h, (A[i], 0, i))
    heappush(h, (A[i]^X, 1, i))
res1, res2 = [], []
for i in range(2*N):
    n, w, idx = heappop(h)
    l1, l2 = len(res1), len(res2)
    w1, w2 = (l1+1)%2, l2%2
    if w1==w2:
        if w1!=w:
            exit(print('No'))
        else:
            if l1>l2:
                if res1[l2] == idx:
                    res2.append(idx)
                else:
                    res1.append(idx)
            else:
                if res2[l1] == idx:
                    res1.append(idx)
                else:
                    res2.append(idx)
    else:
        if w1 == w:
            res1.append(idx)
        else:
            res2.append(idx)
if len(res1) != len(res2):
    exit(print("No"))
else:
    for i in range(N):
        if res1[i] != res2[i]:
            exit(print("No"))
    print('Yes')
0