Submission #1130225

#TimeUsernameProblemLanguageResultExecution timeMemory
1130225LuvidiAliens (IOI07_aliens)C++20
30 / 100
1 ms432 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll, ll> #define pii pair<int, int> #define fs first #define sc second #define pb push_back ll n,x,y; bool ask(ll x,ll y){ if(x<1||x>n||y<1||y>n)return 0; cout<<"examine "<<x<<' '<<y<<endl; string s; cin>>s; return s=="true"; } void solve() { cin>>n>>x>>y; ll s=1; while(ask(x+2*s,y))s*=2; while(s){ if(ask(x+s,y))x+=s; s/=2; } ll m=x; s=1; while(ask(x-2*s,y))s*=2; while(s){ if(ask(x-s,y))x-=s; s/=2; } m=m-x+1; s=1; while(ask(x,y-2*s))s*=2; while(s){ if(ask(x,y-s))y-=s; s/=2; } x+=m/2; y+=m/2; bool b=0; for(ll i=5;i;i--){ for(ll j=5;j;j--){ if(ask(x+i*m,y+j*m)){ x+=i*m; y+=j*m; b=1; break; } } if(b)break; } x-=2*m; y-=2*m; cout<<"solution "<<x<<' '<<y<<endl; } int main() { #ifdef FPO freopen("in","r",stdin); freopen("out","w",stdout); #endif ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); solve(); }
#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...