QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#822240#6677. Puzzle: SashiganewxhtzdyWA 0ms3740kbC++201008b2024-12-20 04:05:392024-12-20 04:05:40

Judging History

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

  • [2024-12-20 04:05:40]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3740kb
  • [2024-12-20 04:05:39]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, x, y;
  cin >> n >> x >> y;
  vector<array<int, 4>> ops;
  function<void(int, int, int, int)> Solve = [&](int x1, int y1, int x2, int y2) {
    if (x1 == x2 && y1 == y2) {
      return;
    }
    int k = x2 - x1;
    if (x != x1) {
      if (y != y1) {
        ops.push_back({x1, y1, k, k});
        Solve(x1 + 1, y1 + 1, x2, y2);
      } else {
        ops.push_back({x1, y2, -k, k});
        Solve(x1 + 1, y1, x2, y2 - 1);
      }
    } else {
      if (y != y1) {
        ops.push_back({x2, y1, -k, k});
        Solve(x1, y1 + 1, x2 - 1, y2);
      } else {
        ops.push_back({x2, y2, -k, -k});
        Solve(x1, y1, x2 - 1, y2 - 1);
      }
    }
  };
  Solve(1, 1, n, n);
  cout << "Yes" << '\n';
  cout << int(ops.size()) << '\n';
  for (auto& p : ops) {
    cout << p[0] << " " << p[1] << " " << p[2] << " " << p[3] << '\n';
  }
  return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3548kb

input:

5 3 4

output:

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

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: 3740kb

input:

3 2 3

output:

Yes
2
1 1 2 2
3 2 -1 1

result:

ok Correct. (1 test case)

Test #4:

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

input:

10 10 5

output:

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

result:

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