QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#394477 | #7756. Omniscia Spares None | 251Sec | WA | 1ms | 3924kb | C++14 | 1.2kb | 2024-04-20 15:09:08 | 2024-04-20 15:09:08 |
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, 0 };
p[3] = { 0, 1 };
p[4] = { -1, 2 };
p[5] = { 1, 2 };
p[6] = { 0, 3 };
p[2] = { 0, 4 };
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);
for (int i = 7, j = 2; i <= n; i += 2, j++) {
p[i] = { -j, 2 };
p[i + 1] = { j, 2 };
e.emplace_back(i, i - 2);
e.emplace_back(i, 1);
e.emplace_back(i, 2);
e.emplace_back(i + 1, i - 1);
e.emplace_back(i + 1, 1);
e.emplace_back(i + 1, 2);
}
for (int i = 3; i <= n; i++) p[i].first -= 1e8;
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: 1ms
memory: 3916kb
input:
3
output:
Yes 1 0 2 0 3 0 0
result:
ok OK, Accepted.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3924kb
input:
4
output:
Yes 1 0 2 0 3 0 4 0 0
result:
ok OK, Accepted.
Test #3:
score: 0
Accepted
time: 1ms
memory: 3852kb
input:
1
output:
Yes 1 0 0
result:
ok OK, Accepted.
Test #4:
score: 0
Accepted
time: 0ms
memory: 3776kb
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: 3704kb
input:
6
output:
No
result:
ok OK, Accepted.
Test #7:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
7
output:
No
result:
ok OK, Accepted.
Test #8:
score: -100
Wrong Answer
time: 0ms
memory: 3892kb
input:
8
output:
Yes 0 0 0 4 -100000000 1 -100000001 2 -99999999 2 -100000000 3 -100000002 2 -99999998 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 5 7 1 7 2 8 6 8 1 8 2
result:
wrong answer More than 4 Points' Degrees are Less than 6