Submission #965319

#TimeUsernameProblemLanguageResultExecution timeMemory
965319hirayuu_ojAliens (IOI07_aliens)C++17
80 / 100
2 ms596 KiB
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) #define all(x) x.begin(),x.end(); using ll=long long; int N; bool question(ll x,ll y){ if(x<1)return false; if(x>N)return false; if(y<1)return false; if(y>N)return false; cout<<"examine "<<x<<" "<<y<<endl; string s; cin>>s; if(s=="true")return true; return false; }; int main(){ cin>>N; ll x,y; cin>>x>>y; rep(i,3){ for(int j=28; j>=0; j--){ if(question(x-(1LL<<j),y)){ x-=1LL<<j; } } } rep(i,3){ for(int j=28; j>=0; j--){ if(question(x,y-(1LL<<j))){ y-=1LL<<j; } } } for(int i=28; i>=0; i--){ if(question(x+(1LL<<i),y+(1LL<<i))){ x+=1LL<<i; y+=1LL<<i; } } ll bx=x,by=y; for(int i=28; i>=0; i--){ if(question(x-(1LL<<i),y-(1LL<<i))){ x-=1LL<<i; y-=1LL<<i; } } x=(x+bx)/2; y=(y+by)/2; for(int i=28; i>=0; i--){ if(question(x-(1LL<<i),y+(1LL<<i))){ x-=1LL<<i; y+=1LL<<i; } } bx=x; by=y; for(int i=28; i>=0; i--){ if(question(x+(1LL<<i),y-(1LL<<i))){ x+=1LL<<i; y-=1LL<<i; } } x=(x+bx)/2; y=(y+by)/2; cout<<"solution "<<x<<" "<<y<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...