結果
| 問題 | No.3088 XOR = SUM |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-04-05 06:54:38 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 350 bytes |
| 記録 | |
| コンパイル時間 | 340 ms |
| コンパイル使用メモリ | 82,300 KB |
| 実行使用メモリ | 77,708 KB |
| 最終ジャッジ日時 | 2025-04-05 06:55:00 |
| 合計ジャッジ時間 | 20,638 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 WA * 21 |
ソースコード
def bsr(x: int) -> int:
"""1 が立っている最上位ビットの位置を返す (0-indexed)"""
assert x != 0
return x.bit_length() - 1
def solve():
N = int(input())
if N.bit_count() <= 1:
print(0, 0)
return
x = 1 << bsr(N)
y = N ^ x
print(x, y)
T = int(input())
for _ in range(T):
solve()
norioc