QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#394525#7756. Omniscia Spares NoneoscaryangWA 1ms3864kbC++172.8kb2024-04-20 15:39:462024-04-20 15:39:47

Judging History

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

  • [2024-04-20 15:39:47]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3864kb
  • [2024-04-20 15:39:46]
  • 提交

answer

#include<bits/stdc++.h>

#define vc vector
#define pb emplace_back
#define pii pair<int, int>
#define mkp make_pair
#define rep(i, a, b) for(int i = (a); i <= (b); ++i)
#define lep(i, a, b) for(int i = (a); i >= (b); --i)

using namespace std;
bool st;

mt19937 gen(time(0));

inline int read() {
	int x = 0, w = 0; char ch = getchar(); while(!isdigit(ch)) w |= (ch == '-'), ch = getchar();
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar(); return w ? -x : x; 
}

const int lmt = 1e9;

int n;

bool ed;
signed main() {
	cerr << (&ed - &st) / 1024 / 1024 << "MB ---------------------------" << endl;
	
	cin >> n;
	
	if (n <= 4) {
		puts ("Yes");
		rep (i, 1, n) cout << gen () % lmt << " " << gen () % lmt << endl;
		puts ("0");
		return 0;
	}
	
	if (n <= 6 || n % 2 == 1) return puts ("No"), 0;
	else puts ("Yes");
	
	int m = n / 4; 
	if (n % 4 == 0) {
		rep (i, 1, m) cout << - m - 1 + i << " " << 0 << endl;
		rep (i, 1, m) cout << i << " " << 0 << endl;
		cout << lmt / 2 << " " << lmt << endl;
		rep (i, 2, m) cout << 0 << " " << m - i + 1 << endl;
		rep (i, 1, m - 1) cout << 0 << " " << - i << endl;
		cout << lmt / 2 << " " << - lmt << endl;
		
		cout << 3 * n - 6 << endl;
		rep (i, 2 * m + 1, 4 * m - 1) if (i != 3 * m) cout << i << " " << i + 1 << endl; 
		rep (i, 1, 2 * m - 1) cout << i << " " << i + 1 << endl;
		
		cout << 2 * m + 1 << " " << 4 * m << endl;
		rep (i, 1, m) {
			cout << i << " " << 2 * m + i << endl;
			cout << i << " " << 4 * m + 1 - i << endl;
			cout << 2 * m + 1 - i << " " << 2 * m + i << endl;
			cout << 2 * m + 1 - i << " " << 4 * m + 1 - i << endl;
			if (i != m) {
				cout << i << " " << 2 * m + i + 1 << endl;
				cout << i << " " << 4 * m - i << endl;
				cout << 2 * m + 1 - i << " " << 2 * m + i + 1 << endl;
				cout << 2 * m + 1 - i << " " << 4 * m - i << endl;
			}
		}
	}
	
	else {
		cout << - lmt << " " << lmt / 2 << endl;
		rep (i, 2, m) cout << - m - 1 + i << " " << 0 << endl;
		rep (i, 1, m - 1) cout << i << " " << 0 << endl;
		cout << lmt << " " << lmt / 2 << endl;
		rep (i, 1, m + 1) cout << 0 << " " << m + 2 - i << endl;
		rep (i, 1, m + 1) cout << 0 << " " << - i << endl;
		
		cout << 3 * n - 6 << endl;
		rep (i, 2 * m + 1, 4 * m + 1) if (i != 3 * m + 1) cout << i << " " << i + 1 << endl; 
		rep (i, 1, 2 * m - 1) cout << i << " " << i + 1 << endl;
		cout << 1 << " " << 2 * m << endl;
		rep (i, 1, m) {
			cout << i << " " << 2 * m + i << endl;
			cout << i << " " << 4 * m + 3 - i << endl;
			cout << 2 * m + 1 - i << " " << 2 * m + i << endl;
			cout << 2 * m + 1 - i << " " << 4 * m + 3 - i << endl;
			cout << i << " " << 2 * m + i + 1 << endl;
			cout << i << " " << 4 * m + 2 - i << endl;
			cout << 2 * m + 1 - i << " " << 2 * m + i + 1 << endl;
			cout << 2 * m + 1 - i << " " << 4 * m + 2 - i << endl;
		}
	}
	
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3

output:

Yes
286211936 592014130
794274185 996255280
276794299 252853091
0

result:

ok OK, Accepted.

Test #2:

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

input:

4

output:

Yes
286211936 592014130
794274185 996255280
276794299 252853091
126902450 557256289
0

result:

ok OK, Accepted.

Test #3:

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

input:

1

output:

Yes
286211936 592014130
0

result:

ok OK, Accepted.

Test #4:

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

input:

2

output:

Yes
286211936 592014130
794274185 996255280
0

result:

ok OK, Accepted.

Test #5:

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

input:

5

output:

No

result:

ok OK, Accepted.

Test #6:

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

input:

6

output:

No

result:

ok OK, Accepted.

Test #7:

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

input:

7

output:

No

result:

ok OK, Accepted.

Test #8:

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

input:

8

output:

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

result:

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