QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#394494#7756. Omniscia Spares None251SecWA 0ms3988kbC++141.3kb2024-04-20 15:18:112024-04-20 15:18:12

Judging History

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

  • [2024-04-20 15:18:12]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3988kb
  • [2024-04-20 15:18:11]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
pair<int, int> p[1005];
vector<pair<int, int>> e;
int main() {
	scanf("%d", &n);
	if (n <= 4) {
		puts("Yes");
		for (int i = 1; i <= n; i++) printf("%d 0\n", i, 0);
		puts("0");
	}
	else if (n <= 6 || (n & 1)) puts("No");
	else {
		p[1] = { 0, 0 };
		p[3] = { 0, 1 };
		p[4] = { -1, 2 };
		p[5] = { 1, 2 };
		p[6] = { 0, 3 };
		p[2] = { 0, 4 };
		e.emplace_back(1, 3);
		e.emplace_back(1, 4);
		e.emplace_back(1, 5);
		e.emplace_back(3, 4);
		e.emplace_back(3, 5);
		e.emplace_back(4, 5);
		e.emplace_back(4, 6);
		e.emplace_back(5, 6);
		e.emplace_back(4, 2);
		e.emplace_back(5, 2);
		e.emplace_back(6, 2);
		e.emplace_back(1, 2);
		int lasA = 4, lasB = 5;
		for (int i = 7, j = 2; i <= n; i += 2, j++) {
			p[i] = { -j, 2 };
			p[i + 1] = { j, 2 };
			e.emplace_back(i, lasA);
			e.emplace_back(i, 1);
			e.emplace_back(i, 2);
			e.emplace_back(i + 1, lasB);
			e.emplace_back(i + 1, 1);
			e.emplace_back(i + 1, 2);
			lasA = i, lasB = i + 1;
		}
		for (int i = 3; i <= n; i++) p[i].first -= 1e8;
		puts("Yes");
		for (int i = 1; i <= n; i++) printf("%d %d\n", p[i].first, p[i].second);
		printf("%d\n", (int)e.size());
		for (auto [u, v] : e) printf("%d %d\n", u, v);
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3

output:

Yes
1 0
2 0
3 0
0

result:

ok OK, Accepted.

Test #2:

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

input:

4

output:

Yes
1 0
2 0
3 0
4 0
0

result:

ok OK, Accepted.

Test #3:

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

input:

1

output:

Yes
1 0
0

result:

ok OK, Accepted.

Test #4:

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

input:

2

output:

Yes
1 0
2 0
0

result:

ok OK, Accepted.

Test #5:

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

input:

5

output:

No

result:

ok OK, Accepted.

Test #6:

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

input:

6

output:

No

result:

ok OK, Accepted.

Test #7:

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

input:

7

output:

No

result:

ok OK, Accepted.

Test #8:

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

input:

8

output:

Yes
0 0
0 4
-100000000 1
-100000001 2
-99999999 2
-100000000 3
-100000002 2
-99999998 2
18
1 3
1 4
1 5
3 4
3 5
4 5
4 6
5 6
4 2
5 2
6 2
1 2
7 4
7 1
7 2
8 5
8 1
8 2

result:

wrong answer Invalid Planar Graph : segments (1, 4) and (3, 5) intersect