結果

問題 No.1450 nahco314's First Problem
ユーザー aaaaaaaaaa2230
提出日時 2021-03-31 18:57:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 53,376 KB
最終ジャッジ日時 2024-11-08 14:21:05
合計ジャッジ時間 3,626 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

x = int(input())
base = 0
count = 0
for i in range(10,65):
    if x >> i & 1:
        base |= 1 << i
        count += 1

for i in range(1,1<<10):
    c = bin(i).count("1")+count
    n = base|i
    if n^c == x:
        print(n)
        exit()
print(-1)
0