QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#750813 | #6199. 数圈圈 | jinqihao2023 | 0 | 3ms | 5844kb | C++14 | 594b | 2024-11-15 16:02:53 | 2024-11-15 16:02:54 |
answer
#include<bits/stdc++.h>
using namespace std;
const int N=5e3+5,mod=998244383;
int n,x,f[N][N],a[N],ans[N];
int main()
{
scanf("%d %d",&n,&x);
bool fl1=1;
for(int i=1;i<=n;i++)scanf("%d",&a[i]);
for(int i=1;i<n;i++)fl1&=(a[i]<=a[i+1]);
if(fl1)
{
f[0][0]=1;
for(int i=1;i<=n;i++)for(int j=0;j<=i;j++)
{
f[i][j]=f[i-1][j];
if(j>0)
{
if(a[i]>=i)f[i][j]=(f[i][j]+1ll*f[i-1][j-1]*(a[i]-j+x))%mod;
else f[i][j]=(f[i][j]+1ll*f[i-1][j-1]*a[i]-j+1)%mod;
}
}
for(int i=0;i<=n;i++)printf("%d ",f[n][i]);printf("\n");
return 0;
}
return 0;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 1
Accepted
time: 0ms
memory: 3924kb
input:
1 915080344 1
output:
1 915080344
result:
ok 2 number(s): "1 915080344"
Test #2:
score: 1
Accepted
time: 0ms
memory: 3920kb
input:
1 915080344 0
output:
1 0
result:
ok 2 number(s): "1 0"
Test #3:
score: 0
Wrong Answer
time: 1ms
memory: 5844kb
input:
8 60641044 8 8 8 8 8 8 8 8
output:
1 485128408 946577857 890557670 141454420 160901800 789577502 434104053 4805909
result:
wrong answer 3rd numbers differ - expected: '47996075', found: '946577857'
Subtask #2:
score: 0
Wrong Answer
Test #8:
score: 0
Wrong Answer
time: 1ms
memory: 3984kb
input:
15 0 1 1 1 3 6 8 10 11 11 12 13 13 14 15 15
output:
1 122 6222 173968 2941212 31306356 212042400 904326768 357891506 539319315 769561442 922065120 62000640 -9953280 -414720 0
result:
wrong answer 4th numbers differ - expected: '173976', found: '173968'
Subtask #3:
score: 0
Skipped
Dependency #1:
0%
Subtask #4:
score: 0
Runtime Error
Test #19:
score: 0
Runtime Error
input:
74999 1 1 2 3 3 4 4 4 4 4 4 4 4 7 8 8 9 9 9 10 13 13 14 14 16 19 20 21 22 24 25 25 26 26 29 31 32 32 35 35 36 38 39 39 40 41 43 43 44 45 45 45 46 48 49 50 50 50 51 53 54 57 59 59 60 60 62 63 63 65 66 69 71 73 76 78 78 78 79 79 79 80 81 81 81 82 82 83 83 85 87 89 91 94 94 94 94 98 99 99 100 100 101 1...
output:
result:
Subtask #5:
score: 0
Skipped
Dependency #1:
0%
Subtask #6:
score: 0
Wrong Answer
Test #28:
score: 0
Wrong Answer
time: 0ms
memory: 3816kb
input:
15 0 15 15 15 13 13 13 12 10 10 9 9 6 6 4 2
output:
result:
wrong answer Answer contains longer sequence [length = 16], but output contains 0 elements
Subtask #7:
score: 0
Skipped
Dependency #6:
0%
Subtask #8:
score: 0
Wrong Answer
Test #38:
score: 0
Wrong Answer
time: 3ms
memory: 4056kb
input:
74999 604849250 72634 60382 41531 20689 20667 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
output:
result:
wrong answer Answer contains longer sequence [length = 75000], but output contains 0 elements
Subtask #9:
score: 0
Skipped
Dependency #6:
0%