結果
| 問題 | No.3505 Sum of Prod of Root |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-18 05:09:29 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 513 bytes |
| 記録 | |
| コンパイル時間 | 2,338 ms |
| コンパイル使用メモリ | 327,976 KB |
| 実行使用メモリ | 16,256 KB |
| 最終ジャッジ日時 | 2026-04-18 05:10:02 |
| 合計ジャッジ時間 | 8,728 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 1 |
| other | TLE * 1 -- * 12 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 998244353;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll N;
cin >> N;
ll ans = 0;
for (ll x = 1; x <= N; x++) {
ll cur = x;
ll cnt = 0;
// count i such that x^i <= N
while (cur <= N) {
cnt++;
if (cur > N / x) break;
cur *= x;
}
ans = (ans + (x % MOD) * cnt) % MOD;
}
cout << ans << '\n';
}