結果
| 問題 |
No.2940 Sigma Sigma Div Floor Problem
|
| コンテスト | |
| ユーザー |
SnowBeenDiding
|
| 提出日時 | 2024-10-18 23:03:44 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 264 ms / 6,000 ms |
| コード長 | 544 bytes |
| コンパイル時間 | 4,903 ms |
| コンパイル使用メモリ | 307,224 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-18 23:04:24 |
| 合計ジャッジ時間 | 14,668 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 29 TLE * 1 |
ソースコード
#include <atcoder/all>
#include <bits/stdc++.h>
#define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
using namespace atcoder;
using namespace std;
typedef long long ll;
using mint = modint998244353;
int main() {
ll n;
cin >> n;
mint ans = 0;
rep(i, 1, n + 1) {
ll l = i, r = i * 2;
while (1) {
if (l > n)
break;
r = min(n + 1, r);
ans += mint(r - l) * (l / i);
l += i;
r += i;
}
}
cout << ans.val() << endl;
}
SnowBeenDiding