結果

問題 No.1450 nahco314's First Problem
ユーザー roarisroaris
提出日時 2021-04-03 03:10:12
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 294 bytes
コンパイル時間 945 ms
コンパイル使用メモリ 86,356 KB
実行使用メモリ 75,676 KB
最終ジャッジ日時 2023-08-08 08:42:47
合計ジャッジ時間 5,801 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,076 KB
testcase_01 AC 75 ms
75,396 KB
testcase_02 AC 77 ms
75,456 KB
testcase_03 AC 73 ms
70,724 KB
testcase_04 AC 73 ms
70,732 KB
testcase_05 AC 74 ms
75,308 KB
testcase_06 AC 77 ms
75,412 KB
testcase_07 AC 78 ms
75,508 KB
testcase_08 AC 81 ms
75,676 KB
testcase_09 AC 78 ms
75,388 KB
testcase_10 AC 75 ms
75,504 KB
testcase_11 AC 76 ms
75,624 KB
testcase_12 AC 78 ms
75,360 KB
testcase_13 AC 76 ms
75,356 KB
testcase_14 AC 77 ms
75,400 KB
testcase_15 AC 77 ms
75,324 KB
testcase_16 AC 78 ms
75,656 KB
testcase_17 AC 81 ms
75,456 KB
testcase_18 AC 81 ms
75,364 KB
testcase_19 AC 78 ms
75,620 KB
testcase_20 AC 80 ms
75,516 KB
testcase_21 AC 78 ms
75,380 KB
testcase_22 AC 79 ms
75,372 KB
testcase_23 AC 79 ms
75,396 KB
testcase_24 AC 80 ms
75,504 KB
testcase_25 AC 77 ms
75,384 KB
testcase_26 AC 79 ms
75,268 KB
testcase_27 AC 78 ms
75,400 KB
testcase_28 AC 78 ms
75,368 KB
testcase_29 AC 78 ms
75,424 KB
testcase_30 AC 78 ms
75,472 KB
testcase_31 AC 79 ms
75,504 KB
testcase_32 AC 80 ms
75,396 KB
testcase_33 AC 80 ms
75,440 KB
testcase_34 AC 79 ms
75,508 KB
testcase_35 AC 78 ms
75,448 KB
testcase_36 AC 81 ms
75,288 KB
testcase_37 AC 77 ms
75,500 KB
testcase_38 AC 76 ms
75,396 KB
testcase_39 AC 76 ms
75,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X = int(input())

if X==0:
    print(1)
    exit()
    
for i in range(100):
    if (X>>i)&1:
        msb = i
    
for M in range(msb+10):
    N = X^M
    M2 = 0
    
    for i in range(100):
        if (N>>i)&1:
            M2 += 1
    
    if M==M2:
        print(N)
        exit()

print(-1)
0