QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#251701 | #6677. Puzzle: Sashigane | Teal | WA | 0ms | 3528kb | C++14 | 1.3kb | 2023-11-14 23:57:08 | 2023-11-14 23:57:10 |
Judging History
answer
#include <set>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define N ()
#define inf (0x3f3f3f3f)
#define INF (0x3f3f3f3f3f3f3f3fll)
#define LL long long
int n, bx, by;
inline int read() {
int x = 0, f = 1; char ch = getchar();
while (ch < '0' || ch > '9')
ch == '-' ? f = -1, ch = getchar() : ch = getchar();
while (ch >= '0' && ch <= '9')
x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
return x * f;
}
int main() {
ios::sync_with_stdio(false);
n = read(), bx = read(), by = read();
int U = by, D = by, L = bx, R = bx;
printf("Yes\n%d\n", n - 1);
for (int i = 1; i < n; ++i) {
if (U - 1 >= 1 && L - 1 >= 1) {// 左上角
U--, L--;
printf("%d %d %d %d\n", L, U, U - D, R - L);
}
else if (D + 1 <= n && L - 1 >= n) { // 左下角
D++, L--;
printf("%d %d %d %d\n", L, D, D - U, R - L);
}
else if (U - 1 >= 1 && R + 1 <= n) { // 右上角
U--, R++;
printf("%d %d %d %d\n", R, U, U - D, L - R);
}
else if (D + 1 <= n && R + 1 <= n) { // 右下角
D++, R++;
printf("%d %d %d %d\n", R, D, D - U, L - R);
}
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3528kb
input:
5 3 4
output:
Yes 4 2 3 -1 1 1 2 -2 2 4 1 -3 -3 5 5 4 -4
result:
wrong answer L shape #2 out of bounds. (test case 1)