QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#142160#6677. Puzzle: SashiganeVIOLET__FOREVERWA 1ms3624kbC++141.0kb2023-08-18 16:08:472023-08-18 16:08:50

Judging History

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

  • [2023-08-18 16:08:50]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3624kb
  • [2023-08-18 16:08:47]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

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)