結果

問題 No.1228 I hate XOR Matching
ユーザー chielochielo
提出日時 2020-09-12 00:13:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 711 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 71,556 KB
最終ジャッジ日時 2023-08-28 08:58:13
合計ジャッジ時間 9,085 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,308 KB
testcase_01 AC 73 ms
71,348 KB
testcase_02 AC 71 ms
71,248 KB
testcase_03 AC 71 ms
71,304 KB
testcase_04 AC 71 ms
71,468 KB
testcase_05 AC 71 ms
71,176 KB
testcase_06 AC 67 ms
71,416 KB
testcase_07 AC 72 ms
71,328 KB
testcase_08 AC 72 ms
71,176 KB
testcase_09 AC 70 ms
71,180 KB
testcase_10 AC 71 ms
71,216 KB
testcase_11 AC 71 ms
71,216 KB
testcase_12 AC 71 ms
71,304 KB
testcase_13 AC 72 ms
71,172 KB
testcase_14 AC 72 ms
71,208 KB
testcase_15 AC 70 ms
71,328 KB
testcase_16 AC 71 ms
71,124 KB
testcase_17 AC 71 ms
71,228 KB
testcase_18 AC 71 ms
71,260 KB
testcase_19 AC 71 ms
71,292 KB
testcase_20 AC 69 ms
71,272 KB
testcase_21 AC 70 ms
71,200 KB
testcase_22 AC 70 ms
71,496 KB
testcase_23 AC 69 ms
71,292 KB
testcase_24 WA -
testcase_25 AC 70 ms
71,508 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 69 ms
71,276 KB
testcase_29 AC 70 ms
71,500 KB
testcase_30 AC 70 ms
71,348 KB
testcase_31 AC 72 ms
71,216 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

k, x = map(int, input().split())
if x == 0:
    print('Yes')
    print(1)
    print(k - 1 if k >= 1 else k + 1)
    exit()
if k == 0:
    x += 1
if (x & -x) != x:
    print('No')
    exit()
print('Yes')
n = 0
while 2 ** n < x:
    n += 1
if k == 0:
    a = [2 ** i for i in range(9)]
    a += list(range(1, n + 1))
    print(len(a))
    print(*a)
    exit()
if n <= 0:
    print(1)
    print(k)
    exit()
a = []
for i in range(9):
    if (1 << i) != (k & -k):
        a.append(1 << i)
    else:
        a.append(k)
if k not in a:
    a.append(k)
b = []
for i in range(1, n + 1):
    c = 0
    for j in range(len(a)):
        if i & (1 << j):
            c |= a[j]
    b.append(c)
a += b
print(len(a))
print(*a)
0