結果

問題 No.2024 Xer
ユーザー tktk_snsntktk_snsn
提出日時 2022-07-29 22:53:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 739 ms / 2,000 ms
コード長 579 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 90,288 KB
最終ジャッジ日時 2023-09-26 22:22:15
合計ジャッジ時間 13,314 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,264 KB
testcase_01 AC 18 ms
8,300 KB
testcase_02 AC 16 ms
8,216 KB
testcase_03 AC 16 ms
8,212 KB
testcase_04 AC 16 ms
8,300 KB
testcase_05 AC 17 ms
8,364 KB
testcase_06 AC 17 ms
8,272 KB
testcase_07 AC 719 ms
86,596 KB
testcase_08 AC 508 ms
90,220 KB
testcase_09 AC 725 ms
86,916 KB
testcase_10 AC 537 ms
90,288 KB
testcase_11 AC 229 ms
32,908 KB
testcase_12 AC 400 ms
51,488 KB
testcase_13 AC 463 ms
56,348 KB
testcase_14 AC 732 ms
87,052 KB
testcase_15 AC 316 ms
41,468 KB
testcase_16 AC 488 ms
61,228 KB
testcase_17 AC 234 ms
39,024 KB
testcase_18 AC 274 ms
37,904 KB
testcase_19 AC 739 ms
83,800 KB
testcase_20 AC 362 ms
54,332 KB
testcase_21 AC 647 ms
86,904 KB
testcase_22 AC 647 ms
86,824 KB
testcase_23 AC 644 ms
86,956 KB
testcase_24 AC 644 ms
86,912 KB
testcase_25 AC 19 ms
8,584 KB
testcase_26 AC 26 ms
9,984 KB
testcase_27 AC 24 ms
9,232 KB
testcase_28 AC 19 ms
8,548 KB
testcase_29 AC 20 ms
8,832 KB
testcase_30 AC 24 ms
9,720 KB
testcase_31 AC 28 ms
10,264 KB
testcase_32 AC 30 ms
10,180 KB
testcase_33 AC 23 ms
9,596 KB
testcase_34 AC 19 ms
8,524 KB
testcase_35 AC 17 ms
8,336 KB
testcase_36 AC 23 ms
9,540 KB
testcase_37 AC 26 ms
9,960 KB
testcase_38 AC 28 ms
10,752 KB
testcase_39 AC 17 ms
8,228 KB
testcase_40 AC 18 ms
8,432 KB
testcase_41 AC 23 ms
9,236 KB
testcase_42 AC 25 ms
9,684 KB
testcase_43 AC 25 ms
9,552 KB
testcase_44 AC 27 ms
9,840 KB
testcase_45 AC 554 ms
72,376 KB
testcase_46 AC 117 ms
23,092 KB
testcase_47 AC 414 ms
57,840 KB
testcase_48 AC 16 ms
8,348 KB
testcase_49 AC 16 ms
8,328 KB
testcase_50 AC 16 ms
8,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from operator import itemgetter


N, X = map(int, input().split())
A = list(map(int, input().split()))
A.sort()


M = []
for i, a in enumerate(A):
    M.append((a, i, 0))
    M.append((a ^ X, i, 1))

M.sort(key=itemgetter(0, 1))


rank = []
seen = set()
for _, i, _ in M:
    if i in seen:
        continue
    rank.append(i)
    seen.add(i)


assert(len(rank) == N)
ok = 1
for i in range(N - 1):
    if A[rank[i]] ^ X >= A[rank[i+1]]:
        ok = 0
        break
    if A[rank[i]] >= A[rank[i+1]] ^ X:
        ok = 0
        break

if ok:
    print("Yes")
else:
    print("No")
0