QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#394524 | #7756. Omniscia Spares None | oscaryang | WA | 1ms | 3792kb | C++17 | 2.8kb | 2024-04-20 15:39:23 | 2024-04-20 15:39:24 |
Judging History
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"