This commit is contained in:
Zengtudor 2024-11-15 12:00:53 +08:00
parent f8a3eb88d8
commit 8e805915d6

23
src/P1352/P1352.cpp Normal file
View File

@ -0,0 +1,23 @@
#include <cstdint>
#include <iostream>
#include <vector>
using std::cin, std::cout;
using ll = int64_t;
const ll max_n = 6e3+5;
ll n, r[max_n];
std::vector<ll> sons[max_n];
int main(){
cin>>n;
for(ll i{1};i<=n;i++){
cin>>r[i];
}
for(ll i{1};i<n;i++){
ll l, k;
cin>>l>>k;
sons[k].emplace_back(l);
}
}