結果

問題 No.381 名声値を稼ごう Extra
ユーザー lam6er
提出日時 2025-04-16 00:27:47
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 528 bytes
コンパイル時間 382 ms
コンパイル使用メモリ 81,608 KB
実行使用メモリ 71,036 KB
最終ジャッジ日時 2025-04-16 00:29:19
合計ジャッジ時間 555 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = input().strip()
    n = int(N)
    bin_str = bin(n)[2:]
    L = len(bin_str)
    
    imos = [0] * (L + 2)
    
    for i in range(L):
        if bin_str[i] == '1':
            end = i + 1
            imos[0] += 1
            if end <= L + 1:
                imos[end] -= 1
    
    max_count = 0
    current = 0
    for k in range(L + 1):
        current += imos[k]
        if current > max_count:
            max_count = current
    
    print(max_count % 1004535809)

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