QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#125162#6677. Puzzle: SashiganeHOLICWA 1ms3560kbC++141.1kb2023-07-16 03:54:282023-07-16 03:54:31

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-16 03:54:31]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3560kb
  • [2023-07-16 03:54:28]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 1009;
const int M = 5e5 + 1009;
struct node{
    int a, b, c, d;
};
vector<node> ans;
int n, a, b;
void work() {
    cin >> n >> a >> b;
    if(n == 1) {
        cout <<"No" << endl;
        return;
    }
    int d = min(a, b);
    for(int i = 1; i < d; i ++)
        ans.push_back({i, i, n - i, n - i});

    if(a > b) {
        for(int i = d; i < a; i ++) {
            ans.push_back({i, n - i + d, n - i, -(n - i)});
        }
    } else if(b > a) {
        for(int i = d; i < b; i ++) {
            ans.push_back({n - i + d, i, -(n - i), n - i});
        }
    }
    int w = n - ans.size() - 1;
    for(int i = 1; i <= w; i ++)
        ans.push_back({a + i, b + i, -i, i});
    cout <<"Yes" << endl;
    cout << ans.size() << endl;
    for(auto [a, b, c, d] : ans)
        cout << a << " "<< b << " " << c << " " <<d << endl;
}
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int Case = 1;
    while(Case --) work();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3560kb

input:

5 3 4

output:

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

result:

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