QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#698819 | #6677. Puzzle: Sashigane | Aa | WA | 0ms | 3732kb | C++17 | 1.1kb | 2024-11-01 22:14:34 | 2024-11-01 22:14:35 |
Judging History
answer
#include <iostream>
#include <algorithm>
#define endl "\n"
using namespace std;
typedef pair<int,int> PII;
PII ul,ur,dl,dr;
void print(PII x){
cout << x.first << " " << x.second << " ";
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
int n,x,y;
cin >> n >> x >> y;
ul=ur=dl=dr={x,y};
cout << "Yes" << endl;
cout << n-1 << endl;
for(int i=1;i<n;i++){
if(ul.first-1>=1 && ul.second-1>=1){
ul.first-=1;
ur.first-=1;
dl.second-=1;
ul.second-=1;
print(ul);
cout << i+1 << " " << i+1 << endl;
}
else if(ur.first-1>=1 && ur.second+1<=n){
ur.first-=1;
ul.first-=1;
ur.second+=1;
dr.second+=1;
print(ur);
cout << i+1 << " " << -(i+1) << endl;
}
else if(dl.first+1<=n && dl.second-1>=1){
dl.first+=1;
dr.first+=1;
dl.second-=1;
ul.second-=1;
print(dl);
cout << -(i+1) << " " << i+1 << endl;
}
else{
dl.first+=1;
dr.first+=1;
dr.second+=1;
ur.second+=1;
print(dr);
cout << -(i+1) << " " << -(i+1) << endl;
}
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3732kb
input:
5 3 4
output:
Yes 4 2 3 2 2 1 2 3 3 4 1 -4 4 5 5 -5 -5
result:
wrong answer L shape #3 out of bounds. (test case 1)