QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#933658 | #7756. Omniscia Spares None | Huangdu Technology Kindergarten (Naihui Jiang, Youwen Zhang, Siming Zhao) | WA | 1ms | 3712kb | C++23 | 3.4kb | 2025-03-13 23:35:07 | 2025-03-13 23:35:08 |
Judging History
answer
//
// ____ _ _ _ __ ____ ___ ____ _____
// | _ \ (_) __ _ _ __ __ _ | | ___ / | / /_ |___ \ ( _ ) | ___| |___ |
// | | | | | | / _` | | '_ \ / _` | | | / _ \ | | | '_ \ __) | / _ \ |___ \ / /
// | |_| | | | | (_| | | | | | | (_| | | | | __/ | | | (_) | / __/ | (_) | ___) | / /
// |____/ _/ | \__,_| |_| |_| \__, | |_| \___| |_| \___/ |_____| \___/ |____/ /_/
// |__/ |___/
//
// [题目链接] :
//
// [题目名称] :
//
// [ 做法 ] :
//
#include <bits/stdc++.h>
#define fir first
#define sec second
#define el '\n'
#define all(x) (x).begin(), (x).end()
#define FINISH cout << "FINISH" << endl;
#define debug(x) cout << #x << " :== " << x << endl;
#define debugv(x)\
cout << #x << " :: ";\
for (auto v : x) cout << v << " ";\
cout << endl;
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
const int mod = 998244353;
const int inf = 0x3f3f3f3f;
struct point {
int x, y;
};
void solve()
{
int n;
cin >> n;
if (n <= 4) {
cout << "YES" << el;
for (int i = 1; i <= n ;i++) {
cout << i << " " << i << endl;
}
cout << "0" << el;
return;
}
if (n == 6 || n % 2 == 1) {
cout << "NO" << el;
return;
}
vector<vector<int>> edge(n + 1);
vector<point> a(n + 1);
a[5] = {0, 0};
a[6] = {4, 4};
a[7] = {0, 4};
a[8] = {4, 0};
a[1] = {1, 1};
a[2] = {3, 3};
a[3] = {1, 3};
a[4] = {3, 1};
int cnt = 0;
edge[3].push_back(1);
edge[3].push_back(2);
edge[4].push_back(1);
edge[4].push_back(2);
edge[4].push_back(3);
edge[5].push_back(1);
edge[5].push_back(3);
edge[5].push_back(4);
edge[6].push_back(2);
edge[6].push_back(3);
edge[6].push_back(4);
edge[7].push_back(3);
edge[7].push_back(5);
edge[7].push_back(6);
edge[8].push_back(4);
edge[8].push_back(5);
edge[8].push_back(6);
int tmp = 2;
for (int i = 10; i <= n; i += 2) {
if (n % 4 == 2) {
tmp += 2;
a[i - 1] = {2 - tmp, 2 - tmp};
a[i] = {2 + tmp, 2 + tmp};
}
else {
a[i - 1] = {2 - tmp, 2 + tmp};
a[i] = {2 + tmp, 2 - tmp};
}
edge[i - 1].push_back(i - 5);
edge[i - 1].push_back(i - 3);
edge[i - 1].push_back(i - 2);
edge[i].push_back(i - 4);
edge[i].push_back(i - 3);
edge[i].push_back(i - 2);
}
edge[n - 2].push_back(n - 3);
for (int i= 1; i <= n; i++) {
if (i != n - 2 || i != n - 3) {
if (n % 4 == 0) {
a[i].x += 400;
a[i].y -= 400;
}
else {
a[i].x += 400;
a[i].y += 400;
}
}
}
cout << "YES" << el;
for (int i = 1; i <= n; i++) {
cout << a[i].x << " " << a[i].y << endl;
}
cout << 3 * n - 6 << endl;
for (int i= 1; i <= n; i++) {
for (auto to : edge[i]) {
cout << i << " " << to << endl;
}
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int T = 1;
// cin >> T;
while (T--) {
solve();
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3712kb
input:
3
output:
YES 1 1 2 2 3 3 0
result:
wrong answer Token parameter [name=verdict] equals to "YES", doesn't correspond to pattern "Yes|No"