Submission #108804

# Submission time Handle Problem Language Result Execution time Memory
108804 2019-05-02T08:13:03 Z tictaccat Airline Route Map (JOI18_airline) C++11
Compilation error
0 ms 0 KB
#include "Boblib.h"
#include <cassert>
#include <cstdio>
#include <bits/stdc++.h>

using namespace std;

void Bob( int V, int U, int C[], int D[] ){

	vector<vector<int>> adj(V);

	for (int i = 0; i < U; i++) {
		adj[C[i]].push_back(D[i]);
		adj[D[i]].push_back(C[i]);
	}

	int spec = max_element(adj.begin(),adj.end(),[](vector<int> &a, vector<int> &b){return a.size() < b.size();}) - adj.begin();

	vector<bool> special(V,false);

	for (int i: adj[spec]) {
		special[i] = true;
	}

	vector<int> actual(V,-1);

	int N = 0;

	for (int i = 0; i < V; i++) {
		if (i == spec) continue;
		int c = 0;
		for (int j: adj[i]) {
			if (special[j]) c++;
		}
		if (c > 0) {
			actual[i] = c-1;
			N++;
		}
	}

//	cout << N << "\n";

	vector<pair<int,int>> el;

	for (int i = 0; i < U; i++) {
		if (actual[C[i]] != -1 && actual[D[i]] != -1) {
			el.push_back(make_pair(actual[C[i]],actual[D[i]]));
		}
	}

	InitMap(N,el.size());

	for (auto p: el) {
		MakeMap(p.first,p.second);
	}

	// InitMap( 3, 2 );
	// MakeMap( 1, 2 );
	// MakeMap( 1, 3 );
}




    

Compilation message

/tmp/ccisI60N.o: In function `main':
grader_alice.cpp:(.text.startup+0xe0): undefined reference to `Alice(int, int, int*, int*)'
/tmp/ccG56Unr.o: In function `Bob(int, int, int*, int*)':
Alice.cpp:(.text+0x40e): undefined reference to `InitMap(int, int)'
Alice.cpp:(.text+0x42e): undefined reference to `MakeMap(int, int)'
collect2: error: ld returned 1 exit status

/tmp/ccxDFATw.o: In function `main':
grader_bob.cpp:(.text.startup+0xd0): undefined reference to `Bob(int, int, int*, int*)'
collect2: error: ld returned 1 exit status