Orienting a Mixed Graph into a single SCC in

Unable to parse markup [type=CF_MATHJAX]

$?

Revision en2, by jencias, 2026-05-25 20:43:22

Hi codeforces! I’m stuck on the constructive part of a graph problem.

Problem: Given a mixed graph (N <= 100000, M <= 200000) with some fixed (directed) edges and some free (undirected) edges. I already used binary search and Tarjan's algorithm to find a state where a solution is guaranteed to exist (i.e., treating free edges as bidirectional yields exactly 1 SCC).How do I constructively assign a single direction to each free edge so the final directed graph remains a single SCC in O(N+M)?

Tags help me

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English jencias 2026-05-25 20:44:23 15
en2 English jencias 2026-05-25 20:43:22 4 (published)
en1 English jencias 2026-05-25 20:41:05 552 Initial revision (saved to drafts)