QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#852102 | #9770. Middle Point | Wanye | WA | 0ms | 3576kb | C++14 | 921b | 2025-01-11 10:07:36 | 2025-01-11 10:07:38 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define N 50005
using namespace std;
struct node{ll a,b,c,d;};
ll a,b,x,y,ta,tb,la,ra,lb,rb,viss[N],ans;
vector<node> ans2;
inline void dfs(ll x,ll y,ll dep){
if(!dep) return ;
dfs(2*x-(2*x>a?a:0),2*y-(2*y>b?b:0),dep-1);
cout<<(2*x>a?a:0)<<" "<<(2*y>b?b:0)<<" "<<2*x-(2*x>a?a:0)<<" "<<2*y-(2*y>b?b:0)<<endl;
}
int main(){
ll num1 = 0,num2 = 0;
cin>>a>>b>>x>>y;
if(x==0&&y==0||x==a&&y==0||x==0&&y==b||x==a&&y==b){
cout<<0<<endl;
return 0;
}
if(a){
ta = a;
while(ta%2==0) ta/=2,num1++;
if(x%ta!=0){
cout<<-1<<endl;
return 0;
}
}
if(b){
tb = b;
while(tb%2==0) tb/=2,num2++;
if(y%tb!=0){
cout<<-1<<endl;
return 0;
}
}
ans=max(num1,num2);
dfs(x,y,ans);
cout<<ans2.size()<<endl;
for(int i=0;i<ans2.size();i++) cout<<ans2[i].a<<" "<<ans2[i].b<<" "<<ans2[i].c<<" "<<ans2[i].d<<endl;
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3576kb
input:
2 2 1 1
output:
0 0 2 2 0
result:
wrong answer target point have not been added into S