結果

問題 No.1450 nahco314's First Problem
ユーザー gorugo30gorugo30
提出日時 2021-03-31 15:18:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 269 bytes
コンパイル時間 341 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 75,580 KB
最終ジャッジ日時 2023-08-08 08:34:29
合計ジャッジ時間 5,639 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,236 KB
testcase_01 AC 76 ms
71,144 KB
testcase_02 AC 77 ms
75,580 KB
testcase_03 AC 75 ms
71,148 KB
testcase_04 AC 73 ms
71,320 KB
testcase_05 AC 73 ms
71,456 KB
testcase_06 AC 76 ms
75,504 KB
testcase_07 AC 77 ms
75,488 KB
testcase_08 AC 79 ms
75,480 KB
testcase_09 AC 76 ms
75,316 KB
testcase_10 AC 76 ms
75,264 KB
testcase_11 AC 77 ms
75,460 KB
testcase_12 AC 77 ms
75,560 KB
testcase_13 AC 77 ms
75,312 KB
testcase_14 AC 76 ms
75,464 KB
testcase_15 AC 75 ms
75,472 KB
testcase_16 AC 75 ms
75,452 KB
testcase_17 AC 76 ms
75,384 KB
testcase_18 AC 77 ms
75,320 KB
testcase_19 AC 77 ms
75,288 KB
testcase_20 AC 78 ms
75,316 KB
testcase_21 AC 78 ms
75,292 KB
testcase_22 AC 77 ms
75,512 KB
testcase_23 AC 75 ms
75,352 KB
testcase_24 AC 77 ms
75,284 KB
testcase_25 AC 77 ms
75,288 KB
testcase_26 AC 75 ms
75,268 KB
testcase_27 AC 76 ms
75,460 KB
testcase_28 AC 76 ms
75,276 KB
testcase_29 AC 75 ms
75,424 KB
testcase_30 AC 77 ms
75,312 KB
testcase_31 AC 77 ms
75,488 KB
testcase_32 AC 77 ms
75,468 KB
testcase_33 AC 79 ms
75,576 KB
testcase_34 AC 77 ms
75,456 KB
testcase_35 AC 78 ms
75,312 KB
testcase_36 AC 77 ms
75,516 KB
testcase_37 AC 78 ms
75,308 KB
testcase_38 AC 78 ms
75,456 KB
testcase_39 AC 75 ms
75,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X = int(input())
def popcount(x):
    ans = 0
    while x > 0:
        if x % 2:
            ans += 1
        x //= 2
    return ans

for M in range(1, 70):
    N = X ^ M
    if N == 0:
        continue
    if popcount(N) == M:
        print(N)
        exit()
print(-1)
0