Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

Codeforces -— 510 C -— Foxes and Names.
Difference between en1 and en2, changed 4 character(s)
  Hello,↵
↵
  ↵
  I was trying this problem [problem:510C], basically it asks us to do a topological sort on a DAG. I used a modified↵
      ↵
  DFS to do that — [submission:11664540].↵
↵
  I do a DFS to check for a cycle, then I do a topological sort on the DAG if there are no cycles. But I was getting ↵
↵
  WA 12th case. I tried reading others' solutions but couldn't find what was wrong with my code. I then used an O(V^2) ↵
↵
  topological sort and it passed. Can someone point my mistake. Thanks , Help much appreciated :)

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English sidchelseafan 2015-06-19 12:45:26 4 (published)
en1 English sidchelseafan 2015-06-19 12:45:00 572 Initial revision (saved to drafts)