QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#41698#3837. The Matching System MCPlayer542WA 1ms1848kbC++722b2022-07-31 15:23:072022-07-31 15:23:08

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:23:08]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:1848kb
  • [2022-07-31 15:23:07]
  • 提交

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\n31\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;
}

詳細信息

Test #1:

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

input:

3

output:

*1*
100
8
**0
000
7

result:

ok Accepted

Test #2:

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

input:

1

output:

0
0
1
*
0
2

result:

ok Accepted

Test #3:

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

input:

2

output:

*0
00
3
*0
00
4

result:

ok Accepted

Test #4:

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

input:

4

output:

**1*
1000
31
**00
0000
10

result:

ok Accepted

Test #5:

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

input:

5

output:

***1*
10000
112
***00
00000
14

result:

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