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 1495. One-two, One-two 2

Some hints,look this after you have thought this problem by yourself.
Posted by pyh119 5 Jul 2011 19:05
1.Use a DP with the O(30N) time
2.Use ternary (long long in C++ is needed) to indicate each solution
3.Use a rolling array in case it MLEs

Good luck! ~_~

Edited by author 05.07.2011 19:05
Re: Some hints,look this after you have thought this problem by yourself.
Posted by Tranvick 14 Dec 2011 20:51
Meet-in-the-middle is easier, I think. I have solved using both methods, it's faster and shorter.
Re: Some hints,look this after you have thought this problem by yourself.
Posted by Grandmaster 13 May 2017 20:21
no need for longlong