QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#439977 | #6740. Function | suibian_xiaozhao# | TL | 218ms | 3628kb | C++23 | 676b | 2024-06-12 21:43:47 | 2024-06-12 21:43:49 |
Judging History
answer
//
// Created by DELLPC on 24-5-19.
//
#include "bits/stdc++.h"
using namespace std;
using i64 = long long;
using i32 = unsigned int;
#define endl '\n'
i64 mod = 998244353;
i64 dfs(i64 a, i64 b) {
if (a > b) return 0;
int ans = 1;
for (i64 i = 2; i <= 201210926; i++) {
if (i * a > b) break;
ans += dfs(a * i, b);
}
return ans;
}
void solve() {
i64 n, m;
cin >> n;
cout << dfs(1, n) << endl;
}
int main() {
// cerr << 1996488708ll * 2ll %mod<<endl;
ios::sync_with_stdio(0), cin.tie(0);
int t = 1;
// cin >> t;
while (t--) {
solve();
}
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3600kb
input:
1
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: 0
Accepted
time: 1ms
memory: 3528kb
input:
2
output:
2
result:
ok 1 number(s): "2"
Test #3:
score: 0
Accepted
time: 1ms
memory: 3572kb
input:
100
output:
949
result:
ok 1 number(s): "949"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
10
output:
19
result:
ok 1 number(s): "19"
Test #5:
score: 0
Accepted
time: 1ms
memory: 3628kb
input:
1000
output:
48614
result:
ok 1 number(s): "48614"
Test #6:
score: 0
Accepted
time: 4ms
memory: 3604kb
input:
10000
output:
2602393
result:
ok 1 number(s): "2602393"
Test #7:
score: 0
Accepted
time: 218ms
memory: 3572kb
input:
100000
output:
139804054
result:
ok 1 number(s): "139804054"
Test #8:
score: -100
Time Limit Exceeded
input:
1000000