Submission #300248

#TimeUsernameProblemLanguageResultExecution timeMemory
300248easruiConnecting Supertrees (IOI20_supertrees)C++14
Compilation error
0 ms0 KiB
#include "supertrees.h" int construct(std::vector<std::vector<int>> p) { int n = p.size(); vector<vector<int>> ans(n); for(int i=0; i<n; i++){ for(int j=0; j<n; j++){ ans[i].push_back(i==j+1||i==j-1); } } build(ans); return 1; }

Compilation message (stderr)

supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:5:2: error: 'vector' was not declared in this scope; did you mean 'std::vector'?
    5 |  vector<vector<int>> ans(n);
      |  ^~~~~~
      |  std::vector
In file included from /usr/include/c++/9/vector:67,
                 from supertrees.h:1,
                 from supertrees.cpp:1:
/usr/include/c++/9/bits/stl_vector.h:386:11: note: 'std::vector' declared here
  386 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
supertrees.cpp:5:16: error: expected primary-expression before 'int'
    5 |  vector<vector<int>> ans(n);
      |                ^~~
supertrees.cpp:8:4: error: 'ans' was not declared in this scope
    8 |    ans[i].push_back(i==j+1||i==j-1);
      |    ^~~
supertrees.cpp:11:8: error: 'ans' was not declared in this scope
   11 |  build(ans);
      |        ^~~