ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#213191 | #2356. Count | one_zero_four_zero | 48 | 95ms | 9036kb | C++11 | 1.5kb | 2024-11-09 22:41:48 | 2024-11-09 23:29:48 |
answer
#include<bits/stdc++.h>
#pragma GCC optimize(2)
#define mod 1000000007LL
using namespace std;
int N, K, L1, L2;
long long ans1 = 0, ans2 = 0, ans3 = 0, ans4 = 0;
int dp2[1003][1003];
int dp3[1003][1003];
long long solve1(){
long long res = 0;
if (K == 0) return 1LL * N;
for (int i = 1; i <= K; i ++){
if ((i % 1 == 0) && (K % i == 0)){
res ++;
}
}
return res;
}
long long solve2(){
dp2[1][0] = 1;
for (int i = 1; i <= N; i ++){
for (int j = 0; j < L1; j ++){
for (int k = 0; ; k ++){
if (k * i > N) break;
dp2[i * k][j + 1] += dp2[i][j];
dp2[i * k][j + 1] %= mod;
}
}
}
long long res = 0;
for (int i = 1; i <= L1; i ++){
res += dp2[0][i];
}
return res;
}
long long solve3(){
dp3[1][0] = 1;
for (int i = 1; i <= N; i ++){
for (int j = 0; j < L2; j ++){
// cout << i << " " << j << " " << dp3[i][j] << ";;\n";
for (int k = 0; ; k ++){
if (k == 1) continue;
if (k * i > N) break;
dp3[i * k][j + 1] += dp3[i][j];
dp3[i * k][j + 1] %= mod;
}
}
}
long long res = 0;
for (int i = 1; i <= L2; i ++){
res += dp3[0][i];
}
return res;
}
long long solve4(){
return 0;
}
int main(){
#ifndef ONLINE_JUDGE
freopen("../data.in", "r", stdin);
freopen("../data.out", "w", stdout);
#endif
scanf("%d %d %d %d", &N, &K, &L1, &L2);
ans1 = solve1() % mod;
ans2 = solve2() % mod;
ans3 = solve3() % mod;
ans4 = solve4() % mod;
printf("%lld %lld %lld %lld\n", ans1, ans2, ans3, ans4);
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 8
Acceptable Answer
time: 1ms
memory: 1236kb
input:
5 0 7 3
output:
5 126 6 0
result:
points 0.80 correct correct correct wrong
Test #2:
score: 8
Acceptable Answer
time: 0ms
memory: 1264kb
input:
8 0 9 4
output:
8 807 14 0
result:
points 0.80 correct correct correct wrong
Test #3:
score: 8
Acceptable Answer
time: 0ms
memory: 1272kb
input:
10 1 10 5
output:
1 1585 19 0
result:
points 0.80 correct correct correct wrong
Test #4:
score: 8
Acceptable Answer
time: 18ms
memory: 5120kb
input:
500 2 996 6
output:
2 370442183 13552 0
result:
points 0.80 correct correct correct wrong
Test #5:
score: 8
Acceptable Answer
time: 31ms
memory: 7468kb
input:
800 233 966 7
output:
2 31028437 32745 0
result:
points 0.80 correct correct correct wrong
Test #6:
score: 8
Acceptable Answer
time: 45ms
memory: 9036kb
input:
1000 666 999 10
output:
12 494787167 48614 0
result:
points 0.80 correct correct correct wrong
Test #7:
score: 0
Runtime Error
input:
50000 2048 98673 100
output:
result:
Test #8:
score: 0
Runtime Error
input:
80000 65535 25192 50
output:
result:
Test #9:
score: 0
Runtime Error
input:
100000 23333 99696 12
output:
result:
Test #10:
score: 0
Runtime Error
input:
100000 89941 99669 6