Submission #104401

#TimeUsernameProblemLanguageResultExecution timeMemory
104401BadralThe Big Prize (IOI17_prize)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "prize.h" int can(int k) { vector<int> cer = ask(k); if(cer[0] == 0 && cer[1] == 0) return 2; if(cer[0] == 1) return 0; return 1; } int find_best(int n) { int kk = 0; for(int i = n; i >= 1; i /= 2) {} int p = can(i+kk); if(p == 2) return i+kk; while(i+kk <= n && p) kk += i; } return kk; }

Compilation message (stderr)

prize.cpp: In function 'int can(int)':
prize.cpp:5:2: error: 'vector' was not declared in this scope
  vector<int> cer = ask(k);
  ^~~~~~
prize.cpp:5:2: note: suggested alternative:
In file included from /usr/include/c++/7/vector:64:0,
                 from /usr/include/c++/7/functional:61,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71,
                 from prize.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:216:11: note:   'std::vector'
     class vector : protected _Vector_base<_Tp, _Alloc>
           ^~~~~~
prize.cpp:5:9: error: expected primary-expression before 'int'
  vector<int> cer = ask(k);
         ^~~
prize.cpp:6:5: error: 'cer' was not declared in this scope
  if(cer[0] == 0 && cer[1] == 0) 
     ^~~
prize.cpp:8:5: error: 'cer' was not declared in this scope
  if(cer[0] == 1) return 0;
     ^~~
prize.cpp: In function 'int find_best(int)':
prize.cpp:15:15: error: 'i' was not declared in this scope
   int p = can(i+kk);
               ^
prize.cpp: At global scope:
prize.cpp:21:2: error: expected unqualified-id before 'return'
  return kk;
  ^~~~~~
prize.cpp:22:1: error: expected declaration before '}' token
 }
 ^