QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#416548#6677. Puzzle: SashiganeXiaoretaWWA 0ms3512kbC++201.6kb2024-05-21 22:42:032024-05-21 22:42:05

Judging History

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

  • [2024-05-21 22:42:05]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3512kb
  • [2024-05-21 22:42:03]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define sz(a) ((int)a.size())
#define all(a) a.begin(), a.end()
#define rep(i, l, r) for (int i = l; i < r; ++i)
#define per(i, r, l) for (int i = r-1; i >= l; --i)
typedef long long ll;
typedef pair<int, int> PI;
template<typename T> bool setmax(T &a, T b) { return (a < b ? a = b, 1 : 0); }
template<typename T> bool setmin(T &a, T b) { return (a > b ? a = b, 1 : 0); }

int main() {
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    int n, x, y; cin >> n >> x >> y;
    vector<array<int, 4>> ans;

    vector<int> gone(n + 1);
    gone[y] = 1;
    int d = 1;
    // you shang
    while (x - d > 0 && y + d <= n) {
        gone[y + d] = 1;
        ans.push_back({x - d, y + d, d, -d});
        ++d;
    }
    int dd = 1;
    while (x + dd <= n && y - dd > 0) {
        gone[y - dd] = 1;
        ans.push_back({x + dd, y - dd, -d, d});
        ++dd;
        ++d;
    }

    int cury = 0;
    for (int i = n; i >= 1; i--) if (!gone[i]) {
        cury = i;
        break;
    }
    if (cury + d >= n) {
        while (cury != 0 && cury <= n) {
            ans.push_back({cury, cury, -d, -d});
            ++d;
            ++cury;
        }
    } else {
        while (cury > 0 && n != 1) {
            ans.push_back({cury, cury, d, d});
            ++d;
            --cury;
        }
    }

    cout << "Yes\n";
    cout << sz(ans) << '\n';
    for (auto [r, c, h, w] : ans) cout << r << ' ' << c << ' ' << h << ' ' << w << '\n';

    return 0;
}

详细

Test #1:

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

input:

5 3 4

output:

Yes
8
2 5 1 -1
4 3 -2 2
5 2 -3 3
1 1 -4 -4
2 2 -5 -5
3 3 -6 -6
4 4 -7 -7
5 5 -8 -8

result:

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