QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#822240 | #6677. Puzzle: Sashigane | wxhtzdy | WA | 0ms | 3740kb | C++20 | 1008b | 2024-12-20 04:05:39 | 2024-12-20 04:05:40 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, x, y;
cin >> n >> x >> y;
vector<array<int, 4>> ops;
function<void(int, int, int, int)> Solve = [&](int x1, int y1, int x2, int y2) {
if (x1 == x2 && y1 == y2) {
return;
}
int k = x2 - x1;
if (x != x1) {
if (y != y1) {
ops.push_back({x1, y1, k, k});
Solve(x1 + 1, y1 + 1, x2, y2);
} else {
ops.push_back({x1, y2, -k, k});
Solve(x1 + 1, y1, x2, y2 - 1);
}
} else {
if (y != y1) {
ops.push_back({x2, y1, -k, k});
Solve(x1, y1 + 1, x2 - 1, y2);
} else {
ops.push_back({x2, y2, -k, -k});
Solve(x1, y1, x2 - 1, y2 - 1);
}
}
};
Solve(1, 1, n, n);
cout << "Yes" << '\n';
cout << int(ops.size()) << '\n';
for (auto& p : ops) {
cout << p[0] << " " << p[1] << " " << p[2] << " " << p[3] << '\n';
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3548kb
input:
5 3 4
output:
Yes 4 1 1 4 4 2 2 3 3 5 3 -2 2 4 5 -1 -1
result:
ok Correct. (1 test case)
Test #2:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
1 1 1
output:
Yes 0
result:
ok Correct. (1 test case)
Test #3:
score: 0
Accepted
time: 0ms
memory: 3740kb
input:
3 2 3
output:
Yes 2 1 1 2 2 3 2 -1 1
result:
ok Correct. (1 test case)
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3544kb
input:
10 10 5
output:
Yes 9 1 1 9 9 2 2 8 8 3 3 7 7 4 4 6 6 5 10 -5 5 6 9 -4 4 7 8 -3 3 8 7 -2 2 9 6 -1 1
result:
wrong answer L shape #5 out of bounds. (test case 1)