結果

問題 No.1260 たくさんの多項式
コンテスト
ユーザー tonyu0
提出日時 2020-10-17 02:08:13
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
実行時間 -
コード長 367 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 523 ms
コンパイル使用メモリ 20,828 KB
実行使用メモリ 16,192 KB
最終ジャッジ日時 2026-04-03 03:01:17
合計ジャッジ時間 10,182 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge5_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 49 TLE * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n = int(input())
mod = 10 ** 9 + 7

ans = 0
j = 2
for i in range(2, int(n ** .5) + 1):
    now = n
    while now > 0:
        ans += now % i
        now //= i
    ans += now
    ans %= mod
    j = i + 1
    
while j <= n:
    m = n // j
    r = n // m
    ans += n * (r - j + 1) - (j - 1 + r - 1) * (r - j + 1) // 2 * m % mod
    ans %= mod
    j = r + 1
print(ans)

0