QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#394557#7756. Omniscia Spares Nonele0nWA 0ms3908kbC++141.5kb2024-04-20 16:11:002024-04-20 16:11:00

Judging History

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

  • [2024-04-20 16:11:00]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3908kb
  • [2024-04-20 16:11:00]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

vector< pair<int, int> > E;
pair<int, int> pos[100005];

int main()
{
	int n, i;
	scanf("%d", &n);
	if(n <= 4)
	{
		printf("YES\n");
		for(i = 1; i <= n; i++)
			printf("0 %d\n", i);
		printf("0\n");
		return 0;
	}
	if(n == 6 || (n & 1))
	{
		printf("NO\n");
		return 0;
	}
	pos[1] = make_pair(0, 1);
	pos[2] = make_pair(0, -1);
	pos[3] = make_pair(1, 0);
	pos[4] = make_pair(-1, 0);
	pos[5] = make_pair(0, 2);
	pos[6] = make_pair(0, -2);
	for(i = 1; i <= n - 4; i++)
		E.emplace_back(make_pair(i, i + 4));
	E.emplace_back(make_pair(3, 4));
	for(i = 1; i <= n - 2; i += 2)
	{
		E.emplace_back(make_pair(i, i + 2));
		E.emplace_back(make_pair(i + 1, i + 2));
		E.emplace_back(make_pair(i, i + 3));
		E.emplace_back(make_pair(i + 1, i + 3));
	}
	E.emplace_back(make_pair(n - 1, n));
	for(i = 7; i <= n - 2; i += 2)
		if((i / 2) & 1)
		{
			pos[i] = make_pair(i / 2, 0);
			pos[i + 1] = make_pair(-(i / 2), 0);
		}
		else
		{
			pos[i] = make_pair(0, i / 2 + 1);
			pos[i] = make_pair(0, -(i / 2 + 1));
		}
	if((n / 2) & 1)
	{
		pos[n - 1] = make_pair(-n, 1e9);
		pos[n] = make_pair(-n, -1e9);
	}
	else
	{
		pos[n - 1] = make_pair(1e9, n);
		pos[n] = make_pair(-1e9, n);
	}
	printf("YES\n");
	for(i = 1; i <= n; i++)
		printf("%d %d\n", pos[i].first, pos[i].second);
	printf("%d\n", E.size());
	for(i = 0; i < E.size(); i++)
		printf("%d %d\n", E[i].first, E[i].second);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3

output:

YES
0 1
0 2
0 3
0

result:

wrong answer Token parameter [name=verdict] equals to "YES", doesn't correspond to pattern "Yes|No"