ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#159230 | #239. count | bitsstdcheee | 0 | 1ms | 1248kb | C++ | 573b | 2022-09-28 14:43:23 | 2022-09-28 14:43:24 |
answer
#include <iostream>
using namespace std;
int n, m, k;
const int mod = 998244353;
int dfs(int dep, int le) {
if (le < 0) return 0;
if (dep == k + 1) {
if (le != 0) return 0;
return 1;
}
if (le == 0) return 0;
int res = 0;
for (int i = 1; i <= le; i++) {
if (le % m == 0) continue;
res += dfs(dep + 1, le - i);
res %= mod;
}
return res;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n >> m >> k;
cout << dfs(1, n) << endl;
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 1244kb
input:
1000 1000 3
output:
0
result:
wrong answer 1st lines differ - expected: '498501', found: '0'
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 1244kb
input:
2000 2000 2
output:
0
result:
wrong answer 1st lines differ - expected: '1999', found: '0'
Test #3:
score: 0
Time Limit Exceeded
input:
1999 1005 3
output:
result:
Test #4:
score: 0
Wrong Answer
time: 0ms
memory: 1248kb
input:
523098578902387543 1990 3
output:
0
result:
wrong answer 1st lines differ - expected: '741828632', found: '0'
Test #5:
score: 0
Wrong Answer
time: 1ms
memory: 1244kb
input:
985435493875384653 1987 3
output:
0
result:
wrong answer 1st lines differ - expected: '930955578', found: '0'
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 1248kb
input:
854378965978354365 4898 20
output:
0
result:
wrong answer 1st lines differ - expected: '72755158', found: '0'
Test #7:
score: 0
Wrong Answer
time: 0ms
memory: 1248kb
input:
869347685748976465 5000 20
output:
0
result:
wrong answer 1st lines differ - expected: '946187174', found: '0'
Test #8:
score: 0
Wrong Answer
time: 0ms
memory: 1244kb
input:
985493567483653416 4999 2000
output:
0
result:
wrong answer 1st lines differ - expected: '715344547', found: '0'
Test #9:
score: 0
Wrong Answer
time: 0ms
memory: 1248kb
input:
1000000000000000000 4987 1992
output:
0
result:
wrong answer 1st lines differ - expected: '142311097', found: '0'
Test #10:
score: 0
Wrong Answer
time: 0ms
memory: 1244kb
input:
666666666623333333 4998 1999
output:
0
result:
wrong answer 1st lines differ - expected: '7913341', found: '0'