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 1325. Dirt

I solved it in one BFS
Posted by ძამაანთ [Tbilisi SU] 20 Apr 2014 04:02
But still AC in 0.171s :D
even with super many optimizations (like not reading matrix, thus reading when needed; putting x's and y's in one integer and so on)

come on :D
slower than 2 BFS
and even slower than dijkstra : \\

I suspect that I heavily use deque is the main reason. How can I replace deque with some other decent data structure that will let me quickly add and remove items?

list<> in STL is dumbly slow for little objects ( dafaq who would have thought ?! )