QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#127972 | #6677. Puzzle: Sashigane | moon_095 | WA | 1ms | 3640kb | C++17 | 1.4kb | 2023-07-20 13:25:25 | 2023-07-20 13:25:51 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
// #define endl '\n'
// #define int long long
long long M = 998244353;
typedef long long LL;
typedef pair<int, int> PII;
int n;
int m[1010][1010];
void solve() {
cin >> n;
int a, b;
cin >> a >> b;
if(n == 2) {
if(a == b) {
cout << 3 - a << ' ' << 3 - b << ' ' << 2 * a - 3 << ' ' << 2 * b - 3 << endl;
return;
}
}
cout << "Yes" << endl;
cout << n - 1 << endl;
int idx = 1;
int aa = a - 1, bb = b + 1;
while(aa > 0 && bb <= n) {
cout << aa << ' ' << bb << ' ' << idx << ' ' << -1 * idx << endl;
for(int i = 0; i <= idx; i++) {
m[aa + i][bb] = 1;
m[aa][bb - i] = 1;
}
idx++;
aa--;
bb++;
}
aa = a + 1, bb = b - 1;
while(aa <= n && bb > 0) {
cout << aa << ' ' << bb << ' '<< -1 *idx << ' ' << idx << endl;
for(int i = 0; i <= idx; i++) {
m[aa - i][bb] = 1;
m[aa][bb + i] = 1;
}
idx++;
aa++;
bb--;
}
if(!m[1][1]) {
for(int i = 1; i <= n; i++) {
if(i != a && !m[i][i] ) {
cout << i << ' ' << i << ' ' << n - i << ' ' << n - i << endl;
}
}
}
else {
for(int i = 1; i <= n; i++) {
if(i != a) {
cout << i << ' ' << i << ' ' << i - 1 << ' ' << i - 1 << endl;
}
}
}
}
int main() {
int t;
// cin >> t;
t = 1;
while(t--) {
//cout << "in\n";
solve();}
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3584kb
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: 1ms
memory: 3572kb
input:
1 1 1
output:
Yes 0
result:
ok Correct. (1 test case)
Test #3:
score: 0
Accepted
time: 1ms
memory: 3416kb
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: 1ms
memory: 3428kb
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 1 1 9 9 2 2 8 8 3 3 7 7 4 4 6 6
result:
ok Correct. (1 test case)
Test #5:
score: 0
Accepted
time: 1ms
memory: 3468kb
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: 1ms
memory: 3640kb
input:
10 9 2
output:
Yes 9 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 0 0 2 2 1 1 3 3 2 2 4 4 3 3 5 5 4 4 6 6 5 5 7 7 6 6 8 8 7 7 10 10 9 9
result:
wrong output format Expected EOF (test case 1)