QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#394792#7756. Omniscia Spares NonejuruoAWA 0ms3868kbC++142.0kb2024-04-20 19:40:552024-04-20 19:40:55

Judging History

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

  • [2024-04-20 19:40:55]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3868kb
  • [2024-04-20 19:40:55]
  • 提交

answer

#include <bits/stdc++.h>
using std::bitset;
using std::cout;
using std::deque;
using std::endl;
using std::greater;
using std::lower_bound;
using std::make_pair;
using std::map;
using std::max;
using std::min;
using std::multimap;
using std::multiset;
using std::nth_element;
using std::pair;
using std::priority_queue;
using std::queue;
using std::reverse; 
using std::set;
using std::sort;
using std::sqrt;
using std::stable_sort;
using std::string;
using std::swap;
using std::unique;
using std::upper_bound;
using std::vector;
typedef long long li;
typedef long double lf;

inline li read(){
	li ans = 0, f = 1;
	char ch = getchar();
	while(ch < '0' || ch > '9'){
		f = (ch == '-') ? -1 : 1;
		ch = getchar();
	}
	while(ch <= '9' && ch >= '0'){
		ans = ans * 10 + (ch ^ 48);
		ch = getchar();
	}
	return ans * f;
} 

vector<pair<li, li>> a;

int main(){
    // freopen("wonderful.ans", "r", stdin);
    // freopen("www.ww", "w", stdout); 
	li n = read();
	if(n <= 4){
		puts("Yes");
		for(li i = 1; i <= n; i++) printf("0 %lld\n", i);
		puts("0");
		return 0;
	}
	if(n <= 6 || (n % 2) == 1) {
		puts("No");
		return 0;
	}
	printf("Yes\n1 0\n-1 0\n0 1\n0 -1\n");
	a.push_back({1, 3}), a.push_back({1, 4}), a.push_back({3, 4}), a.push_back({2, 3}), a.push_back({2, 4});
	for(li i = 6; i <= n; i += 2){
		if(i % 4 == 2){
			if(i == n - 2) printf("10000000 10000\n-10000000 10000\n");
			else printf("%lld 0\n%lld 0\n", i, -i);
			for(li j = i - 5; j < i - 1; j++){
				if(j % 4 != 2) a.push_back({i - 1, j});
				if(j % 4 != 1) a.push_back({i, j});
			}
		} else{
			if(n - 2 == i) printf("10000 10000000\n10000 -10000000\n");
			else printf("%lld %lld\n%lld %lld\n", i, -i);
			for(li j = i - 5; j < i - 1; j++){
				if(j % 4 != 0) a.push_back({i - 1, j});
				if(j % 4 != 3) a.push_back({i, j});
			}
		}
	} 
	a.push_back({n - 2, n - 3});
	printf("%lld\n", (li)a.size());
	for(auto [x, y] : a) printf("%lld %lld\n", x, y);
    return 0;
} 

詳細信息

Test #1:

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

input:

3

output:

Yes
0 1
0 2
0 3
0

result:

ok OK, Accepted.

Test #2:

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

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

input:

1

output:

Yes
0 1
0

result:

ok OK, Accepted.

Test #4:

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

input:

2

output:

Yes
0 1
0 2
0

result:

ok OK, Accepted.

Test #5:

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

input:

5

output:

No

result:

ok OK, Accepted.

Test #6:

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

input:

6

output:

No

result:

ok OK, Accepted.

Test #7:

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

input:

7

output:

No

result:

ok OK, Accepted.

Test #8:

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

input:

8

output:

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

result:

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