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 1716. Alternative Solution

I do not know how to solve it in C++.
Posted by Martin 15 Mar 2010 10:30
No matter when I used double or long double, my code still got TLE.

Opt[Now][j][0] = Opt[Pre][j][0] + Opt[Pre][j][1] + Opt[Pre][j][3];
Opt[Now][j][1] = Opt[Pre][j - 1][0] + Opt[Pre][j - 1][2] + Opt[Pre][j - 1][1];
Opt[Now][j][2] = Opt[Pre][j][2] + Opt[Pre][j][3];
Opt[Now][j][3] = Opt[Pre][j - 1][2] + Opt[Pre][j - 1][3];

I had to write a Pascal code using extended and got AC.
Could anyone tell me how to AC in C++?
Re: I do not know how to solve it in C++.
Posted by Alex Danilyuk [SESC USU Dandelion] 13 Feb 2013 18:06
I know solution which can be written on all allowable languages.
I suppose, this solution won't get TLE. Becouse it is O(1).
Re: I do not know how to solve it in C++.
Posted by Alex Danilyuk [SESC USU Dandelion] 13 Feb 2013 18:06
I know solution which can be written on all allowable languages.
I suppose, this solution won't get TLE. Becouse it is O(1).