結果

問題 No.1298 OR XOR
ユーザー roarisroaris
提出日時 2020-11-27 21:48:08
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 339 bytes
コンパイル時間 840 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 71,496 KB
最終ジャッジ日時 2023-10-01 05:17:38
合計ジャッジ時間 3,016 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
71,240 KB
testcase_01 AC 91 ms
71,312 KB
testcase_02 AC 84 ms
71,268 KB
testcase_03 AC 83 ms
71,248 KB
testcase_04 AC 82 ms
71,308 KB
testcase_05 AC 82 ms
71,496 KB
testcase_06 AC 81 ms
71,320 KB
testcase_07 AC 81 ms
71,108 KB
testcase_08 AC 82 ms
71,104 KB
testcase_09 AC 83 ms
70,940 KB
testcase_10 AC 84 ms
71,456 KB
testcase_11 AC 79 ms
71,168 KB
testcase_12 AC 82 ms
71,304 KB
testcase_13 AC 82 ms
71,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
c = 0

for i in range(40):
    if (N>>i)&1:
        c += 1

if c==1:
    print(-1, -1, -1)
    exit()

B, C = 0, 0
flag = True

for i in range(40):
    if (N>>i)&1:
        if flag:
            B = 1<<i
            flag = False
        else:
            C += 1<<i

#print((N|B)==(N|C)==(B|C) and (N^B^C)==0)
print(N, B, C)
0