結果
| 問題 |
No.1450 nahco314's First Problem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-31 14:42:24 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 37 ms / 2,000 ms |
| コード長 | 251 bytes |
| コンパイル時間 | 700 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-11-08 14:14:57 |
| 合計ジャッジ時間 | 3,156 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
ソースコード
import sys
x = int(input())
for i in range(x - 100, x + 100):
if i <= 0:
continue
cnt = 0
a = i
for j in range(61, -1, -1):
if a >= (2 ** j):
a -= (2 ** j)
cnt += 1
if (i ^ cnt) == x:
print(i)
sys.exit()
print(-1)