Approach hintTry it first, then revealHide
If the directed edges alone contain a cycle, no orientation helps. Otherwise take a topological order of the directed part and point every undirected edge from the earlier vertex to the later one.
If the directed edges alone contain a cycle, no orientation helps. Otherwise take a topological order of the directed part and point every undirected edge from the earlier vertex to the later one.