QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#749129 | #9740. Aho-Corasick 自动机 | isAKnoya# | AC ✓ | 62ms | 4048kb | C++23 | 800b | 2024-11-14 22:46:31 | 2024-11-14 22:46:32 |
Judging History
answer
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using ll=long long;
#define int ll
using i128=__int128;
template<typename T>using V=std::vector<T>;
using vi=V<int>;
using std::cin,std::cerr,std::cout;
#define all(c) std::begin(c),std::end(c)
#define eb emplace_back
constexpr int N=111,M=998244353;
int f[N][N];
signed main(){
// sieve();
// for(auto&x:prime)cerr<<x<<' ';
cin.tie(0)->sync_with_stdio(0);
int n,m,d;
cin>>n>>m>>d;
// std::fill(all(f[0]),1);
// std::fill(all(f[1]),1);
f[0][1]=1;
for(int k=1;k<=d;++k){
f[k][1]=1;
for(int _=1;_<=m;++_){
for(int i=n;~i;--i){
for(int j=1;i+j<=n;++j){
f[k][i+j]=(f[k][i+j]+ll(f[k][i])*f[k-1][j])%M;
}
}
}
}
printf("%lld\n",f[d][n]);
// for(int i=2;i<=n;++i){
// f[1]
// }
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3784kb
input:
3 2 2
output:
5
result:
ok answer is '5'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
4 2 2
output:
6
result:
ok answer is '6'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
1 1 1
output:
1
result:
ok answer is '1'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3812kb
input:
30 30 30
output:
286511539
result:
ok answer is '286511539'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
13 13 13
output:
818093168
result:
ok answer is '818093168'
Test #6:
score: 0
Accepted
time: 1ms
memory: 3848kb
input:
30 25 25
output:
730504816
result:
ok answer is '730504816'
Test #7:
score: 0
Accepted
time: 1ms
memory: 3924kb
input:
29 29 29
output:
892409454
result:
ok answer is '892409454'
Test #8:
score: 0
Accepted
time: 1ms
memory: 3812kb
input:
15 30 28
output:
505511076
result:
ok answer is '505511076'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
20 10 30
output:
250115604
result:
ok answer is '250115604'
Test #10:
score: 0
Accepted
time: 1ms
memory: 3872kb
input:
20 30 30
output:
623437187
result:
ok answer is '623437187'
Test #11:
score: 0
Accepted
time: 62ms
memory: 4048kb
input:
100 100 100
output:
933606371
result:
ok answer is '933606371'
Test #12:
score: 0
Accepted
time: 57ms
memory: 3976kb
input:
100 95 95
output:
368609759
result:
ok answer is '368609759'
Test #13:
score: 0
Accepted
time: 57ms
memory: 3856kb
input:
95 100 100
output:
691641619
result:
ok answer is '691641619'
Test #14:
score: 0
Accepted
time: 54ms
memory: 3864kb
input:
95 97 98
output:
517539873
result:
ok answer is '517539873'
Test #15:
score: 0
Accepted
time: 9ms
memory: 3884kb
input:
94 67 23
output:
601572539
result:
ok answer is '601572539'
Extra Test:
score: 0
Extra Test Passed