QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#277333 | #6677. Puzzle: Sashigane | ucup-team191# | WA | 1ms | 3548kb | C++14 | 1.0kb | 2023-12-06 17:49:36 | 2023-12-06 17:49:36 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef pair <int, int> pi;
int n, cx, cy;
vector <pair <pi, pi> > sol;
int main () {
cin >> n >> cx >> cy;
int len = 1;
while (cx < n && cy > 1) {
cx++; cy--; len++;
sol.push_back({{cx, cy}, {-len, len}});
}
if (cx == n) {
while (cy > 1) {
cy--; len++;
sol.push_back({{n + 1 - len, cy}, {len, len}});
}
} else if (cy == 1) {
while (cx < n) {
cx++; len++;
sol.push_back({{cx, len}, {-len, -len}});
}
}
while (len < n) {
len++;
sol.push_back({{n + 1 - len, len}, {len, -len}});
}
cout << "Yes\n";
cout << sol.size() << '\n';
for (int i = 0; i < sol.size(); i++) {
int x = sol[i].first.first;
int y = sol[i].first.second;
int h = sol[i].second.first;
int w = sol[i].second.second;
cout << x << " " << y << " " << h << " " << w << '\n';
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3548kb
input:
5 3 4
output:
Yes 4 4 3 -2 2 5 2 -3 3 2 1 4 4 1 5 5 -5
result:
wrong answer L shape #3 out of bounds. (test case 1)