Hello CodeForces ,, this Problem in SPOJ (EDIST) I've solved it using dynamic programming "Recursion Method" but actually it gives me RTE in Java
The same algorithm Using C++ syntax gives me Accepted
Can You Please Explain How is That Happens? and How to Avoid Such Problem if it Face me in Future ?
Auto comment: topic has been updated by _12345_ (previous revision, new revision, compare).
Use c++ to avoid this.
this is not an answer for my question ! I want a solution that doesn't required changing programming language ! thanks
Well, Java is just slower than C++ and there is nothing you can do about it. I guess you can try optimizing your Java code by doing things like using BufferedReader vs. using Scanner. It is just that SPOJ is very strict with time limits that it becomes harder to pass with Java solutions rather than C++ solutions.
But he says he's getting RTE, not TLE. Isn't it just some problem with stack size?
My fault. I misread and thought it said TLE.