Submission #219695

#TimeUsernameProblemLanguageResultExecution timeMemory
219695MODDIAliens (IOI07_aliens)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define ll long long #define pii pair<int,int> #define pll pair<ll,ll> #define vi vector<int> #define vl vector<ll> #define vll vector<pll> #define vii vector<pii> using namespace std; ll n, x, y, m, midx, midy, hor, ver, jump; void h3(int bright, int bleft){ int bup = 0, bdown = 0; while(true){ if(midy + (bup + 1) * jump > n) break; string response; cout<<"examine "<<midx<<" "<<midy + (bup + 1) * jump<<endl; cin>>response; if(response[0] == 't') bup++; else break; } while(true){ if(midy - (bdown + 1) * jump < 1) break; string response; cout<<"examine "<<midx<<" "<<midy - (bdown + 1) * jump<<endl; cin>>response; if(response[0] == 't') bdown++; else break; } if(bright == bleft){ if(bup == bdown) cout<<"solution "<<midx<<" "<<midy<<endl; else if(bup == 2) cout<<"solution "<<midx<<" "<<midy - jump<<endl; else cout<<"solution "<<midx<<" "<<midy + jump<<endl; } else if(bright == 2){ if(bup == bdown) cout<<"solution "<<midx + jump<<" "<<midy<<endl; else if(bup == 2) cout<<"solution "<<midx + jump<<" "<<midy - jump<<endl; else cout<<"solution "<<midx + jump<<" "<<midy + jump<<endl; } else{ if(bup == bdown) cout<<"solution "<<midx - jump<<" "<<midy<<endl; else if(bup == 2) cout<<"solution "<<midx - jump<<" "<<midy - jump<<endl; else cout<<"solution "<<midx - jump<<" "<<midy + jump<<endl; } } void h2(int bright, int bleft){ midx -= (hor - 1); midy += (ver - 1); h3(bright, bleft); } int main(){ cin>>n>>x>>y; ll left = 0, right = 0, up = 0, down = 0; while(true){ if(x + left + 1 > n) break; string response; cout<<"examine "<<x + left + 1<<" "<<y<<endl; cin>>response; if(response[0] =='t') right++; else break; } while(true){ if(x - (left + 1) < 1) break; string response; cout<<"examine "<<x - left - 1<<" "<<y<<endl; cin>>response; if(response[0]=='t') left++; else break; } while(true){ if(y + up + 1 > n) break; string response; cout<<"examine "<<x<<" "<<y + up + 1<<endl; cin>>response; if(response[0]=='t') up++; else break; } while(true){ if(y - down - 1 < 1) break; string response; cout<<"examine "<<x<<" "<<y - down - 1<<endl; cin>>response; if(response[0] == 't') down++; else break; } hor = left + right + 1, ver = up + down + 1; m = hor * ver; ll x1 = x - down, y1 = y - left; midx = x1 + hor / 2; midy = y1 + ver / 2; int bleft = 0, bright = 0; jump = hor + hor - 1; while(true){ if(x1 + (bright + 1) * jump > n) break; string response; cout<<"examine "<<x1 + bright * jump + jump<<" "<<y1<<endl; cin>>response; if(response[0] == 't') bright++; else break; } while(true){ if(x1 - (bleft + 1) * jump < 1) break; string response; cout<<"examine "<<x1 - bleft * jump - jump<<" "<<y1<<endl; cin>>response; if(response[0] =='t') bleft++; else break; } if(bleft + bright == 2) h3(); else h2(); }

Compilation message (stderr)

aliens.cpp: In function 'int main()':
aliens.cpp:149:6: error: too few arguments to function 'void h3(int, int)'
   h3();
      ^
aliens.cpp:11:6: note: declared here
 void h3(int bright, int bleft){
      ^~
aliens.cpp:151:6: error: too few arguments to function 'void h2(int, int)'
   h2();
      ^
aliens.cpp:63:6: note: declared here
 void h2(int bright, int bleft){
      ^~