Hello everyone,

I'm currently trying to solve problem PIGBANK using dynamic programming in Haskell. However even after optimizing the code even with obscure and efficient Data Types such as Data.ByteString for I/O, I'm still getting TLE. I saw there were several users that have solved the problem in Haskell, so it has to be possible. laughing ¿Could sameone please tell me what the bottleneck could be for this problem? My Java version gets AC even using Scanner, which is very slow. So I really don't know what it could be. If you'd like, I could post my code here.

Thanks in advance!

  • created

    May '11
  • last reply

    May '11
  • 1

    reply

  • 411

    views

  • 1

    user

Hey everyone,

I got AC! The magic was in the order the coins are given to the function and a sort of Branch & Bound-like condition for not evaluating unnecessary cells of the table. Thank you all anyway!

Take care. smile