結果
問題 |
No.2940 Sigma Sigma Div Floor Problem
|
ユーザー |
|
提出日時 | 2024-10-18 23:39:19 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 559 bytes |
コンパイル時間 | 1,089 ms |
コンパイル使用メモリ | 80,512 KB |
実行使用メモリ | 10,144 KB |
最終ジャッジ日時 | 2024-10-18 23:39:46 |
合計ジャッジ時間 | 9,781 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 14 TLE * 1 -- * 15 |
ソースコード
#include <iostream> using namespace std; using ll = long long; int main () { ll N; cin >> N; const ll MOD = 998244353; // 割った切り捨ての種類数は十分少ない典型 // -> N√Nくらい ll ans = 0; for (int i = 1; i <= N; i++) { int cur = 1; while (true) { ans += 1LL * cur * ((i / cur) - (i / (cur + 1) + 1) + 1) % MOD; ans %= MOD; int div = i / (cur + 1); if (div == 0) break; cur = i / div; } } cout << ans << "\n"; }