Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time limit differences between C/C++, Java and Python #77

Open
vysnet opened this issue Dec 26, 2014 · 2 comments
Open

Time limit differences between C/C++, Java and Python #77

vysnet opened this issue Dec 26, 2014 · 2 comments

Comments

@vysnet
Copy link
Contributor

vysnet commented Dec 26, 2014

The major problem when grading submissions, written in several different programming languages, is the proper time limit for every single language. According to a variety of sources it is truly a very tricky and hard task to accomplish, but as much as I have seen and read most of the judging systems set the Java time limits from 2 to 3 times bigger than the C/C++. I don't have much information about the situation with Python but this website says the difference between Python and C/C++ when regarding time limits for algorithmic tasks is pretty high as well (from 6 to 10).

What I suggest is the following:

  • Taking the C/C++ time limit as a pivot;
  • Calculating the Java/Python time limits with proper coefficients for multiplying the C/C++ TL. (I say proper because everything depends on the server machine, right?)
@valo
Copy link
Owner

valo commented Dec 27, 2014

Good blog post! I agree with the author that having multiple time limits
makes it very hard to have proper limits... I will prefer to be very
conservative with touching the time and memory limits for now. I think the
best solution will be to solve this problem when designing the tasks. The
author of the task should figure out the correct limits having in mind the
possibility of using Java or Python to solve it.

This is going to make some problems unsolvable in these languages, but in
practice this will also be true for the real programming contests.

We should probably review the limits of some of the lower division tasks
and see if having precise memory limits is correct. I am wondering if the
emphasis of the E and D tasks should be on the time and memory limits or on
the correctness. It will be very valuable if we can have input on this from
the teachers too.

On Friday, December 26, 2014, Vasil Sarafov [email protected]
wrote:

The major problem when grading submissions, written in several different
programming languages, is the proper time limit for every single language.
According to a variety of sources it is truly a very tricky and hard task
to accomplish, but as much as I have seen and read most of the judging
systems set the Java time limits from 2 to 3 times bigger than the C/C++. I
don't have much information about the situation with Python but this
website
http://www.vexorian.com/2013/08/regarding-c-vs-python-in-algorithm.html
says the difference between Python and C/C++ when regarding time limits for
algorithmic tasks is pretty high as well (from 6 to 10).

What I suggest is the following:

  • Taking the C/C++ time limit as a pivot;
  • Calculating the Java/Python time limits with proper coefficients for
    multiplying the C/C++ TL. (I say proper because everything depends on the
    server machine, right?)


Reply to this email directly or view it on GitHub
#77.

Sent from my iPhone

@valo
Copy link
Owner

valo commented Feb 15, 2015

There was a suggestion by a contributor to make a bootstrap wrapper for the Java sources and use it to run the Java sources and measure only the execution time of the source without including the JVM startup time. This might work and I am waiting on him to provide such a wrapper. The wrapper should load the .class file without executing the initializers, run the main function and report time and memory usage. We can think then how to integrate this in the current docker setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants