QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#180639#6677. Puzzle: SashiganergnerdplayerWA 0ms3584kbC++201021b2023-09-16 03:12:352023-09-16 03:12:36

Judging History

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

  • [2023-09-16 03:12:36]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3584kb
  • [2023-09-16 03:12:35]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

using i64 = long long;

int main() {
    cin.tie(nullptr)->sync_with_stdio(false);

#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    auto solve = [&]() {
        int n, x, y;
        cin >> n >> x >> y;

        cout << "Yes\n";

        int L = 1, R = n, U = 1, D = n;

        while (U < x && L < y) {
            cout << U << ' ' << L << ' ' << D - U << ' ' << R - L << '\n';
            L++, U++;
        }
        while (x < D && L < y) {
            cout << D << ' ' << L << ' ' << U - D << ' ' << R - L << '\n';
            L++, D--;
        }
        while (U < x && y < R) {
            cout << U << ' ' << R << ' ' << D - U << ' ' << L - R << '\n';
            R--, U++;
        }
        while (x < D && y < R) {
            cout << D << ' ' << R << ' ' << U - D << ' ' << L - R << '\n';
            R--, D--;
        }
    };
    
    solve();
    
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

5 3 4

output:

Yes
1 1 4 4
2 2 3 3
5 3 -2 2
4 5 -1 -1

result:

wrong answer L shape #1 out of bounds. (test case 1)