|
|
вернуться в форумLOL I solved but don't know how.. sol.push_back(ceil((double)n/2)) (sol is vector in c++) If you solved it using such code, please explain why it works. Re: LOL I solved but don't know how.. Basically, it's a greedy algorithm: the maximum length you can fold is CURRENT_LENGTH / 2. So, you just fold it in half until it's of length 1. |
|
|