MCPcopy Create free account
hub / github.com/algorithmzuo/algorithm-journey / main

Method main

src/class191/Code05_EBCC1.java:149–177  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

147 }
148
149 public static void main(String[] args) throws Exception {
150 FastReader in = new FastReader(System.in);
151 PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
152 cntg = 1;
153 n = in.nextInt();
154 m = in.nextInt();
155 for (int i = 1, u, v; i <= m; i++) {
156 u = in.nextInt();
157 v = in.nextInt();
158 addEdge(u, v);
159 addEdge(v, u);
160 }
161 for (int i = 1; i <= n; i++) {
162 if (dfn[i] == 0) {
163 // tarjan1(i, 0);
164 tarjan2(i, 0);
165 }
166 }
167 out.println(ebccCnt);
168 for (int i = 1; i <= ebccCnt; i++) {
169 out.println(ebccSiz[i]);
170 for (int j = ebccl[i]; j <= ebccr[i]; j++) {
171 out.print(ebccArr[j] + " ");
172 }
173 out.println();
174 }
175 out.flush();
176 out.close();
177 }
178
179 // 读写工具类
180 static class FastReader {

Callers

nothing calls this directly

Calls 7

nextIntMethod · 0.95
addEdgeMethod · 0.95
tarjan2Method · 0.95
printlnMethod · 0.45
printMethod · 0.45
flushMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected