QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#251701#6677. Puzzle: SashiganeTealWA 0ms3528kbC++141.3kb2023-11-14 23:57:082023-11-14 23:57:10

Judging History

你现在查看的是最新测评结果

  • [2023-11-14 23:57:10]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3528kb
  • [2023-11-14 23:57:08]
  • 提交

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)