Cod sursa(job #2615017)
| Utilizator | Data | 13 mai 2020 14:45:44 | |
|---|---|---|---|
| Problema | Heavy Path Decomposition | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.52 kb |
#include <fstream>
#include <vector>
using namespace std;
ifstream f("heavypath.in");
ofstream g("heavypath.out");
const int NMAX = 1e5 + 5;
int N, Q, A[NMAX], X, Y;
vector < int > G[NMAX];
static inline void Read ()
{
f.tie(nullptr);
f >> N >> Q;
for(int i = 1; i <= N; ++i)
f >> A[i];
for(int i = 1; i < N; ++i)
{
f >> X >> Y;
G[X].push_back(Y);
G[Y].push_back(X);
}
return;
}
int main()
{
Read();
return 0;
}
