QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#142168#6677. Puzzle: SashiganeVIOLET__FOREVERWA 1ms3448kbC++141.0kb2023-08-18 16:17:042023-08-18 16:18:29

Judging History

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

  • [2023-08-18 16:18:29]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3448kb
  • [2023-08-18 16:17:04]
  • 提交

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=x4+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;
	cout<<n-1<<endl;
	if(n==1) puts("0");
	else dfs(sx,sy,sx,sy,sx,sy,sx,sy,1);
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3448kb

input:

5 3 4

output:

Yes
4
2 3 1 1
1 2 2 2
4 1 -3 3
5 5 -4 -4

result:

ok Correct. (1 test case)

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3404kb

input:

1 1 1

output:

Yes
0
0

result:

wrong output format Expected EOF (test case 1)