My impression is that as long as you can ignore startup time, Java in general is pretty close to C++ and definitely much faster that Python. I am surprised this would be a problem with Java and not with Python. Did anyone had the same problem with Python?
The contest site had a problem with their JVM which interacted badly with their sandboxing environment. The 1-second time limit would disqualify any Java entry that took something like 50ms or more for some unknown reason.