Submission #548800

#TimeUsernameProblemLanguageResultExecution timeMemory
548800usukhbaatarCity Mapping (NOI18_citymapping)C++14
Compilation error
0 ms0 KiB
#include "citymapping.h" #include <vector> void find_roads(int N, int Q, int A[], int B[], int W[]) { vector<pair<int, pair<int, int>>> e; int xx = 0; for (int i = 1; i <= N; i++) { for (int j = i + 1; j <= N; j++) { int temp = get_distance(i, j); if (temp == 1) { A[xx] = i; B[xx] = j; W[xx] = 1; xx++; } } } return; }

Compilation message (stderr)

citymapping.cpp: In function 'void find_roads(int, int, int*, int*, int*)':
citymapping.cpp:6:2: error: 'vector' was not declared in this scope; did you mean 'std::vector'?
    6 |  vector<pair<int, pair<int, int>>> e;
      |  ^~~~~~
      |  std::vector
In file included from /usr/include/c++/10/vector:67,
                 from citymapping.cpp:2:
/usr/include/c++/10/bits/stl_vector.h:389:11: note: 'std::vector' declared here
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
citymapping.cpp:6:9: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    6 |  vector<pair<int, pair<int, int>>> e;
      |         ^~~~
      |         std::pair
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/vector:60,
                 from citymapping.cpp:2:
/usr/include/c++/10/bits/stl_pair.h:211:12: note: 'std::pair' declared here
  211 |     struct pair
      |            ^~~~
citymapping.cpp:6:14: error: expected primary-expression before 'int'
    6 |  vector<pair<int, pair<int, int>>> e;
      |              ^~~