1 Star 4 Fork 0

Sshwy/code

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
1528b.cpp 610 Bytes
一键复制 编辑 原始数据 按行查看 历史
Sshwy 提交于 4年前 . code format
// by Yao
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define ROF(i, a, b) for (int i = (a); i >= (b); --i)
namespace RA {
int rnd(int p) { return 1ll * rand() * rand() % p; }
int rnd(int L, int R) { return rnd(R - L + 1) + L; }
} // namespace RA
const int P = 998244353, N = 1e6 + 5;
int n;
int f[N], g[N], d[N];
int main() {
cin >> n;
FOR(i, 1, n) {
for (int j = i; j <= n; j += i) d[j]++;
}
FOR(i, 1, n) {
f[i] = g[i - 1] + d[i];
g[i] = (g[i - 1] + f[i]) % P;
}
printf("%d\n", f[n]);
return 0;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sshwy/code.git
git@gitee.com:sshwy/code.git
sshwy
code
code
master

搜索帮助