結果
| 問題 | No.1298 OR XOR |
| コンテスト | |
| ユーザー |
toshiro_yanagi
|
| 提出日時 | 2023-05-14 23:12:30 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 95 ms / 2,000 ms |
| コード長 | 362 bytes |
| 記録 | |
| コンパイル時間 | 842 ms |
| コンパイル使用メモリ | 20,696 KB |
| 実行使用メモリ | 15,484 KB |
| 最終ジャッジ日時 | 2026-05-24 00:55:57 |
| 合計ジャッジ時間 | 3,284 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 |
ソースコード
def bit(n: int):
res = []
while n != 0:
res += [n % 2]
n //= 2
return res
n = int(input())
c = n
a, b = 0, 0
flg = False
for i, ci in enumerate(bit(c)):
if ci != 0:
if not flg:
a = 2**i
flg = True
else:
b += 2**i
if min(a, b, c) == 0:
a, b, c = -1, -1, -1
print(a, b, c)
toshiro_yanagi