# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
394610 | Mahdi_Shokoufi | Network (BOI15_net) | C++17 | 495 ms | 58892 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.
//In the name of Allah
#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
vector < int > adj[N], lf;
void DFS(int v, int p = 0){
if (adj[v].size() == 1)
lf.push_back(v);
for (int u : adj[v])
if (u != p)
DFS(u, v);
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n, r = 0;
cin >> n;
for (int i = 1; i < n; i ++){
int u, v;
cin >> u >> v;
adj[u].push_back(v);
adj[v].push_back(u);
}
for (int i = 1; i <= n; i ++)
if (adj[i].size() != 1)
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |