QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#180638#6677. Puzzle: SashiganergnerdplayerWA 0ms3568kbC++201021b2023-09-16 03:11:062023-09-16 03:11:07

Judging History

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

  • [2023-09-16 03:11:07]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3568kb
  • [2023-09-16 03:11:06]
  • 提交

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

詳細信息

Test #1:

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

input:

5 3 4

output:

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

result:

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