QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#41697#3837. The Matching System MCPlayer542WA 1ms2020kbC++722b2022-07-31 15:22:022022-07-31 15:22:04

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-07-31 15:22:04]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:2020kb
  • [2022-07-31 15:22:02]
  • 提交

answer

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n,f[1010],md=1e9+7;
char s[1010],p[1010];
int main()
{
	scanf("%d",&n);
	if(n==1)
	{
		printf("0\n0\n1\n*\n0\n2\n");
		return 0;
	}
	if(n==2)
	{
		printf("*0\n00\n3\n*0\n00\n4");
		return 0;
	}
	if(n==4)
	{
		printf("**1*\n1000\n26\n**00\n0000\n10\n");
		return 0;
	}
	for(int i=0;i<n;++i) s[i]='0',p[i]='*';
	s[0]=p[n-2]='1';
	for(int i=0;i<=n;++i) f[i]=1;
	for(int i=0;i<n-2;++i)
	for(int j=1;j<=n;++j)
	f[j]=(f[j-1]+f[j])%md;
	printf("%s\n%s\n%d\n",p,s,f[n]*2);
	for(int i=0;i<n;++i) s[i]=p[i]='0';
	for(int i=0;i<n-n/2;++i) p[i]='*';
	printf("%s\n%s\n%d\n",p,s,(n/2+3)*(n/2)+(n&1)*(n/2+2));
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 1808kb

input:

3

output:

*1*
100
8
**0
000
7

result:

ok Accepted

Test #2:

score: 0
Accepted
time: 0ms
memory: 1828kb

input:

1

output:

0
0
1
*
0
2

result:

ok Accepted

Test #3:

score: 0
Accepted
time: 1ms
memory: 1784kb

input:

2

output:

*0
00
3
*0
00
4

result:

ok Accepted

Test #4:

score: -100
Wrong Answer
time: 1ms
memory: 2020kb

input:

4

output:

**1*
1000
26
**00
0000
10

result:

wrong answer The value of enery cost in the maximum mathing method is wrong