QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#698819#6677. Puzzle: SashiganeAaWA 0ms3732kbC++171.1kb2024-11-01 22:14:342024-11-01 22:14:35

Judging History

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

  • [2024-11-01 22:14:35]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3732kb
  • [2024-11-01 22:14:34]
  • 提交

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

Details

Tip: Click on the bar to expand more detailed information

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)