|
|
вернуться в форумFor people, who have TLE. If you are using recursion function to calc the answer, then I suggest you to do it in one of some ways: 1) To write DP without using recursion. 2) To use array of memory and put there -1 if we calced the function of this parametres and 0 if not. 3) if you write in C++, inline may be will help you. If you have any questions, write. Edited by author 19.11.2010 01:08 Can you give me your code? :) Edited by author 19.11.2010 12:02 Re: Can you give me your code? Well, give me your mail Re: Can you give me your code? And me too - I want to see how to use recursion in this problem =))) goryinyich [dog] inbox [dot] ru Re: Can you give me your code? Thank you!(otajanov_quvondiq@mail.ru.) Re: Can you give me your code? Check your mail. Re: For people, who have TLE. scanf printf also helps Re: For people, who have TLE. Послано Kirino 22 июн 2015 10:47 Only for reading & outputting one integer? Re: For people, who have TLE. Послано Egor 1 дек 2016 23:43 You can precalculate all the 81 values locally (it could take up 1 minute). Then use all the values to create static array: int ways[82] = { 0, 10, 45, 165, ..., 9, 1 }; int main() { int sum; cin >> sum; cout << ways[sum]; }
Edited by author 01.12.2016 23:44 |
|
|