| 202 | } |
| 203 | |
| 204 | public static void main(String[] args) throws Exception { |
| 205 | FastReader in = new FastReader(System.in); |
| 206 | PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); |
| 207 | n = in.nextInt(); |
| 208 | m = in.nextInt(); |
| 209 | cntn = n; |
| 210 | for (int i = 1, u, v; i <= m; i++) { |
| 211 | u = in.nextInt(); |
| 212 | v = in.nextInt(); |
| 213 | addEdge1(u, v); |
| 214 | addEdge1(v, u); |
| 215 | } |
| 216 | // tarjan1(1); |
| 217 | tarjan2(1); |
| 218 | // dpOnTree1(1, 0); |
| 219 | dpOnTree2(1, 0); |
| 220 | for (int i = 1; i <= n; i++) { |
| 221 | out.println(ans[i]); |
| 222 | } |
| 223 | out.flush(); |
| 224 | out.close(); |
| 225 | } |
| 226 | |
| 227 | // 读写工具类 |
| 228 | static class FastReader { |