# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
383895 | MODDI | Traffic (IOI10_traffic) | C++14 | 1377 ms | 156208 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 "traffic.h"
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define mp make_pair
#define pb push_back
using namespace std;
vi G[1000000], sum, arr;
bool vis[1000000];
static int N,P[1000000],S[1000000],D[1000000];
void dfs(int node){
vis[node] = true;
int cur = arr[node];
for(auto next : G[node]){
if(!vis[next]){
dfs(next);
cur += sum[next];
}
}
sum[node] = cur;
}
int LocateCentre(int N, int pp[], int S[], int D[]) {
for(int i = 0; i < N - 1; i++)
{
G[S[i]].pb(D[i]);
G[D[i]].pb(S[i]);
Compilation message (stderr)
# | 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... |