QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#657879 | #8041. Life is Hard and Undecidable, but... | Luckyblock# | WA | 1ms | 3632kb | C++20 | 2.2kb | 2024-10-19 15:37:57 | 2024-10-19 15:37:57 |
Judging History
answer
//
/*
By:Luckyblock
*/
#include <bits/stdc++.h>
#define LL long long
//=============================================================
//=============================================================
void solve(int k_, int r_) {
std::vector<int> ansx, ansy;
int ex = 295, ey = 5;
if (r_ == 0) {
ansx.push_back(ex), ansy.push_back(ey);
ansx.push_back(ex), ansy.push_back(ey - 1);
ansx.push_back(ex - 1), ansy.push_back(ey);
ansx.push_back(ex - 1), ansy.push_back(ey - 2);
ansx.push_back(ex - 2), ansy.push_back(ey);
} else if (r_ == 1) {
ansx.push_back(ex), ansy.push_back(ey - 1);
ansx.push_back(ex - 1), ansy.push_back(ey);
ansx.push_back(ex - 1), ansy.push_back(ey - 1);
ansx.push_back(ex - 2), ansy.push_back(ey);
ansx.push_back(ex - 2), ansy.push_back(ey - 2);
} else if (r_ == 2) {
ansx.push_back(ex - 1), ansy.push_back(ey);
ansx.push_back(ex - 1), ansy.push_back(ey - 1);
ansx.push_back(ex - 1), ansy.push_back(ey - 2);
ansx.push_back(ex - 2), ansy.push_back(ey);
ansx.push_back(ex - 3), ansy.push_back(ey - 1);
} else {
ansx.push_back(ex - 1), ansy.push_back(ey - 1);
ansx.push_back(ex - 1), ansy.push_back(ey - 2);
ansx.push_back(ex - 2), ansy.push_back(ey);
ansx.push_back(ex - 2), ansy.push_back(ey - 1);
ansx.push_back(ex - 3), ansy.push_back(ey - 2);
}
ex -= k_, ey += k_;
ansx.push_back(ex - 1), ansy.push_back(ey + 2);
ansx.push_back(ex - 1), ansy.push_back(ey + 3);
ansx.push_back(ex - 2), ansy.push_back(ey + 2);
ansx.push_back(ex - 2), ansy.push_back(ey + 3);
std::cout << ansx.size() << "\n";
for (int i = 0, sz = ansx.size(); i < sz; ++ i) {
std::cout << ansx[i] << " " << ansy[i] << "\n";
}
}
//=============================================================
int main() {
//freopen("1.txt", "r", stdin);
std::ios::sync_with_stdio(0), std::cin.tie(0);
int n; std::cin >> n;
if (n == 1) {
std::cout << "1\n1 1\n";
return 0;
} else if (n == 2) {
std::cout << "3\n2 2\n3 2\n4 1\n";
return 0;
} else if (n == 3) {
std::cout << "5\n2 1\n1 2\n1 3\n3 2\n3 3\n";
return 0;
}
int k = (n - 4) / 4, r = (n - 4) % 4;
solve(k, r);
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3612kb
input:
1
output:
1 1 1
result:
ok n=1
Test #2:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
2
output:
3 2 2 3 2 4 1
result:
ok n=3
Test #3:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
3
output:
5 2 1 1 2 1 3 3 2 3 3
result:
ok n=5
Test #4:
score: -100
Wrong Answer
time: 1ms
memory: 3572kb
input:
4
output:
9 295 5 295 4 294 5 294 3 293 5 294 7 294 8 293 7 293 8
result:
wrong answer Alive at generation 4