QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#125164 | #6677. Puzzle: Sashigane | HOLIC | WA | 1ms | 3528kb | C++14 | 1.1kb | 2023-07-16 03:55:33 | 2023-07-16 03:55:35 |
Judging History
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;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3424kb
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: -100
Wrong Answer
time: 1ms
memory: 3528kb
input:
1 1 1
output:
No
result:
wrong answer Jury has answer but participant has not. (test case 1)