#include <iostream>
#include <cstdio>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <ctime>
#include <cstdlib>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#define fi first
#define se second
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
int x3[1000000];
int x2[1000000];
int st1[1000000];
int f[100000];
vector <int> v[1000000];
int h,t=0;
set<int> st;
void check()
{
//for (int i=0; h>i; i++) cout << st[i] << " ";
//cout << endl;
set<int> :: iterator t=st.begin();
//cout << h/2 << endl;
for (int i=0; h/2>i; i++, t++);
x2[*t]++;
}
void dfs(int xx)
{
if (f[xx]==t) return;
st.insert(xx);
st1[h++]=xx;
f[xx]=t;
if (h%2==1) check();
int m1=v[xx].size();
for (int j=0; m1>j; j++) dfs(v[xx][j]);
st.erase(st1[h-1]);
h--;
}
int main()
{
fastio;
srand(time(0));
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int n,a,b,i,j;
cin >> n;
for (i=1; n>i; i++)
{
cin >> a >> b;
v[a].push_back(b);
v[b].push_back(a);
}
for (i=1; n>=i; i++)
{
int n1=v[i].size();
t++;
f[i]=t;
h=0;
st.insert(i);
st1[h++]=i;
for (j=0; n1>j; j++) dfs(v[i][j]);
st.clear();
}
for (i=1; n>=i; i++) cout << x2[i] << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0ZGlvPgojaW5jbHVkZSA8aW9tYW5pcD4KI2luY2x1ZGUgPGNtYXRoPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8Y3RpbWU+CiNpbmNsdWRlIDxjc3RkbGliPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8c3N0cmVhbT4KI2luY2x1ZGUgPG1hcD4KI2luY2x1ZGUgPHNldD4KCiNkZWZpbmUgZmkgZmlyc3QKI2RlZmluZSBzZSBzZWNvbmQKI2RlZmluZSBmYXN0aW8gaW9zX2Jhc2U6OnN5bmNfd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sKICAgICAgICB2W2JdLnB1c2hfYmFjayhhKTsKICAgIH0KCiAgICBmb3IgKGk9MTsgbj49aTsgaSsrKQogICAgewogICAgICAgIGludCBuMT12W2ldLnNpemUoKTsKICAgICAgICB0Kys7CiAgICAgICAgZltpXT10OwogICAgICAgIGg9MDsKICAgICAgICBzdC5pbnNlcnQoaSk7CiAgICAgICAgc3QxW2grK109aTsKICAgICAgICBmb3IgKGo9MDsgbjE+ajsgaisrKSBkZnModltpXVtqXSk7CiAgICAgICAgc3QuY2xlYXIoKTsKICAgIH0KCiAgICBmb3IgKGk9MTsgbj49aTsgaSsrKSBjb3V0IDw8IHgyW2ldIDw8IGVuZGw7CgogICAgcmV0dXJuIDA7Cn0=
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:1: error: class, interface, or enum expected
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <cstdio>
^
Main.java:3: error: illegal character: '#'
#include <iomanip>
^
Main.java:4: error: illegal character: '#'
#include <cmath>
^
Main.java:5: error: illegal character: '#'
#include <algorithm>
^
Main.java:6: error: illegal character: '#'
#include <ctime>
^
Main.java:7: error: illegal character: '#'
#include <cstdlib>
^
Main.java:8: error: illegal character: '#'
#include <vector>
^
Main.java:9: error: illegal character: '#'
#include <sstream>
^
Main.java:10: error: illegal character: '#'
#include <map>
^
Main.java:11: error: illegal character: '#'
#include <set>
^
Main.java:13: error: illegal character: '#'
#define fi first
^
Main.java:14: error: illegal character: '#'
#define se second
^
Main.java:15: error: illegal character: '#'
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);
^
Main.java:15: error: class, interface, or enum expected
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);
^
Main.java:17: error: class, interface, or enum expected
using namespace std;
^
Main.java:19: error: class, interface, or enum expected
int x3[1000000];
^
Main.java:20: error: class, interface, or enum expected
int x2[1000000];
^
Main.java:21: error: class, interface, or enum expected
int st1[1000000];
^
Main.java:22: error: class, interface, or enum expected
int f[100000];
^
Main.java:24: error: class, interface, or enum expected
vector <int> v[1000000];
^
Main.java:25: error: class, interface, or enum expected
int h,t=0;
^
Main.java:26: error: class, interface, or enum expected
set<int> st;
^
Main.java:28: error: class, interface, or enum expected
void check()
^
Main.java:35: error: class, interface, or enum expected
for (int i=0; h/2>i; i++, t++);
^
Main.java:35: error: class, interface, or enum expected
for (int i=0; h/2>i; i++, t++);
^
Main.java:35: error: class, interface, or enum expected
for (int i=0; h/2>i; i++, t++);
^
Main.java:37: error: class, interface, or enum expected
x2[*t]++;
^
Main.java:38: error: class, interface, or enum expected
}
^
Main.java:43: error: class, interface, or enum expected
st.insert(xx);
^
Main.java:44: error: class, interface, or enum expected
st1[h++]=xx;
^
Main.java:45: error: class, interface, or enum expected
f[xx]=t;
^
Main.java:46: error: class, interface, or enum expected
if (h%2==1) check();
^
Main.java:47: error: class, interface, or enum expected
int m1=v[xx].size();
^
Main.java:48: error: class, interface, or enum expected
for (int j=0; m1>j; j++) dfs(v[xx][j]);
^
Main.java:48: error: class, interface, or enum expected
for (int j=0; m1>j; j++) dfs(v[xx][j]);
^
Main.java:48: error: class, interface, or enum expected
for (int j=0; m1>j; j++) dfs(v[xx][j]);
^
Main.java:49: error: class, interface, or enum expected
st.erase(st1[h-1]);
^
Main.java:50: error: class, interface, or enum expected
h--;
^
Main.java:51: error: class, interface, or enum expected
}
^
Main.java:56: error: class, interface, or enum expected
srand(time(0));
^
Main.java:57: error: class, interface, or enum expected
freopen("input.txt", "r", stdin);
^
Main.java:58: error: class, interface, or enum expected
freopen("output.txt", "w", stdout);
^
Main.java:60: error: class, interface, or enum expected
int n,a,b,i,j;
^
Main.java:62: error: class, interface, or enum expected
cin >> n;
^
Main.java:63: error: class, interface, or enum expected
for (i=1; n>i; i++)
^
Main.java:63: error: class, interface, or enum expected
for (i=1; n>i; i++)
^
Main.java:63: error: class, interface, or enum expected
for (i=1; n>i; i++)
^
Main.java:66: error: class, interface, or enum expected
v[a].push_back(b);
^
Main.java:67: error: class, interface, or enum expected
v[b].push_back(a);
^
Main.java:68: error: class, interface, or enum expected
}
^
Main.java:70: error: class, interface, or enum expected
for (i=1; n>=i; i++)
^
Main.java:70: error: class, interface, or enum expected
for (i=1; n>=i; i++)
^
Main.java:73: error: class, interface, or enum expected
t++;
^
Main.java:74: error: class, interface, or enum expected
f[i]=t;
^
Main.java:75: error: class, interface, or enum expected
h=0;
^
Main.java:76: error: class, interface, or enum expected
st.insert(i);
^
Main.java:77: error: class, interface, or enum expected
st1[h++]=i;
^
Main.java:78: error: class, interface, or enum expected
for (j=0; n1>j; j++) dfs(v[i][j]);
^
Main.java:78: error: class, interface, or enum expected
for (j=0; n1>j; j++) dfs(v[i][j]);
^
Main.java:78: error: class, interface, or enum expected
for (j=0; n1>j; j++) dfs(v[i][j]);
^
Main.java:79: error: class, interface, or enum expected
st.clear();
^
Main.java:80: error: class, interface, or enum expected
}
^
Main.java:82: error: class, interface, or enum expected
for (i=1; n>=i; i++) cout << x2[i] << endl;
^
Main.java:82: error: class, interface, or enum expected
for (i=1; n>=i; i++) cout << x2[i] << endl;
^
Main.java:84: error: class, interface, or enum expected
return 0;
^
Main.java:85: error: class, interface, or enum expected
}
^
68 errors