# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1125633 | Kerim | Pipes (BOI13_pipes) | C++20 | 52 ms | 12304 KiB |
#include "bits/stdc++.h"
#define ff first
#define ss second
#define ll long long
using namespace std;
const int N = 1e5+5;
vector<pair<int,int> > adj[N];
pair<int, int> par[N];
vector<int> order;
ll a[N], ans[N];
void dfs(int nd, int pr){
for (auto [to, ind]: adj[nd]){
if (to == pr)
continue;
par[to] = {nd, ind};
dfs(to, nd);
}
order.push_back(nd);
}
int main(){
// freopen("file.in", "r", stdin);
int n, m;
scanf("%d%d", &n, &m);
assert(m == n-1);
for (int i = 1; i <= n; i++)
scanf("%lld", a+i);
for (int i = 1; i <= m; i++){
int u, v;
scanf("%d%d", &u, &v);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |