답안 #108808

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
108808 2019-05-02T08:17:25 Z tictaccat 항공 노선도 (JOI18_airline) C++14
컴파일 오류
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/ccXvEUU4.o: In function `main':
grader_alice.cpp:(.text.startup+0xe0): undefined reference to `Alice(int, int, int*, int*)'
/tmp/cc4ik2Bj.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/cctiXbAF.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