QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#394508 | #7756. Omniscia Spares None | 251Sec | WA | 0ms | 3984kb | C++14 | 1.3kb | 2024-04-20 15:28:43 | 2024-04-20 15:28:44 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
pair<int, int> p[1005];
vector<pair<int, int>> e;
int main() {
scanf("%d", &n);
if (n <= 4) {
puts("Yes");
for (int i = 1; i <= n; i++) printf("%d 0\n", i, 0);
puts("0");
}
else if (n <= 6 || (n & 1)) puts("No");
else {
p[1] = { 0, -1e9 };
p[3] = { 0, 1 };
p[4] = { -1, 2 };
p[5] = { 1, 2 };
p[6] = { 0, 3 };
p[2] = { 0, 1e9 };
e.emplace_back(1, 3);
e.emplace_back(1, 4);
e.emplace_back(1, 5);
e.emplace_back(3, 4);
e.emplace_back(3, 5);
e.emplace_back(4, 5);
e.emplace_back(4, 6);
e.emplace_back(5, 6);
e.emplace_back(4, 2);
e.emplace_back(5, 2);
e.emplace_back(6, 2);
e.emplace_back(1, 2);
int lasA = 4, lasB = 5;
for (int i = 7, j = 2; i <= n; i += 2, j++) {
p[i] = { -j, 2 };
p[i + 1] = { j, 2 };
e.emplace_back(i, lasA);
e.emplace_back(i, 1);
e.emplace_back(i, 2);
e.emplace_back(i + 1, lasB);
e.emplace_back(i + 1, 1);
e.emplace_back(i + 1, 2);
lasA = i, lasB = i + 1;
}
for (int i = 3; i <= n; i++) p[i].first -= 1e4;
puts("Yes");
for (int i = 1; i <= n; i++) printf("%d %d\n", p[i].first, p[i].second);
printf("%d\n", (int)e.size());
for (auto [u, v] : e) printf("%d %d\n", u, v);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3936kb
input:
3
output:
Yes 1 0 2 0 3 0 0
result:
ok OK, Accepted.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3896kb
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: 3984kb
input:
1
output:
Yes 1 0 0
result:
ok OK, Accepted.
Test #4:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
2
output:
Yes 1 0 2 0 0
result:
ok OK, Accepted.
Test #5:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
5
output:
No
result:
ok OK, Accepted.
Test #6:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
6
output:
No
result:
ok OK, Accepted.
Test #7:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
7
output:
No
result:
ok OK, Accepted.
Test #8:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
8
output:
Yes 0 -1000000000 0 1000000000 -10000 1 -10001 2 -9999 2 -10000 3 -10002 2 -9998 2 18 1 3 1 4 1 5 3 4 3 5 4 5 4 6 5 6 4 2 5 2 6 2 1 2 7 4 7 1 7 2 8 5 8 1 8 2
result:
ok OK, Accepted.
Test #9:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
9
output:
No
result:
ok OK, Accepted.
Test #10:
score: -100
Wrong Answer
time: 0ms
memory: 3876kb
input:
10
output:
Yes 0 -1000000000 0 1000000000 -10000 1 -10001 2 -9999 2 -10000 3 -10002 2 -9998 2 -10003 2 -9997 2 24 1 3 1 4 1 5 3 4 3 5 4 5 4 6 5 6 4 2 5 2 6 2 1 2 7 4 7 1 7 2 8 5 8 1 8 2 9 7 9 1 9 2 10 8 10 1 10 2
result:
wrong answer More than 4 Points' Degrees are Less than 6