QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#394524#7756. Omniscia Spares NoneoscaryangWA 1ms3792kbC++172.8kb2024-04-20 15:39:232024-04-20 15:39:24

Judging History

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

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

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: 1ms
memory: 3792kb

input:

3

output:

Yes
523642395 477620915
523551303 855049619
530033751 763755094
0

result:

ok OK, Accepted.

Test #2:

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

input:

4

output:

Yes
523642395 477620915
523551303 855049619
530033751 763755094
293505607 100405726
0

result:

ok OK, Accepted.

Test #3:

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

input:

1

output:

Yes
523642395 477620915
0

result:

ok OK, Accepted.

Test #4:

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

input:

2

output:

Yes
523642395 477620915
523551303 855049619
0

result:

ok OK, Accepted.

Test #5:

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

input:

5

output:

NO

result:

wrong answer Token parameter [name=verdict] equals to "NO", doesn't correspond to pattern "Yes|No"