ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1450. Russian Pipelines

Isn't it just a wave?
Posted by The Ninjas Walk Alone!!!! 26 Sep 2006 18:20
Why i have WA11? I use a wave algo with a queue and edgecency matrix. But there is no mistake. When I wrote a O(m*n) algo it TLE'd on test #16.
Re: Isn't it just a wave?
Posted by Anton juver++ Postnikov 26 Sep 2006 18:34
Your algo is wrong!
Use topological sort for solve this problem.
Re: Isn't it just a wave?
Posted by Anton juver++ Postnikov 26 Sep 2006 18:35
Your algo is wrong!
Use topological sort to solve this problem.
Re: Isn't it just a wave?
Posted by Eldar Bogdanov 27 Sep 2006 21:36
>> Your algo is wrong!
>> Use topological sort to solve this problem

There is no need in topological sort for this problem, I've got AC with just a simple wave.