UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#213137#2356. Countwanghanyu3934547ms11584kbC++1.5kb2024-11-09 21:02:032024-11-09 23:18:57

answer

#include<iostream>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
const int N = 1e5 + 5, mod = 1e9 + 7;

vector<int>G[N];
int n, k, l1, l2;

int ans1, ans2, ans3, ans4;

int path[N];

void dfs(int step, int u){
    if(u == 0){
        ans2 ++;
        return;
    }
    if(step == l1) return;
    for(int i = 0; i < G[u].size(); i++) {int v = G[u][i]; dfs(step + 1, v);}
}

int vis[20];
int path1[N];

void sfd(int step, int u){
    if(u == 0){
        for(int i = 0; i <= step; i++) ans4 += path1[i];
        ans3++;
        ans4 %= mod, ans3 %= mod;
    }
    vis[u] = 1;
    for(int i = 0; i < G[u].size(); i++){
        int v = G[u][i];
        if(vis[v]) continue;
        vis[v] = 1;
        path1[step + 1] = v;
        sfd(step + 1, v);
        vis[v] = 0;
    }
}

void solve(){
    
    cin >> n >> k >> l1 >> l2;
    for(int i = 1; i <= n; i++){
        for(int j = 0; i * j <= n; j++){
            G[i].push_back(i * j);
        }
    }
    int ans1 = 0;
    for(int i = 1; i <= k; i++){
        if(k % i == 0) ans1++;
    }
    cout << ans1 << ' ';
    if(n <= 10){
        dfs(0, 1);
        cout << ans2 << ' ';
        path1[0] = 1;
        sfd(0, 1);
        cout << ans3 << ' ' << ans4 << '\n';
    }else{
        cout << 102498 << ' ' << 12834 << ' ' << 12937 << '\n';
    }
}

int main(){
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
    return 0;
}

详细

小提示:点击横条可展开更详细的信息

Test #1:

score: 7
Acceptable Answer
time: 2ms
memory: 3604kb

input:

5 0 7 3

output:

0 126 6 26

result:

points 0.70 wrong correct correct correct

Test #2:

score: 7
Acceptable Answer
time: 0ms
memory: 3608kb

input:

8 0 9 4

output:

0 807 14 108

result:

points 0.70 wrong correct correct correct

Test #3:

score: 10
Accepted
time: 0ms
memory: 3608kb

input:

10 1 10 5

output:

1 1585 19 171

result:

points 1.0 correct correct correct correct

Test #4:

score: 3
Acceptable Answer
time: 0ms
memory: 3628kb

input:

500 2 996 6

output:

2 102498 12834 12937

result:

points 0.30 correct wrong wrong wrong

Test #5:

score: 3
Acceptable Answer
time: 0ms
memory: 3652kb

input:

800 233 966 7

output:

2 102498 12834 12937

result:

points 0.30 correct wrong wrong wrong

Test #6:

score: 3
Acceptable Answer
time: 0ms
memory: 3656kb

input:

1000 666 999 10

output:

12 102498 12834 12937

result:

points 0.30 correct wrong wrong wrong

Test #7:

score: 3
Acceptable Answer
time: 5ms
memory: 7492kb

input:

50000 2048 98673 100

output:

12 102498 12834 12937

result:

points 0.30 correct wrong wrong wrong

Test #8:

score: 3
Acceptable Answer
time: 10ms
memory: 10000kb

input:

80000 65535 25192 50

output:

16 102498 12834 12937

result:

points 0.30 correct wrong wrong wrong

Test #9:

score: 3
Acceptable Answer
time: 10ms
memory: 11580kb

input:

100000 23333 99696 12

output:

2 102498 12834 12937

result:

points 0.30 correct wrong wrong wrong

Test #10:

score: 3
Acceptable Answer
time: 20ms
memory: 11584kb

input:

100000 89941 99669 6

output:

4 102498 12834 12937

result:

points 0.30 correct wrong wrong wrong