Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя codexile

Автор codexile, 10 лет назад, По-английски

Please consider the following 3 submissions:

The same code has been executed with Java 6->7->8 compilers. Outcome is:

  • 702 ms (Java 6);
  • 1000 ms TLE (Java 7);
  • 998 ms (Java 8).

I assume that the issue is in 32-bit and 64-bit based compilers. I guess that CodeForces uses 32-bit one for the Java 6 only.

So I've been more than surprised (it's not like 850ms vs 900ms — it's 30% faster!). I'd like to get some explanations from the community on this matter. I can also see that many people here use Java 7 or higher. So what's the reason behind this (having the problem from above?)

Maybe this solution was just specific (e.g. memory usage and stuff) or kinda buggy? Or we can see such performance degradation on every submission?

Anyway, let it be at least a friendly reminder for all Java-users to think twice, before pressing the "Sumbit" button.

  • Проголосовать: нравится
  • +28
  • Проголосовать: не нравится

»
10 лет назад, # |
Rev. 2   Проголосовать: нравится +7 Проголосовать: не нравится

I submitted the same code twice (Java 6/8) just now, and got a kind of different result from yours.

http://codeforces.me/contest/408/submission/6397501 http://codeforces.me/contest/408/submission/6397506

Java 6 : 109 ms Java 8 : 217 ms

It's interesting to know though.

I'll consider using different version of Java when I got TLE for the solution I'm really sure about.