Codeforces Round #427 (Div. 2), problem: (F) Roads in the Kingdom Solution In C/C++

By |2017-08-05T21:46:16+00:00August 5th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , |

#include <bits/stdc++.h> using namespace std; int n; int to[500000], pre[500000], cost[500000], last[250000], en; long long wxs; void addedge(int f, int t, int w) { to[++en] = t; cost[en] = w; pre[en] = last[f]; last[f] = en; } int Stack[250000], vis[250000], top; int ring[250000], rs; [...]