You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The if statement on Line 76 is run as many times as there are edges in the graph. This is because u will be the start node of an edge, v will be the end node, and no edge will be counted twice (in this question, the graph is directed). So, the two for-loops have $O(\max(N, M))$ time complexity.
CSES-Solutions/Graph Algorithms/Giant Pizza.cpp
Line 74 in 3d17634
It seems to me that these 2 loops can possibly run in O(n*m). I know that it can't be the case, bc of limit, what's the complexity of those?
The text was updated successfully, but these errors were encountered: