瞎搞题
刚开始没有反应过来
想着有没有什么正解。
但是WA了一发之后,思考了很久
突然意识到
妈妈组这个条件的和
一定不会很多!!!
然后抱着试试的心态,交了一发
#include<iostream>
#include<algorithm>
#include<map>
#include<cmath>
using namespace std;
typedef long long ll;
const int max_n = 1e6+100;
const int bo = 1000000;
ll query(int x,int y)
{
cout<<x<<" "<<y<<endl;
cout.flush();
ll d;cin>>d;
return d;
}
map<ll,bool> mp;
int main()
{
ios::sync_with_stdio(0);
for (ll i=0;i<=bo;++i)mp[i*i]=1;
int n;cin>>n;
while (n--)
{
ll d = query(0,0);
for (ll x=0;x*x<=d;++x)
{
if (mp.count(d-x*x))
{
if (query(x,sqrt(d-x*x))==0)
{
break;
}
}
}
}
}
京公网安备 11010502036488号