Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/atcoder/ac-library
/ same
Method
same
atcoder/dsu.hpp:30–34 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
28
}
29
30
bool same(int a, int b) {
31
assert(0 <= a && a < _n);
32
assert(0 <= b && b < _n);
33
return leader(a) == leader(b);
34
}
35
36
int leader(int a) {
37
assert(0 <= a && a < _n);
Callers
5
main
Function · 0.80
TEST
Function · 0.80
main
Function · 0.80
main
Function · 0.80
main
Function · 0.80
Calls
no outgoing calls
Tested by
1
TEST
Function · 0.64