QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#142160 | #6677. Puzzle: Sashigane | VIOLET__FOREVER | WA | 1ms | 3624kb | C++14 | 1.0kb | 2023-08-18 16:08:47 | 2023-08-18 16:08:50 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,sx,sy;
void dfs(int x1,int y1,int x2,int y2,int x3,int y3,int x4,int y4,int num){
if(num>n){
exit(0);
}
else{
int xx=x1-1,yy=y1-1;
if(xx>=1 && yy>=1 && xx<=n && yy<=n){
cout<<xx<<" "<<yy<<" "<<num<<" "<<num<<endl;
dfs(xx,yy,x2,y2-1,x3-1,y3,x4,y4,num+1);
return ;
}
xx=x2+1,yy=y2-1;
if(xx>=1 && yy>=1 && xx<=n && yy<=n){
cout<<xx<<" "<<yy<<" "<<num*-1<<" "<<num<<endl;
dfs(x1,y1-1,xx,yy,x3,y3,x4+1,y4,num+1);
return ;
}
xx=x3-1,yy=y3+1;
if(xx>=1 && yy>=1 && xx<=n && yy<=n){
cout<<xx<<" "<<yy<<" "<<num<<" "<<num*-1<<endl;
dfs(x1-1,y1,x2,y2,xx,yy,x4,y4+1,num+1);
return ;
}
xx=x3+1,yy=y4+1;
if(xx>=1 && yy>=1 && xx<=n && yy<=n){
cout<<xx<<" "<<yy<<" "<<num*-1<<" "<<num*-1<<endl;
dfs(x1,y1,x2+1,y2,x3,y3+1,xx,yy,num+1);
}
}
}
signed main(){
cin>>n>>sx>>sy;
cout<<"Yes"<<endl;
if(n==1) puts("0");
else dfs(sx,sy,sx,sy,sx,sy,sx,sy,1);
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3624kb
input:
5 3 4
output:
Yes 2 3 1 1 1 2 2 2 4 1 -3 3 2 5 -4 -4
result:
wrong answer L shape #2 out of bounds. (test case 1)