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 1353. Milliard Vasya's Function

Dima_Philippov For people, who have TLE. [8] // Problem 1353. Milliard Vasya's Function 19 Nov 2010 01:08
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
Enigma [UB of TUIT] Can you give me your code? [4] // Problem 1353. Milliard Vasya's Function 19 Nov 2010 12:00
:)

Edited by author 19.11.2010 12:02
Dima_Philippov Re: Can you give me your code? [3] // Problem 1353. Milliard Vasya's Function 19 Nov 2010 21:55
Well, give me your mail
Vedernikoff 'Goryinyich' Sergey (HSE: АОП) Re: Can you give me your code? // Problem 1353. Milliard Vasya's Function 20 Nov 2010 01:35
And me too - I want to see how to use recursion in this problem =)))

goryinyich [dog] inbox [dot] ru
Enigma [UB of TUIT] Re: Can you give me your code? [1] // Problem 1353. Milliard Vasya's Function 20 Nov 2010 14:28
Thank you!(otajanov_quvondiq@mail.ru.)
Dima_Philippov Re: Can you give me your code? // Problem 1353. Milliard Vasya's Function 22 Nov 2010 18:37
Check your mail.
Poochi Rang Re: For people, who have TLE. [2] // Problem 1353. Milliard Vasya's Function 13 Dec 2011 10:48
scanf printf also helps
Kirino Re: For people, who have TLE. [1] // Problem 1353. Milliard Vasya's Function 22 Jun 2015 10:47
Only for reading & outputting one integer?
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