結果

問題 No.3364 Push_back Operation
コンテスト
ユーザー shogo314
提出日時 2025-11-17 21:41:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 415 bytes
コンパイル時間 354 ms
コンパイル使用メモリ 82,056 KB
実行使用メモリ 60,748 KB
最終ジャッジ日時 2025-11-17 21:41:45
合計ジャッジ時間 6,908 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7 WA * 46
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import isqrt

MOD = 998244353
N = int(input())
ans = 0
th = isqrt(N)
for i in range(1, th + 1):
    ans += pow(N // i, i, MOD)
    ans %= MOD
for i in range(1, 13):
    r = N // i
    l = max(th, N // (i + 1))
    d = r - l
    if i == 1:
        ans += r - l
    else:
        ans += pow(i, l + 1, MOD) * (pow(i, d, MOD) - 1) * pow(i - 1, -1, MOD)
    ans %= MOD
    if l == th:
        break
print(ans)
0