Submission #1069557

#TimeUsernameProblemLanguageResultExecution timeMemory
1069557Faisal_SaqibLongest Trip (IOI23_longesttrip)C++17
Compilation error
0 ms0 KiB
#include <vector> std::vector<int> longest_trip(int n, int D) { if(D==3) { vector<int> ans; for(int i=0;i<n;i++) ans.push_back(i); return ans; } else { } } bool are_connected(std::vector<int> A, std::vector<int> B);

Compilation message (stderr)

longesttrip.cpp: In function 'std::vector<int> longest_trip(int, int)':
longesttrip.cpp:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> ans;
      |   ^~~~~~
longesttrip.cpp:7:3: note: suggested alternatives:
In file included from /usr/include/c++/10/vector:67,
                 from longesttrip.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 longesttrip.cpp:1:
/usr/include/c++/10/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
longesttrip.cpp:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> ans;
      |          ^~~
longesttrip.cpp:9:4: error: 'ans' was not declared in this scope
    9 |    ans.push_back(i);
      |    ^~~
longesttrip.cpp:10:10: error: 'ans' was not declared in this scope
   10 |   return ans;
      |          ^~~