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

Method main

src/class194/Code07_Policija1.java:160–199  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

158 }
159
160 public static void main(String[] args) throws Exception {
161 FastReader in = new FastReader(System.in);
162 PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
163 n = in.nextInt();
164 m = in.nextInt();
165 cntn = n;
166 cnt1 = 1;
167 for (int i = 1, u, v; i <= m; i++) {
168 u = in.nextInt();
169 v = in.nextInt();
170 addEdge1(u, v);
171 addEdge1(v, u);
172 }
173 tarjan(1, 0);
174 dfs1(1, 0);
175 dfs2(1, 1);
176 q = in.nextInt();
177 for (int i = 1, op, a, b, c, d; i <= q; i++) {
178 op = in.nextInt();
179 if (op == 1) {
180 a = in.nextInt();
181 b = in.nextInt();
182 c = in.nextInt();
183 d = in.nextInt();
184 int cut = getCut(c, d);
185 if (cut == 0) {
186 out.println("yes");
187 } else {
188 out.println(mustPass(a, b, cut) ? "no" : "yes");
189 }
190 } else {
191 a = in.nextInt();
192 b = in.nextInt();
193 c = in.nextInt();
194 out.println(mustPass(a, b, c) ? "no" : "yes");
195 }
196 }
197 out.flush();
198 out.close();
199 }
200
201 // 读写工具类
202 static class FastReader {

Callers

nothing calls this directly

Calls 10

nextIntMethod · 0.95
addEdge1Method · 0.95
tarjanMethod · 0.95
dfs1Method · 0.95
dfs2Method · 0.95
getCutMethod · 0.95
mustPassMethod · 0.95
printlnMethod · 0.45
flushMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected