QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#394020#7756. Omniscia Spares NoneXun_xiaoyaoWA 0ms3856kbC++142.0kb2024-04-19 20:56:312024-04-19 20:56:31

Judging History

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

  • [2024-04-19 20:56:31]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3856kb
  • [2024-04-19 20:56:31]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int n;
int main()
{
	cin>>n;
	if(n<=4)
	{
		printf("Yes\n");
		
		for(int i=1;i<=n;i++)
			printf("%d 0",i);
		printf("0\n");
		return 0;
	}
	if(n==6||n%2==1) return printf("No\n"),0;
	
	if(n%4==0)
	{
		for(int i=1;i<=n;i+=4)
		{
			if(i+4>n)
			{
				printf("0 %d\n",i);
				printf("0 -%d\n",i);
				printf("1000000000 1000\n");
				printf("-1000000000 1000\n");
			}
			else
			{
				printf("0 %d\n",i);
				printf("0 -%d\n",i);
				printf("%d 0\n",i);
				printf("-%d 0\n",i);
			}
		}
		
		printf("%d\n",3*n-6);
		printf("1 2\n");
		printf("%d %d\n",n-1,n);

		for(int i=5;i<=n;i++) printf("%d %d\n",i,i-4);
		for(int i=1;i<=n;i+=4)
		{
			printf("%d %d\n", i ,i+2);
			printf("%d %d\n", i ,i+3);
			printf("%d %d\n",i+1,i+2);
			printf("%d %d\n",i+1,i+3);

			if(i!=1)
			{
				printf("%d %d\n",i-3,i+2);
				printf("%d %d\n",i-3,i+3);
				printf("%d %d\n",i-4,i+2);
				printf("%d %d\n",i-4,i+3);
			}
		}
	}
	else
	{
		n-=2;
		for(int i=1;i<=n;i+=4)
		{
			if(i+4>n)
			{
				printf("1000 1000000000\n");
				printf("1000 -1000000000\n");
				printf("%d 0\n",i);
				printf("-%d 0\n",i);
			}
			else
			{
				printf("0 %d\n",i);
				printf("0 -%d\n",i);
				printf("%d 0\n",i);
				printf("-%d 0\n",i);
			}
		}
		printf("%d 0\n",n+1);
		printf("-%d 0\n",n+1);
		
		printf("%d\n",3*n);

		printf("1 2\n");
		printf("%d %d\n",n-3,n-2);

		for(int i=5;i<=n;i++) printf("%d %d\n",i,i-4);
		for(int i=1;i<=n;i+=4)
		{
			printf("%d %d\n", i ,i+2);
			printf("%d %d\n", i ,i+3);
			printf("%d %d\n",i+1,i+2);
			printf("%d %d\n",i+1,i+3);

			if(i!=1)
			{
				printf("%d %d\n",i-3,i+2);
				printf("%d %d\n",i-3,i+3);
				printf("%d %d\n",i-4,i+2);
				printf("%d %d\n",i-4,i+3);
			}
		}
		printf("%d %d\n",n-3,n+1);
		printf("%d %d\n",n-3,n+2);
		printf("%d %d\n",n-2,n+1);
		printf("%d %d\n",n-2,n+2);
		printf("%d %d\n",n-1,n+1);
		printf("%d %d\n", n ,n+2);
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3856kb

input:

3

output:

Yes
1 02 03 00

result:

wrong output format Expected integer, but "02" found