Cod sursa(job #2769821)
| Utilizator | Data | 17 august 2021 21:29:14 | |
|---|---|---|---|
| Problema | A+B | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.57 kb |
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
ifstream f("tricolor.in");
ofstream g("tricolor.out");
const int maxn = 5005;
int n;
vector <int> v[maxn];
void test() {
int i, x, y;
for(i = 1; i <= n; i ++)
v[i].clear();
f >> n;
for(i = 1; i < n; i ++) {
f >> x >> y;
v[x].push_back(y);
v[y].push_back(x);
}
}
int main()
{
int t;
f >> t;
while(t --) {
test();
}
f.close(); g.close();
return 0;
}
