QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#676692#6677. Puzzle: SashiganeAnon_chan#WA 0ms3644kbC++201.2kb2024-10-25 23:12:202024-10-25 23:12:21

Judging History

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

  • [2024-10-25 23:12:21]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3644kb
  • [2024-10-25 23:12:20]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1e3+10;
const ll INF=1e11+10;
ll n,X,Y,cnt=0;
ll mp[N][N];
ll r[N],cc[N],h[N],w[N];
void dfs(ll x,ll y,ll len){
	if(len==1)return;
	ll Len=len;
	len=(len+1)/2;
	ll midx=x-1+len,midy=y-1+len;
	if(X<=midx&&Y<=midy){
		dfs(x,y,len);
		for(ll i=Len;i>len;--i){
			r[++cnt]=x-1+i;
			cc[cnt]=y-1+i;
			h[cnt]=-(i-1);
			w[cnt]=-(i-1);
		}
	}else if(X<=midx&&midy<=Y){
		dfs(x,midy+((Len&1LL)==0),len);
		for(ll i=Len;i>len;--i){
			r[++cnt]=x-1+i;
			cc[cnt]=y+(Len-i);
			h[cnt]=(i-1);
			w[cnt]=-(i-1);
		}
	}else if(midx<=X&&Y<=midy){
		dfs(midx+((Len&1LL)==0),y,len);
		for(ll i=Len;i>len;--i){
			r[++cnt]=x+(Len-i);
			cc[cnt]=y-1+i;
			h[cnt]=-(i-1);
			w[cnt]=(i-1);
		}
	}else {
		dfs(midx+((Len&1LL)==0),midy+((Len&1LL)==0),len);
		for(ll i=Len;i>midx;--i){
			r[++cnt]=x+(Len-i);
			cc[cnt]=y+(Len-i);
			h[cnt]=i-1;
			w[cnt]=i-1;
		}
	}
}

void solve(void){
	cin>>n>>X>>Y;
	dfs(1,1,n);
	cout<<cnt<<endl;
	for(ll i=1;i<=cnt;++i){
		cout<<cc[i]<<' '<<r[i]<<' '<<h[i]<<' '<<w[i]<<endl;
	}


}
int main(void){
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	ll times=1;
	// cin>>times;
	while(times--)solve();
	return 0;
}

詳細信息

Test #1:

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

input:

5 3 4

output:

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

result:

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