QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#41701#3837. The Matching System MCPlayer542AC ✓9ms2012kbC++745b2022-07-31 15:39:252022-07-31 15:39:26

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:39:26]
  • 评测
  • 测评结果:AC
  • 用时:9ms
  • 内存:2012kb
  • [2022-07-31 15:39:25]
  • 提交

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';
	f[0]=f[1]=0;
	for(int i=2;i<=n+1;++i) f[i]=1;
	for(int i=0;i<n-2;++i)
	for(int j=1;j<=n+1;++j)
	f[j]=(f[j-1]+f[j]+1)%md;
	printf("%s\n%s\n%d\n",p,s,f[n+1]+1);
	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: 1852kb

input:

3

output:

*1*
100
8
**0
000
7

result:

ok Accepted

Test #2:

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

input:

1

output:

0
0
1
*
0
2

result:

ok Accepted

Test #3:

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

input:

2

output:

*0
00
3
*0
00
4

result:

ok Accepted

Test #4:

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

input:

4

output:

**1*
1000
31
**00
0000
10

result:

ok Accepted

Test #5:

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

input:

5

output:

***1*
10000
119
***00
00000
14

result:

ok Accepted

Test #6:

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

input:

6

output:

****1*
100000
456
***000
000000
18

result:

ok Accepted

Test #7:

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

input:

10

output:

********1*
1000000000
99892
*****00000
0000000000
40

result:

ok Accepted

Test #8:

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

input:

20

output:

******************1*
10000000000000000000
31775330
**********0000000000
00000000000000000000
130

result:

ok Accepted

Test #9:

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

input:

30

output:

****************************1*
100000000000000000000000000000
37652369
***************000000000000000
000000000000000000000000000000
270

result:

ok Accepted

Test #10:

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

input:

50

output:

************************************************1*
10000000000000000000000000000000000000000000000000
637736708
*************************0000000000000000000000000
00000000000000000000000000000000000000000000000000
700

result:

ok Accepted

Test #11:

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

input:

100

output:

**************************************************************************************************1*
1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
990322733
**************************************************00000000000000000000000000000000000000...

result:

ok Accepted

Test #12:

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

input:

200

output:

******************************************************************************************************************************************************************************************************1*
100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Accepted

Test #13:

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

input:

499

output:

************************************************************************************************************************************************************************************************************************************************************************************************************...

result:

ok Accepted

Test #14:

score: 0
Accepted
time: 8ms
memory: 1752kb

input:

888

output:

************************************************************************************************************************************************************************************************************************************************************************************************************...

result:

ok Accepted

Test #15:

score: 0
Accepted
time: 9ms
memory: 1836kb

input:

999

output:

************************************************************************************************************************************************************************************************************************************************************************************************************...

result:

ok Accepted

Test #16:

score: 0
Accepted
time: 6ms
memory: 1780kb

input:

1000

output:

************************************************************************************************************************************************************************************************************************************************************************************************************...

result:

ok Accepted