QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#416541#6677. Puzzle: SashiganeXiaoretaWWA 1ms3728kbC++201.4kb2024-05-21 22:35:332024-05-21 22:35:33

Judging History

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

  • [2024-05-21 22:35:33]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3728kb
  • [2024-05-21 22:35:33]
  • 提交

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 = 1;
    for (int i = n; i >= 1; i--) if (!gone[i]) {
        cury = i;
        break;
    }
    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: 100
Accepted
time: 1ms
memory: 3700kb

input:

5 3 4

output:

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

result:

ok Correct. (1 test case)

Test #2:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

1 1 1

output:

Yes
0

result:

ok Correct. (1 test case)

Test #3:

score: 0
Accepted
time: 0ms
memory: 3728kb

input:

3 2 3

output:

Yes
2
3 2 -1 1
1 1 2 2

result:

ok Correct. (1 test case)

Test #4:

score: 0
Accepted
time: 0ms
memory: 3492kb

input:

10 10 5

output:

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

result:

ok Correct. (1 test case)

Test #5:

score: 0
Accepted
time: 0ms
memory: 3492kb

input:

10 5 7

output:

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

result:

ok Correct. (1 test case)

Test #6:

score: -100
Wrong Answer
time: 0ms
memory: 3496kb

input:

10 9 2

output:

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

result:

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