Submission #655091

#TimeUsernameProblemLanguageResultExecution timeMemory
655091angelo_torresCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "cave.h" void exploreCave(int N) { vector<int> S,D; for(int i = 0; i < N; ++i){ vector<int> s.resize(N); for(auto &it : s) it = 0; bool fl = (i == tryCombination(s)); int l = 0, r = N-1; while(r != l){ int md = (l+r)>>1; int kl = l, kr = md; for(int j = l; j <= md; ++j) s[j] = 1-s[j]; bool gl = (i == tryCombination(s)); if(fl == gl) l = md+1; else r = md; for(int j = kl; j <= kr; ++j) s[j] = 1-s[j]; } if(fl) S[l] = 1-s[l]; else S[l] = s[l]; D[l] = i; } answer(S,D); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:5:5: error: 'vector' was not declared in this scope
    5 |     vector<int> S,D;
      |     ^~~~~~
cave.cpp:5:5: note: suggested alternatives:
In file included from /usr/include/c++/10/vector:67,
                 from /usr/include/c++/10/functional:62,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from cave.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:389:11: note:   'std::vector'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from /usr/include/c++/10/functional:62,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from cave.cpp:1:
/usr/include/c++/10/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
cave.cpp:5:12: error: expected primary-expression before 'int'
    5 |     vector<int> S,D;
      |            ^~~
cave.cpp:7:16: error: expected primary-expression before 'int'
    7 |         vector<int> s.resize(N);
      |                ^~~
cave.cpp:8:24: error: 's' was not declared in this scope
    8 |         for(auto &it : s) it = 0;
      |                        ^
cave.cpp:9:40: error: 's' was not declared in this scope
    9 |         bool fl = (i == tryCombination(s));
      |                                        ^
cave.cpp:20:16: error: 'S' was not declared in this scope
   20 |         if(fl) S[l] = 1-s[l];
      |                ^
cave.cpp:21:14: error: 'S' was not declared in this scope
   21 |         else S[l] = s[l];
      |              ^
cave.cpp:22:9: error: 'D' was not declared in this scope
   22 |         D[l] = i;
      |         ^
cave.cpp:24:12: error: 'S' was not declared in this scope
   24 |     answer(S,D);
      |            ^
cave.cpp:24:14: error: 'D' was not declared in this scope
   24 |     answer(S,D);
      |              ^