3 / 3
May 2018

ARDA1 problem - http://www.spoj.com/problems/ARDA1/7

Implemented O(N1N2 + M1M2) solution in JAVA, passes all my local tests with very large data sets, here it says ‘time limit exceeded’. There is no faster solution than O(N1N2 + M1M2). Also, haven’t seen any java solution that has been accepted for this problem. Can authors/admins check acceptance criteria for JAVA submissions ?

  • created

    May '18
  • last reply

    May '18
  • 2

    replies

  • 996

    views

  • 2

    users

  • 1

    like

  • 1

    link

Unfortunately it is possible this problem is unsolvable in Java. Time limits are language independent so nobody can check and possibly change acceptance criteria just for Java.

That is unfortunate, indeed, since the JVM would have a bit more overhead at startup. BTW, I translated my Java solution in C++, submitted it and got accepted with a 0.02 sec runtime. For the same solution in Java I get TLE, which proves that SPOJ has room for improvement here to allow java devs use this platform too. SPOJ may improve this by benchmarking properly, and therefore, begin measuring the execution time when the JVM has started and is about to execute the code. Regardless of the approach, there are many solutions to let Java devs be accepted on SPOJ platform. I’d appreciate it very much if I could use Java here.