Submission #125904

#TimeUsernameProblemLanguageResultExecution timeMemory
125904chubyxdxdThe Big Prize (IOI17_prize)C++11
Compilation error
0 ms0 KiB
#include "prize.h" #include <bits/stdc++.h> using namespace std; int find_best(int n) { int a,b,c,d,f; int low=0;int hi=n-1,mid; while(low-hi>1){ mid=(low+hi)/2; vector<int> v=ask(mid); if(v[0]==0 and v[1]==0){ return mid; break; } if(v[0]<v[1]){ low=mid; } else{ hi=mid; } } return i; }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:22:9: error: 'i' was not declared in this scope
  return i;
         ^
prize.cpp:22:9: note: suggested alternative: 'hi'
  return i;
         ^
         hi
prize.cpp:6:6: warning: unused variable 'a' [-Wunused-variable]
  int a,b,c,d,f;
      ^
prize.cpp:6:8: warning: unused variable 'b' [-Wunused-variable]
  int a,b,c,d,f;
        ^
prize.cpp:6:10: warning: unused variable 'c' [-Wunused-variable]
  int a,b,c,d,f;
          ^
prize.cpp:6:12: warning: unused variable 'd' [-Wunused-variable]
  int a,b,c,d,f;
            ^
prize.cpp:6:14: warning: unused variable 'f' [-Wunused-variable]
  int a,b,c,d,f;
              ^