Tianjin University Online Judge
Contests Virtual Contests Problems Submit Runs Status Rank List Forum


My Java Vs C/C++ Online Judge Dilemna

speedstorm25 1337. My Java Vs C/C++ Online Judge Dilemna
2006-04-16 17:21:09 Hi, I tried solving problem 1771 and it took 4:01 for Java and 0:36 for C.  I used exactly the same algorithm.  Theoretically, my Java implementation should be slightly faster because I used hashtables compared to my C implementation where I used a bunch of if statements.  In fact, when I got accepted, the running time of my algorithm was in the top 5 of those who submitted for this problem.  The top was 0:34 and mine was 0:36.  This happened to me before to other problems that required speed.  I always get time limit exceeded in Java and I get accepted in C.  To those who have served as judges in competitions before, may I ask if the judges always determine the execution time of the solutions to their problems based on a C/C++ implementation?  Isn't this a disadvantage to Java users?  The Java virtual machine takes some time to load.  May I request if some extra seconds could be added to the execution time if it is done in Java?  Thank you. :D
Hill 1338. Judges' response
2006-04-16 18:13:02 Yes, we know that. I've solved some problems via Java as Hill_Java.
Java always need more and more time, but there is only one server there.
The time limit of Java is twice of C/C++ now, it seems not enough but it is what I can do.
I must make a balance between system load and time limit of problems, and protect Online Judge System from network-attacks.
We're longing for new hardwares, but it seems a long time to wait. #_#

Well ... here is my suggestion: Use "Buffered" as more as possible.
speedstorm25 1339. Re:My Java Vs C/C++ Online Judge Dilemna
2006-04-16 20:34:41 Thank you very much.  Java is my preferred language.  The only time I switch to C/C++ is when my solutions get Time Limit Exceeded. :D

I have another question, my friend Crigor got his solution for problem 1161 accepted in 7:26 using Java.  My Java solution was cut off at 5:23 and I was told that I got Time Limit Exceeded.  How is this possible?  I remember when I initially solved this problem a few months ago, I got cut off at 10 seconds.  Now, I get cut off at 5:23.  I have already 10+ submissions and all are judged as Time Limit Exceeded.  Run #51672.  Thank you. :D
Hill 1341. Judges' response
2006-04-17 15:22:42 Problem 1161 is one of multiple cases problem, that is, the Online Judge System will run your program twice or more with different data input.
For example, 1161, the time limit is 5 seconds, but for Java, it is 10 seconds. Please notice the case time limit, it is 2.5 seconds, for Java, it is 5 seconds.
And then, it may have 10 input files and 10 output files, the system test your program with the first, it cost 0.22 seconds and done well, but for the second, it cost 5.01 seconds but still not finished, exceed the case time limit, so the process is killed by the system, and report to you "Time Limit Exceed".
It is just an example to explain how you can get 5.23 seconds and TLE, it may different in real processes.
  1

Search    Goto Page:  
User ID:
Password:
Title:

Tianjin University Online Judge v1.2.4