QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#105373#4794. SalajDeterminantWA 1029ms3600kbC++14517b2023-05-13 23:27:122023-05-13 23:27:15

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-13 23:27:15]
  • 评测
  • 测评结果:WA
  • 用时:1029ms
  • 内存:3600kb
  • [2023-05-13 23:27:12]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n,m,p,f[57][57];
void sol(){
	scanf("%d%d%d",&n,&m,&p);memset(f,0,sizeof(f));f[n][0]=1;
	for(int i=1;i<=m;++i){
		if(i>n*(n-1)/2)f[n][0]=0;
		for(int k=n-1;k;k--)for(int j=1;j<=n;++j)
		if(i>=n-j+k&&i<=(n*(n-1)+(n-j+1)*(n-j))/2)
		for(int l=j+1;l<=n;++l)f[j][k]=(f[j][k]+f[l][k-1])%p;
		else f[j][k]=0;
		int s=0;for(int j=1;j<=n;++j)for(int k=0;k<n;++k)s=(s+f[j][k])%p;
		printf("%d ",s);
	}puts("");
}
int main(){int t;scanf("%d",&t);while(t--)sol();}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 3600kb

input:

2
5 10 666013
6 9 10

output:

1 2 4 9 21 50 110 209 351 546 
1 2 4 9 1 1 6 0 7 

result:

ok 19 numbers

Test #2:

score: -100
Wrong Answer
time: 1029ms
memory: 3524kb

input:

10
31 248 8654701
13 11 331266209
33 517 52876477
26 580 675225807
48 2029 311070528
26 31 327981899
39 25 644128037
29 776 464963196
43 799 451592950
25 184 564388620

output:

1 2 4 9 21 51 127 323 835 2188 5798 15511 41835 113634 310572 853467 2356779 6536382 889882 7578514 4072343 2646977 4649285 7797829 7894657 8630011 5369867 7539674 4332126 8201689 8589675 2709364 4018535 3531401 5490003 4890382 334630 1280966 7295275 4971992 1680824 7744560 2450701 2716471 1097918 5...

result:

wrong answer 1102nd numbers differ - expected: '546820274', found: '546820249'