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 <bits/stdc++.h>
#define forr(_a,_b,_c) for(_a = (_b); _a <= (_c); ++_a)
#define ford(_a,_b,_c) for(_a = (_b) + 1; _a --> (_c);)
#define forf(_a,_b,_c) for(_a = (_b); _a < (_c); ++_a)
#define st first
#define nd second
#define ll long long
#define ull unsigned long long
#define pii pair <int,int>
#define pll pair <ll,ll>
#define piii pair <int,pii>
#define vi vector <int>
#define pb push_back
#define mp make_pair
#define all(x) begin(x),end(x)
#define file "test"
using namespace std;
const int N = 2e5 + 5;
const ll oo = 1e9;
const ll mod = 1e9 + 7;
deque <ll> s[N];
vector <pll> a[N];
ll ans, h[N], f[N];
ll k;
void dfs (int u, int p){
}
int n,i,u,v,w;
int best_path (int nn, int kk, int edge[][2], int ww[]){
ans = oo;
n = nn;
k = kk;
if (k == 1)
return 0;
forf (i,0,n - 1){
u = edge[i][0];
v = edge[i][v];
w = ww[i];
a[u].pb({v,w});
a[v].pb({u,w});
}
dfs(0,0);
ans--;
return ((ans <= (n - 1)) ? ans : -1);
}
# | 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... |