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 1379. Cups Transportation

why TLE using bfs
Posted by rushel 12 Sep 2005 09:30
I use bfs where a state is defined by node and time. Is my
approach is wrong? please help me.
Re: why TLE using bfs
Posted by Palevich 12 Sep 2005 15:51
???

Edited by author 12.09.2005 15:55
Re: why TLE using bfs
Posted by wwwwww 14 Sep 2005 22:40
Time is integer in 0..1440,
We have about 500^2 edges,
So 1440*500*500 ~ 4*10^8 (it's of course too big time :)
And you think it can get not TLE?

Try to invent faster algorithm.
BFS is possible (+)
Posted by Orfest 6 Jun 2009 10:25
BFS is possible if you enhance it doing several tricks.
My AC is 0.265 sec, 5421KB, 85 LOC
Re: BFS is possible (+)
Posted by Avitella 30 May 2012 01:42
I think you mean Ford-Bellman with queue. 0.625 AC. But i have many operations with vectors resize. I think this solve can work faster.

Edited by author 30.05.2012 01:53