結果
問題 |
No.381 名声値を稼ごう Extra
|
ユーザー |
![]() |
提出日時 | 2025-06-12 18:07:24 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 458 bytes |
コンパイル時間 | 331 ms |
コンパイル使用メモリ | 82,188 KB |
実行使用メモリ | 70,108 KB |
最終ジャッジ日時 | 2025-06-12 18:09:25 |
合計ジャッジ時間 | 802 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 RE * 1 |
ソースコード
n_str = input().strip() n = int(n_str) binary = bin(n)[2:] # Convert to binary and remove '0b' prefix L = len(binary) prefix = [0] * (L + 1) # Compute prefix sums of 1s in the binary string for i in range(L): prefix[i+1] = prefix[i] + (1 if binary[i] == '1' else 0) max_s = 0 # Check all possible shifts (m) from 0 to L-1 for m in range(L): current = prefix[L] - prefix[m] if current > max_s: max_s = current print(max_s % 1004535809)