Submission #741592

# Submission time Handle Problem Language Result Execution time Memory
741592 2023-05-14T12:41:23 Z MODDI Dreaming (IOI13_dreaming) C++14
Compilation error
0 ms 0 KB
#include "dreaming.h"
#include <bits/stdc++.>
using namespace std;
vector<pair<int,long long> > G[100100];
bool vis[100100];
long long distance[100100][2];
int center = -1, path = -1;
set<pair<int,long long> > c;
pair<int, long long > dfs(int at, long long dist, int id){
	pair<int, long long> rez = make_pair(at, dist);
	distance[at][id] = dist;
	if(path != -1){
		if(distance[at][0] + dist == path){
			c.insert(make_pair(at, max(distance[at][0], dist)));
		}
	}
	for(auto next : G[at]){
		if(!vis[next.first]){
			pair<int, long long> cur = dfs(next.first, dist + next.second, id);
			if(cur.second > rez.second){
				rez = cur;
			}
		}
	}
	return rez;
}
int travelTime(int N, int M, int L, int A[], int B[], int T[]) {
    memset(vis, false, sizeof vis);
    for(int i = 0; i < M; i++){
    	G[A[i]].pb(mp(B[i], T[i]));
    	G[B[i]].pb(mp(A[i], T[i]));
	}
	vector<pair<int, long long> > arr;
    for(int i = 0; i < N; i++){
    	if(vis[i])	continue;
    	else{
    		c.clear();
    		pair<int, long long> a = dfs(0, 0);
    		pair<int, long long> b = dfs(a.first, 0); // a i b kraevi na diameter
    		path = b.second;
    		pair<int, long long> s = dfs(a.first, 0);
    		arr.pb(*c.begin());
		}
	}
	sort(arr.rbegin(), arr.rend());
	int ans = arr[0].second + arr[1].second + L;
	return ans;
}

Compilation message

dreaming.cpp:2:10: fatal error: bits/stdc++.: No such file or directory
    2 | #include <bits/stdc++.>
      |          ^~~~~~~~~~~~~~
compilation terminated.