# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
792296 | limabeans | Race (IOI11_race) | C++17 | 0 ms | 0 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 <algorithm>
#include <iostream>
#include <vector>
#include <cassert>
using namespace std;
using ll = long long;
const int maxn=2e5+10;
int n,k;
vector<pair<ll,int>> g[maxn];
int main() {
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
cin>>n>>k;
vector<pair<int,int>> edges;
vector<ll> wei;
for (int i=0; i<n-1; i++) {
int u,v;
cin>>u>>v;
edges.push_back({u,v});
}
for (int i=0; i<n-1; i++) {
ll w;
cin>>w;
wei.push_back(w);
}
for (int i=0; i<n-1; i++) {
int u=edges[i].first;
int v=edges[i].second;
ll w=wei[i];
g[u].push_back({w,v});
g[v].push_back({w,u});
}
cout<<1<<endl;
return 0;
}