結果

問題 No.1450 nahco314's First Problem
ユーザー roarisroaris
提出日時 2021-04-03 03:09:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 294 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 75,988 KB
最終ジャッジ日時 2023-08-08 08:42:34
合計ジャッジ時間 5,669 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
70,856 KB
testcase_01 AC 76 ms
71,272 KB
testcase_02 AC 81 ms
75,564 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 71 ms
71,276 KB
testcase_06 AC 77 ms
75,652 KB
testcase_07 AC 79 ms
75,516 KB
testcase_08 AC 79 ms
75,748 KB
testcase_09 AC 78 ms
75,608 KB
testcase_10 AC 77 ms
75,888 KB
testcase_11 AC 78 ms
75,652 KB
testcase_12 AC 81 ms
75,584 KB
testcase_13 AC 79 ms
75,988 KB
testcase_14 AC 77 ms
75,744 KB
testcase_15 AC 78 ms
75,464 KB
testcase_16 AC 77 ms
75,616 KB
testcase_17 AC 79 ms
75,780 KB
testcase_18 AC 79 ms
75,608 KB
testcase_19 AC 79 ms
75,744 KB
testcase_20 AC 79 ms
75,860 KB
testcase_21 AC 78 ms
75,776 KB
testcase_22 AC 78 ms
75,428 KB
testcase_23 AC 78 ms
75,860 KB
testcase_24 AC 78 ms
75,424 KB
testcase_25 AC 78 ms
75,428 KB
testcase_26 AC 78 ms
75,492 KB
testcase_27 AC 77 ms
75,756 KB
testcase_28 AC 78 ms
75,652 KB
testcase_29 AC 78 ms
75,640 KB
testcase_30 AC 77 ms
75,680 KB
testcase_31 AC 79 ms
75,752 KB
testcase_32 AC 79 ms
75,436 KB
testcase_33 AC 79 ms
75,648 KB
testcase_34 AC 79 ms
75,684 KB
testcase_35 AC 77 ms
75,772 KB
testcase_36 AC 79 ms
75,740 KB
testcase_37 AC 79 ms
75,884 KB
testcase_38 AC 78 ms
75,708 KB
testcase_39 AC 78 ms
75,460 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+2):
    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