結果
| 問題 | No.1298 OR XOR |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-27 21:25:25 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 36 ms / 2,000 ms |
| + 424µs | |
| コード長 | 458 bytes |
| 記録 | |
| コンパイル時間 | 90 ms |
| コンパイル使用メモリ | 64,104 KB |
| 実行使用メモリ | 53,632 KB |
| 最終ジャッジ日時 | 2026-11-16 21:17:34 |
| 合計ジャッジ時間 | 2,219 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 15 |
ソースコード
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])))