답안 #234021

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
234021 2020-05-22T20:48:11 Z tleontest1 꿈 (IOI13_dreaming) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long lo;
typedef pair< lo,lo > PII;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(int i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)

const lo MAX = -1000000000000000000;
const lo MIN = 1000000000000000000;
const lo inf = 1000000000000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 500005;
const lo mod = 1000000007;

lo k,flag,mx[li],maxi;
lo cev;
string s;
int n,m,l,a[li],b[li],t[li];
bool ok[li];
vector<PII> v[li];

inline void dfs(lo node,lo ata,lo der,lo basla){
	for(lo i=0;i<(lo)v[node].size();i++){
		lo go=v[node][i].fi;
		lo co=v[node][i].se;
		if(go==ata)continue;
		dfs(go,node,der+co,basla);
	}
	if(basla==1)ok[node]=1;
	mx[basla]=max(mx[basla],der);
	maxi=max(maxi,mx[basla]);
}

int travelTime(int N, int M, int L, int A[], int B[], int T[]) {
	for(int i=1;i<=m;i++){
		v[A[i]].pb(mp(B[i],T[i]));
		v[B[i]].pb(mp(A[i],T[i]));
	}
	FOR dfs(i,0,0,i);
	lo mn=inf,mn1=inf;
	FOR{
		if(ok[i])mn=min(mn,mx[i]);
		else mn1=min(mn1,mx[i]);
	}
    return (int)max(maxi,mn+mn1+L);
}

Compilation message

/tmp/ccpiLLq5.o: In function `main':
grader.c:(.text.startup+0xa2): undefined reference to `travelTime'
collect2: error: ld returned 1 exit status