QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#265516#7756. Omniscia Spares Noneucup-team022#WA 1ms3716kbC++141.5kb2023-11-25 18:59:392023-11-25 18:59:40

Judging History

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

  • [2023-11-25 18:59:40]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3716kb
  • [2023-11-25 18:59:39]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n;
int X[105],Y[105];
vector<pair<int,int> >vec;
inline void AD(int x,int y){vec.emplace_back(x,y);}
inline void DL(){vec.pop_back();}
void solve(int n){
	if(n==8){
		X[1]=0,Y[1]=0;
		X[2]=-10,Y[2]=10;
		X[3]=10,Y[3]=10;
		X[4]=0,Y[4]=20;
		X[5]=0,Y[5]=200;
		X[6]=-200,Y[6]=-20;
		X[7]=200,Y[7]=-20;
		X[8]=0,Y[8]=-10;
		AD(1,2),AD(1,3),AD(2,4),AD(3,4);
		AD(4,5),AD(4,6),AD(4,7);
		AD(2,6),AD(3,7);
		AD(1,6),AD(1,7),AD(1,8);
		AD(5,6),AD(5,7);
		AD(6,8),AD(7,8),AD(6,7);
		return;
	}
	if(n%4==0){
		solve(n-4);
		DL();
		int t=n/4-1;
		X[n-3]=0,Y[n-3]=200*t;
		X[n-2]=-200*t,Y[n-2]=-20*t;
		X[n-1]=200*t,Y[n-1]=20*t;
		X[n]=0,Y[n]=-10*t;
		AD(n-7,n-3),AD(n-7,n-2),AD(n-7,n-1);
		AD(n-3,n-2),AD(n-3,n-1);
		AD(n-2,n-6),AD(n-1,n-5);
		AD(n-2,n-4),AD(n-1,n-4);
		AD(n,n-2),AD(n,n-1),AD(n,n-4);
		AD(n-2,n-1);
	}
}
int main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin>>n;
	if(n<=4){
		cout<<"Yes\n";
		for(int i=1;i<=n;++i)cout<<i<<" 0\n";
		cout<<"0\n";
		return 0;
	}
	if(n==5||n==6||n==7)return cout<<"No\n",0;
	if(n%4==0||n%4==2){
		cout<<"Yes\n";
		if(n%4==0)solve(n),AD(1,4);
		else{
			solve(n-2);
			X[n-1]=0,Y[n-1]=8;
			X[n]=0,Y[n]=12;
			AD(2,3);
			AD(n-1,1),AD(n-1,2),AD(n-1,3);
			AD(n,2),AD(n,3),AD(n,4);
		}
		for(int i=1;i<=n;++i)cout<<X[i]<<" "<<Y[i]<<'\n';
		cout<<vec.size()<<'\n';
		for(auto it:vec)
			cout<<it.first<<' '<<it.second<<'\n';
	}else cout<<"No\n";
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3568kb

input:

3

output:

Yes
1 0
2 0
3 0
0

result:

ok OK, Accepted.

Test #2:

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

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: 3668kb

input:

1

output:

Yes
1 0
0

result:

ok OK, Accepted.

Test #4:

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

input:

2

output:

Yes
1 0
2 0
0

result:

ok OK, Accepted.

Test #5:

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

input:

5

output:

No

result:

ok OK, Accepted.

Test #6:

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

input:

6

output:

No

result:

ok OK, Accepted.

Test #7:

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

input:

7

output:

No

result:

ok OK, Accepted.

Test #8:

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

input:

8

output:

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

result:

ok OK, Accepted.

Test #9:

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

input:

9

output:

No

result:

ok OK, Accepted.

Test #10:

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

input:

10

output:

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

result:

ok OK, Accepted.

Test #11:

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

input:

11

output:

No

result:

ok OK, Accepted.

Test #12:

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

input:

12

output:

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

result:

wrong answer Invalid Planar Graph : segments (1, 2) and (10, 11) intersect