QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#398681#7756. Omniscia Spares NoneThankto_zy6WA 1ms3916kbC++142.0kb2024-04-25 16:25:422024-04-25 16:25:50

Judging History

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

  • [2024-04-25 16:25:50]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3916kb
  • [2024-04-25 16:25:42]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
struct node{
	int u,v;
};
vector<node>a;
int main(){
	int n;
	scanf("%d",&n);
	if(n<=4){
		puts("Yes");
		for(int i=1;i<=n;i++){
			printf("%d %d\n",i,i);
		}
		puts("0");
		return 0;
	}
	if(n%2==1)return 0*puts("No");
	if(n==6)return 0*puts("No");
	puts("Yes");
	printf("0 1\n0 -1\n-1 0\n1 0\n");
	a.push_back({3,4});
	a.push_back({1,3});
	a.push_back({3,2});
	a.push_back({2,4});
	a.push_back({4,1});
	for(int i=6;i<=n-4;i+=2){
		int x=(i+2)/4;
		if(i%2==0){
			printf("%d %d\n%d %d\n",0,x,0,-x);
			a.push_back({i-1,i-2});
			a.push_back({i-1,i-5});
			a.push_back({i-1,i-3});
			a.push_back({i,i-2});
			a.push_back({i,i-3});
			a.push_back({i,i-4});
		}
		else{
			printf("%d %d\n%d %d\n",-x,0,x,0);
			a.push_back({i-1,i-2});
			a.push_back({i-1,i-5});
			a.push_back({i-1,i-3});
			a.push_back({i,i-2});
			a.push_back({i,i-3});
			a.push_back({i,i-4});
		}
	}
	if(n%4==0){
		int p=n/4+1,q=n/4;
		printf("%d %d\n%d %d\n",p,p*2,p,-p*2);
		printf("%d %d\n%d %d\n",-q,0,q,0);
		a.push_back({n-3,n-2});
		int i=n-2;
		a.push_back({i-1,i-2});
		a.push_back({i-1,i-5});
		a.push_back({i-1,i-3});
		a.push_back({i,i-2});
		a.push_back({i,i-3});
		a.push_back({i,i-4});
		i=n;
		a.push_back({i-1,i-2});
		a.push_back({i-1,i-5});
		a.push_back({i-1,i-3});
		a.push_back({i,i-2});
		a.push_back({i,i-3});
		a.push_back({i,i-4});
	}
	else{
		int p=(n+2)/4+1,q=(n+2)/4;
		printf("%d %d\n%d %d\n",-p*2,p,p*2,p);
		printf("%d %d\n%d %d\n",0,q,0,-q);
		a.push_back({n-3,n-2});
		int i=n-2;
		a.push_back({i-1,i-2});
		a.push_back({i-1,i-5});
		a.push_back({i-1,i-3});
		a.push_back({i,i-2});
		a.push_back({i,i-3});
		a.push_back({i,i-4});
		i=n;
		a.push_back({i-1,i-2});
		a.push_back({i-1,i-5});
		a.push_back({i-1,i-3});
		a.push_back({i,i-2});
		a.push_back({i,i-3});
		a.push_back({i,i-4});
	}
	int m=a.size();
	printf("%d\n",m);
	for(auto v:a){
		printf("%d %d\n",v.u,v.v);
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3

output:

Yes
1 1
2 2
3 3
0

result:

ok OK, Accepted.

Test #2:

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

input:

4

output:

Yes
1 1
2 2
3 3
4 4
0

result:

ok OK, Accepted.

Test #3:

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

input:

1

output:

Yes
1 1
0

result:

ok OK, Accepted.

Test #4:

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

input:

2

output:

Yes
1 1
2 2
0

result:

ok OK, Accepted.

Test #5:

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

input:

5

output:

No

result:

ok OK, Accepted.

Test #6:

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

input:

6

output:

No

result:

ok OK, Accepted.

Test #7:

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

input:

7

output:

No

result:

ok OK, Accepted.

Test #8:

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

input:

8

output:

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

result:

ok OK, Accepted.

Test #9:

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

input:

9

output:

No

result:

ok OK, Accepted.

Test #10:

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

input:

10

output:

Yes
0 1
0 -1
-1 0
1 0
0 2
0 -2
-8 4
8 4
0 3
0 -3
24
3 4
1 3
3 2
2 4
4 1
5 4
5 1
5 3
6 4
6 3
6 2
7 8
7 6
7 3
7 5
8 6
8 5
8 4
9 8
9 5
9 7
10 8
10 7
10 6

result:

ok OK, Accepted.

Test #11:

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

input:

11

output:

No

result:

ok OK, Accepted.

Test #12:

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

input:

12

output:

Yes
0 1
0 -1
-1 0
1 0
0 2
0 -2
0 2
0 -2
4 8
4 -8
-3 0
3 0
30
3 4
1 3
3 2
2 4
4 1
5 4
5 1
5 3
6 4
6 3
6 2
7 6
7 3
7 5
8 6
8 5
8 4
9 10
9 8
9 5
9 7
10 8
10 7
10 6
11 10
11 7
11 9
12 10
12 9
12 8

result:

FAIL Duplicated Point