Submission #742223

#TimeUsernameProblemLanguageResultExecution timeMemory
742223MODDIFriend (IOI14_friend)C++14
Compilation error
0 ms0 KiB
#include "friend.h"
#include "grader.cpp"
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define mp make_pair
#define vi vector<int>
using namespace std;
vi G[1300];
int arr[1300], arr1[1300];
bool vis[1300];
int dfs(int node){
	for(auto v : G[node]){
		if(vis[v])	continue;
		vis[v] = 1;
		if(arr[v] == -1 || dfs(arr[v])){
			arr[v] = node;
			return 1;
		}
	}
	return 0;
}
int findSample(int n,int confidence[],int host[],int protocol[]){
	memset(arr, -1, sizeof arr);
	for(int i = 1; i < n; i++){
		if(protocol[i] == 0){
			G[host[i]].pb(i);
			G[i].pb(host[i]);
			arr1[i] = arr1[host[i]] ^1;
		}
		else{
			for(int v : G[host[i]]){
				G[i].pb(v);
				G[v].pb(i);
			}
			arr1[i] = arr1[host[i]];
		}
	}
	int ans = n;
	for(int i = 0; i < n; i++){
		if(arr1[i] == 0){
			memset(vis, false, sizeof vis);
			ans -= dfs(i);
		}
	}
	return ans;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccdKyhYp.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccvf8F1n.o:friend.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccdKyhYp.o:(.bss+0xc3540): multiple definition of `confidence'; /tmp/ccvf8F1n.o:(.bss+0xcdd00): first defined here
/usr/bin/ld: /tmp/ccdKyhYp.o:(.bss+0x0): multiple definition of `protocol'; /tmp/ccvf8F1n.o:(.bss+0xa7c0): first defined here
/usr/bin/ld: /tmp/ccdKyhYp.o:(.bss+0x61aa0): multiple definition of `host'; /tmp/ccvf8F1n.o:(.bss+0x6c260): first defined here
collect2: error: ld returned 1 exit status