QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#618501 | #6677. Puzzle: Sashigane | rand0 | WA | 0ms | 3640kb | C++14 | 801b | 2024-10-06 22:51:03 | 2024-10-06 22:51:07 |
Judging History
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)