답안 #548800

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
548800 2022-04-14T12:14:41 Z usukhbaatar City Mapping (NOI18_citymapping) C++14
컴파일 오류
0 ms 0 KB
#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

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;
      |              ^~~