Submission #509865

#TimeUsernameProblemLanguageResultExecution timeMemory
509865vectorChameleon's Love (JOI20_chameleon)C++17
Compilation error
0 ms0 KiB
#include "chameleon.h" #include<bits/stdc++.h> namespace { int variable_example = 1; } // namespace void Solve(int N) { for(int i=1;i<=2*N;i++)for(int j=i+1;j<=2*N;j++)if(i!=j){ vector<int>p; p.push_back(i); p.push_back(j); if(Query(p)==1)answer(i,j); } }

Compilation message (stderr)

chameleon.cpp: In function 'void Solve(int)':
chameleon.cpp:12:9: error: 'vector' was not declared in this scope
   12 |         vector<int>p;
      |         ^~~~~~
chameleon.cpp:12:9: note: suggested alternatives:
In file included from /usr/include/c++/10/vector:67,
                 from chameleon.h:5,
                 from chameleon.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 chameleon.h:5,
                 from chameleon.cpp:1:
/usr/include/c++/10/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
chameleon.cpp:12:16: error: expected primary-expression before 'int'
   12 |         vector<int>p;
      |                ^~~
chameleon.cpp:13:9: error: 'p' was not declared in this scope
   13 |         p.push_back(i);
      |         ^
chameleon.cpp:15:24: error: 'answer' was not declared in this scope; did you mean 'Answer'?
   15 |         if(Query(p)==1)answer(i,j);
      |                        ^~~~~~
      |                        Answer
chameleon.cpp: At global scope:
chameleon.cpp:5:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    5 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~