QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#394558#7756. Omniscia Spares Nonele0nWA 0ms3940kbC++141.5kb2024-04-20 16:11:412024-04-20 16:11:42

Judging History

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

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

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: 100
Accepted
time: 0ms
memory: 3876kb

input:

3

output:

Yes
0 1
0 2
0 3
0

result:

ok OK, Accepted.

Test #2:

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

input:

4

output:

Yes
0 1
0 2
0 3
0 4
0

result:

ok OK, Accepted.

Test #3:

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

input:

1

output:

Yes
0 1
0

result:

ok OK, Accepted.

Test #4:

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

input:

2

output:

Yes
0 1
0 2
0

result:

ok OK, Accepted.

Test #5:

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

input:

5

output:

No

result:

ok OK, Accepted.

Test #6:

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

input:

6

output:

No

result:

ok OK, Accepted.

Test #7:

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

input:

7

output:

No

result:

ok OK, Accepted.

Test #8:

score: -100
Wrong Answer
time: 0ms
memory: 3940kb

input:

8

output:

Yes
0 1
0 -1
1 0
-1 0
0 2
0 -2
1000000000 8
-1000000000 8
18
1 5
2 6
3 7
4 8
3 4
1 3
2 3
1 4
2 4
3 5
4 5
3 6
4 6
5 7
6 7
5 8
6 8
7 8

result:

wrong answer More than 4 Points' Degrees are Less than 6