Codeforces Round #392 (Div. 2), problem: (E) Broken Tree Solution in C/C++

By |2017-04-07T22:10:18+00:00January 20th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , |

#include <bits/stdc++.h> #define mk make_pair using namespace std; typedef long long ll; const int N=1e6+5; struct edge { int x,y,w,p; edge(){} void input() { scanf("%d%d%d%d",&x,&y,&w,&p); } }E[N],EE[N]; int n; vector<int> G[N]; ll W[N],WW[N]; void dfs(int x,int y,int id,int mi) { if(id) { int tmp=EE[id].p-E[id].p; [...]