結果

問題 No.2024 Xer
ユーザー とりゐとりゐ
提出日時 2022-08-08 15:13:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 978 ms / 2,000 ms
コード長 883 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 81,472 KB
実行使用メモリ 134,808 KB
最終ジャッジ日時 2023-10-19 04:55:11
合計ジャッジ時間 17,538 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,292 KB
testcase_01 AC 37 ms
53,292 KB
testcase_02 AC 38 ms
53,292 KB
testcase_03 AC 43 ms
53,292 KB
testcase_04 AC 38 ms
53,292 KB
testcase_05 AC 38 ms
53,292 KB
testcase_06 AC 39 ms
53,292 KB
testcase_07 AC 307 ms
119,484 KB
testcase_08 AC 241 ms
128,068 KB
testcase_09 AC 953 ms
133,628 KB
testcase_10 AC 497 ms
129,860 KB
testcase_11 AC 198 ms
85,004 KB
testcase_12 AC 688 ms
101,280 KB
testcase_13 AC 598 ms
102,372 KB
testcase_14 AC 403 ms
118,280 KB
testcase_15 AC 224 ms
89,796 KB
testcase_16 AC 606 ms
105,100 KB
testcase_17 AC 466 ms
91,848 KB
testcase_18 AC 212 ms
88,964 KB
testcase_19 AC 363 ms
115,748 KB
testcase_20 AC 263 ms
98,016 KB
testcase_21 AC 978 ms
134,808 KB
testcase_22 AC 970 ms
130,992 KB
testcase_23 AC 952 ms
134,464 KB
testcase_24 AC 948 ms
127,188 KB
testcase_25 AC 86 ms
75,484 KB
testcase_26 AC 139 ms
76,616 KB
testcase_27 AC 109 ms
76,076 KB
testcase_28 AC 77 ms
73,484 KB
testcase_29 AC 101 ms
75,940 KB
testcase_30 AC 138 ms
76,940 KB
testcase_31 AC 141 ms
76,676 KB
testcase_32 AC 149 ms
76,884 KB
testcase_33 AC 125 ms
76,740 KB
testcase_34 AC 84 ms
75,388 KB
testcase_35 AC 45 ms
59,428 KB
testcase_36 AC 119 ms
76,500 KB
testcase_37 AC 145 ms
76,536 KB
testcase_38 AC 130 ms
76,352 KB
testcase_39 AC 49 ms
61,488 KB
testcase_40 AC 70 ms
72,240 KB
testcase_41 AC 111 ms
76,080 KB
testcase_42 AC 117 ms
75,904 KB
testcase_43 AC 126 ms
76,624 KB
testcase_44 AC 132 ms
76,352 KB
testcase_45 AC 822 ms
113,052 KB
testcase_46 AC 346 ms
81,928 KB
testcase_47 AC 274 ms
99,872 KB
testcase_48 AC 40 ms
53,328 KB
testcase_49 AC 40 ms
53,328 KB
testcase_50 AC 40 ms
53,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def compare(a,b):
  # 比較関数 (a<=b)
  
  if min(a,a^x)<=min(b,b^x):
    return True
  else:
    return False


def merge(l, r):
    new = []
    ln = 0
    rn = 0
    while ln < len(l) and rn < len(r):
        if compare(l[ln],r[rn]):
            new.append(l[ln])
            ln += 1
        else:
            new.append(r[rn])
            rn += 1
    for i in range(ln, len(l)):
        new.append(l[i])
    for i in range(rn, len(r)):
        new.append(r[i])
    return new
 
def MergeSort(l):
    if len(l) == 0:
        return []
    if len(l) == 1:
        return l
    else:
        a = l[:len(l)//2]
        b = l[len(l)//2:]
        return merge(MergeSort(a), MergeSort(b))

n,x=map(int,input().split())
a=list(map(int,input().split()))
a=MergeSort(a)
for i in range(n-1):
  if a[i]<a[i+1]^x and a[i]^x<a[i+1]:
    pass
  else:
    print('No')
    exit()
print('Yes')
0