結果

問題 No.1450 nahco314's First Problem
ユーザー tamatotamato
提出日時 2021-03-31 15:53:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 389 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 82,632 KB
実行使用メモリ 59,184 KB
最終ジャッジ日時 2024-04-26 02:00:08
合計ジャッジ時間 3,171 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,140 KB
testcase_01 AC 39 ms
58,976 KB
testcase_02 AC 40 ms
58,136 KB
testcase_03 AC 37 ms
52,700 KB
testcase_04 AC 34 ms
53,116 KB
testcase_05 AC 38 ms
58,424 KB
testcase_06 AC 38 ms
58,124 KB
testcase_07 AC 38 ms
58,140 KB
testcase_08 AC 40 ms
58,672 KB
testcase_09 AC 38 ms
58,280 KB
testcase_10 AC 38 ms
58,112 KB
testcase_11 AC 38 ms
58,360 KB
testcase_12 AC 38 ms
58,240 KB
testcase_13 AC 38 ms
57,996 KB
testcase_14 AC 38 ms
58,208 KB
testcase_15 AC 39 ms
58,260 KB
testcase_16 AC 39 ms
58,128 KB
testcase_17 AC 38 ms
58,284 KB
testcase_18 AC 39 ms
57,572 KB
testcase_19 AC 39 ms
57,916 KB
testcase_20 AC 39 ms
57,596 KB
testcase_21 AC 38 ms
58,184 KB
testcase_22 AC 38 ms
58,124 KB
testcase_23 AC 38 ms
57,856 KB
testcase_24 AC 38 ms
57,576 KB
testcase_25 AC 40 ms
58,864 KB
testcase_26 AC 38 ms
57,888 KB
testcase_27 AC 39 ms
59,144 KB
testcase_28 AC 40 ms
58,628 KB
testcase_29 AC 38 ms
58,116 KB
testcase_30 AC 38 ms
59,184 KB
testcase_31 AC 38 ms
57,448 KB
testcase_32 AC 38 ms
58,192 KB
testcase_33 AC 39 ms
58,644 KB
testcase_34 AC 38 ms
58,124 KB
testcase_35 AC 38 ms
57,436 KB
testcase_36 AC 39 ms
58,212 KB
testcase_37 AC 40 ms
58,360 KB
testcase_38 AC 40 ms
57,988 KB
testcase_39 AC 39 ms
59,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    X = int(input())
    for M in range(62):
        N = X ^ M
        cnt = 0
        for i in range(62):
            cnt += N >> i & 1
        if cnt == M:
            if 0 < N <= 2 * 10 ** 18:
                print(N)
                exit()
    print(-1)


if __name__ == '__main__':
    main()
0