SPOJ-TOPOSORT — getting WA

Правка en1, от vohrab1896, 2020-08-28 15:34:58

Hi all

I am getting WA in SPOJ-TOPOSORT. I solved it using Kahn's Algorithm but getting WA. To get smallest value on second place I am picking up smallest value from the child nodes of the node present at the front of queue and then comparing it's value to other value present in the front of queue. This is the link- [https://ideone.com/Yur2cr]. I have given a lot of time to find the wrong test case but failed. If anyone is able to solve this then please let me know.

Thanks

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский vohrab1896 2020-08-28 15:34:58 511 Initial revision (published)