QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#618501#6677. Puzzle: Sashiganerand0WA 0ms3640kbC++14801b2024-10-06 22:51:032024-10-06 22:51:07

Judging History

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

  • [2024-10-06 22:51:07]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3640kb
  • [2024-10-06 22:51:03]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1000000007;
const double pi=acos(-1.0);
#define N 100005

void work(ll n,ll i,ll j,ll x,ll y){
	if(n==1)return;
	if(i!=x&&j!=y){
		cout<<i<<" "<<j<<" "<<n-1<<" "<<n-1<<"\n";
		work(n-1,i+1,j+1,x,y);
	}
	else if((i+n-1)!=x&&j!=y){
		cout<<(i+n-1)<<" "<<j<<" "<<-(n-1)<<" "<<n-1<<"\n";
		work(n-1,i,j+1,x,y);
	}
	else if(i!=x&&(j+n-1)!=y){
		cout<<i<<" "<<(j+n-1)<<" "<<n-1<<" "<<-(n-1)<<"\n";
		work(n-1,i+1,j,x,y);
	}
	else{
		cout<<(i+n-1)<<" "<<(j+n-1)<<" "<<-(n-1)<<" "<<-(n-1)<<"\n";
		work(n-1,i,j,x,y);
	}
}

void solve(){
	ll n,x,y;
	cin>>n>>x>>y;
	cout<<n-1<<"\n";
	work(n,1,1,x,y);
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
	solve();
    return 0;
} 

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3640kb

input:

5 3 4

output:

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

result:

wrong answer YES or NO expected in answer, but 4 found. (test case 1)