QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#439977#6740. Functionsuibian_xiaozhao#TL 218ms3628kbC++23676b2024-06-12 21:43:472024-06-12 21:43:49

Judging History

你现在查看的是最新测评结果

  • [2024-06-12 21:43:49]
  • 评测
  • 测评结果:TL
  • 用时:218ms
  • 内存:3628kb
  • [2024-06-12 21:43:47]
  • 提交

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();
    }


}


Details

Tip: Click on the bar to expand more detailed information

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

output:


result: