結果

問題 No.1228 I hate XOR Matching
ユーザー chielochielo
提出日時 2020-09-11 23:46:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 378 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 87,148 KB
実行使用メモリ 71,572 KB
最終ジャッジ日時 2023-08-27 21:29:33
合計ジャッジ時間 14,455 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,376 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 70 ms
71,240 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 72 ms
71,328 KB
testcase_07 WA -
testcase_08 AC 72 ms
71,184 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 71 ms
71,220 KB
testcase_14 AC 72 ms
71,204 KB
testcase_15 AC 71 ms
71,168 KB
testcase_16 AC 74 ms
71,504 KB
testcase_17 AC 71 ms
71,268 KB
testcase_18 AC 72 ms
71,088 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
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 = 1
while 2 ** n < x:
    n += 1
if k == 0:
    print(0 * n)
    exit()
a = [0] * n
for i in range(20):
    if k & (1 << i):
        a.append(1 << i)
print(len(a))
print(*a)
0