結果
| 問題 |
No.381 名声値を稼ごう Extra
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 14:48:18 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 425 bytes |
| コンパイル時間 | 441 ms |
| コンパイル使用メモリ | 82,620 KB |
| 実行使用メモリ | 72,432 KB |
| 最終ジャッジ日時 | 2025-06-12 14:51:34 |
| 合計ジャッジ時間 | 856 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 RE * 1 |
ソースコード
MOD = 1004535809
N = input().strip()
n = int(N)
bin_str = bin(n)[2:]
prefix = [0] * (len(bin_str) + 1)
for i in range(len(bin_str)):
prefix[i+1] = prefix[i] + (1 if bin_str[i] == '1' else 0)
max_ones = 0
for s in range(0, len(bin_str) + 1):
length = len(bin_str) - s
if length <= 0:
ones = 0
else:
ones = prefix[length]
if ones > max_ones:
max_ones = ones
print(max_ones % MOD)
gew1fw