Algorithm Designa67_q3a_disjoint_set_check
Disjoint Set Check
402a8780-32ba-4617-a389-b11c6563974e.cppC++
1// Loading code...Selected Submission
100 / 100
0.171s
5272 KB
GraphImplementation
Time Comp.
O(Q * (N + Q * ?(N)))
Space Comp.
O(N)
Readability
7/10
"The code implements the Disjoint Set Union (DSU) data structure to detect cycles and find the size of connected components. The core logic revolves around the `find` and `unite` operations, which are fundamental to DSU, making 'Graph' and 'Implementation' the most appropriate tags."
History
| Attempt | Points | Time ↓ |
|---|---|---|
| Try #17 | 100 | 5/1/2025 |
| Try #16 | 0 | 5/1/2025 |
| Try #15 | 95 | 5/1/2025 |
| Try #14 | 95 | 4/4/2025 |
| Try #13 | 90 | 4/2/2025 |
| Try #12 | 95 | 4/2/2025 |
| Try #11 | 95 | 4/2/2025 |
| Try #10 | 95 | 4/2/2025 |
| Try #9 | 100 | 4/2/2025 |
| Try #8 | 10 | 4/2/2025 |
| Try #7 | 90 | 4/2/2025 |
| Try #6 | 95 | 4/2/2025 |
| Try #5 | 90 | 4/2/2025 |
| Try #4 | 0 | 4/2/2025 |
| Try #3 | 65 | 4/2/2025 |
| Try #2 | 65 | 4/2/2025 |
| Try #1 | 0 | 4/2/2025 |