Submission #345550

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3455502021-01-07 14:48:5879brue꿈 (IOI13_dreaming)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, m, k;
vector<pair<int, int> > link[100002];
int DP[100002], DP2[100002];
bool visited[100002];
int ans;
int minVal;
vector<int> vec;
void dfs(int x){
visited[x] = 1;
for(auto y: link[x]){
if(visited[y.first]) continue;
dfs(y.first);
int tmp1 = DP[y.first] + y.second;
int tmp2 = DP2[y.first] + y.second;
if(DP2[x] < tmp1) DP2[x] = tmp1;
if(DP2[x] > DP[x]) swap(DP[x], DP2[x]);
if(DP2[x] < tmp2) DP2[x] = tmp2;
}
if(DP[x] < 0) DP[x] = 0;
ans = max(ans, DP[x] + DP2[x]);
visited[x] = 0;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

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