I've got TLE with DP, complexity O(n^3), in the reality n^3 * 9!
Can somebody explain a better solution?
Some hint, please!
970 - Particles
Moderator: Board moderators
970 - Particles
http://acm.uva.es/problemset/usersnew.php?user=47903
All men are like grass,and all their
glory is like the flowers of the field;
the grass withers and the flowers fall,
but the word of the Lord stands forever.
[1 Peter 1:24-25]
All men are like grass,and all their
glory is like the flowers of the field;
the grass withers and the flowers fall,
but the word of the Lord stands forever.
[1 Peter 1:24-25]
Thanks, i got AC now! 

http://acm.uva.es/problemset/usersnew.php?user=47903
All men are like grass,and all their
glory is like the flowers of the field;
the grass withers and the flowers fall,
but the word of the Lord stands forever.
[1 Peter 1:24-25]
All men are like grass,and all their
glory is like the flowers of the field;
the grass withers and the flowers fall,
but the word of the Lord stands forever.
[1 Peter 1:24-25]
strict time limit..
I think the time limit for this problem is too strict.
I got several TLEs before making some minor changes and managed to get AC. The changes that I made weren't that significant that would cause the time taken to come down drastically.
Changes included stuffs like converting int array to bool array and similar things like that.
I got several TLEs before making some minor changes and managed to get AC. The changes that I made weren't that significant that would cause the time taken to come down drastically.
Changes included stuffs like converting int array to bool array and similar things like that.