# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1014339 | lalig777 | Traffic (IOI10_traffic) | C++14 | 305 ms | 178580 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int ll;
const int MAXN=1e5+5;
struct diam{
long long int max1=0;
long long int max2=0;
};
vector<vector<int>> listaAdy;
vector<diam>dp;
int n;
ll res=1e18;
int answer=-1;
void dfs1(int nodo, int padre, int P[]){
for(int v: listaAdy[nodo]){
if (v==padre) continue;
dfs1(v, nodo, P);
if (dp[nodo].max1<dp[v].max1){
dp[nodo].max2=dp[nodo].max1;
dp[nodo].max1=dp[v].max1;
}else if (dp[nodo].max2<dp[v].max1){
dp[nodo].max2=dp[v].max1;
}
}dp[nodo].max1+=P[nodo];
dp[nodo].max2+=P[nodo];
return;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |