UVa 10806 - Dijkstra, Dijkstra.
/* Accepted Handle conditions properly and try to make optimize Dijkstra to avoid TLE At first, I have run Dijkstra to find the minimum time is taken by first friend. Then, mark parent and child so that second friend can't visit those nodes. And finally, again run Dijkstra to find minimum time for the second friend if possible. Answer should be summation of both times. */ #include<bits/stdc++.h> using namespace std; #define sf scanf #define pf printf #define fast ios_base::sync_with_stdio(false) typedef long long LL; const int high = 110; const int inf = (1<<31)-1; struct data { int node, cost; data(){ } data(int n, int c) { node = n; cost = c; } ...