結果

問題 No.1298 OR XOR
ユーザー shotoyoo
提出日時 2020-11-27 21:25:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 458 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 82,244 KB
実行使用メモリ 53,696 KB
最終ジャッジ日時 2024-07-23 21:57:06
合計ジャッジ時間 1,506 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

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