MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / test_12

Function test_12

code/graph/scc.test.cpp:235–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235void test_12() {
236 vvi adj(4);
237
238 adj[0].push_back(2);
239 adj[1].push_back(3);
240 adj[2].push_back(0);
241 adj[2].push_back(1);
242 adj[3].push_back(0);
243 adj[3].push_back(1);
244
245 // adj[0].push_back(1);
246 // adj[0].push_back(2);
247 // adj[1].push_back(2);
248 // adj[2].push_back(1);
249 // adj[2].push_back(3);
250 // adj[3].push_back(0);
251
252 pair<union_find, vi> res = scc(adj);
253 union_find scc = res.first;
254 vi dag = res.second;
255
256 assert_equal(scc.find(0), scc.find(1));
257 assert_equal(scc.find(0), scc.find(2));
258 assert_equal(scc.find(0), scc.find(3));
259}
260
261void test() {
262 test_1();

Callers 1

testFunction · 0.85

Calls 4

sccFunction · 0.85
push_backMethod · 0.80
assert_equalFunction · 0.50
findMethod · 0.45

Tested by

no test coverage detected