結果

問題 No.1298 OR XOR
ユーザー shotoyooshotoyoo
提出日時 2020-11-27 21:25:25
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 458 bytes
コンパイル時間 1,132 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 71,548 KB
最終ジャッジ日時 2023-10-01 04:34:37
合計ジャッジ時間 2,888 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,412 KB
testcase_01 AC 73 ms
71,456 KB
testcase_02 AC 72 ms
71,380 KB
testcase_03 AC 72 ms
71,300 KB
testcase_04 AC 72 ms
71,380 KB
testcase_05 AC 70 ms
71,408 KB
testcase_06 AC 73 ms
71,376 KB
testcase_07 AC 73 ms
71,376 KB
testcase_08 AC 72 ms
71,384 KB
testcase_09 AC 71 ms
71,480 KB
testcase_10 AC 72 ms
71,212 KB
testcase_11 AC 75 ms
71,288 KB
testcase_12 AC 72 ms
71,480 KB
testcase_13 AC 73 ms
71,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")

n = int(input())
a = b = c = 0
done = False
for i in range(n.bit_length()):
    if n>>i&1:
        if not done:
            a += (1<<i)
            b += (1<<i)
            done = True
        else:
            a += (1<<i)
            c += (1<<i)
if 0 in (a,b,c):
    a = b = c = -1
print(" ".join(map(str, [a,b,c])))
0