Submission #548775

# Submission time Handle Problem Language Result Execution time Memory
548775 2022-04-14T11:49:36 Z Mazaalai City Mapping (NOI18_citymapping) C++17
Compilation error
0 ms 0 KB
#include "citymapping.h"

ll get(int a, int b) {
	return get_distance(a, b);
}
void find_roads(int n, int q, int a[], int b[], int w[]) {
	vector <int> dist[n+5];
	int pt = 0;
	for (int i = 2; i <= n; i++) {
		int x = get(1, i);
		if (x == 1) {
			a[pt] = 1, b[pt] = i;
			pt++;
		}
		dist[x].pb(i);
	}
	for (int i = 1; i < n; i++) {
		if (dist[i].size() == 0 || dist[i+1].size() == 0) continue;
		for (auto& el : dist[i])
		for (auto& el1 : dist[i+1]) {
			int x = get(el, el1);
			if (x == 1) {
				a[pt] = el, b[pt] = el1;
				pt++;
			}
		}
	}

	return;
}

Compilation message

citymapping.cpp:3:1: error: 'll' does not name a type
    3 | ll get(int a, int b) {
      | ^~
citymapping.cpp: In function 'void find_roads(int, int, int*, int*, int*)':
citymapping.cpp:7:2: error: 'vector' was not declared in this scope
    7 |  vector <int> dist[n+5];
      |  ^~~~~~
citymapping.cpp:7:10: error: expected primary-expression before 'int'
    7 |  vector <int> dist[n+5];
      |          ^~~
citymapping.cpp:10:11: error: 'get' was not declared in this scope
   10 |   int x = get(1, i);
      |           ^~~
citymapping.cpp:15:3: error: 'dist' was not declared in this scope
   15 |   dist[x].pb(i);
      |   ^~~~
citymapping.cpp:18:7: error: 'dist' was not declared in this scope
   18 |   if (dist[i].size() == 0 || dist[i+1].size() == 0) continue;
      |       ^~~~
citymapping.cpp:19:19: error: 'dist' was not declared in this scope
   19 |   for (auto& el : dist[i])
      |                   ^~~~
citymapping.cpp:21:12: error: 'get' was not declared in this scope
   21 |    int x = get(el, el1);
      |            ^~~