ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

Small question about MLE/TLE for such languages as C#/JAVA
Posted by Andrew Hoffmann aka SKYDOS [Vladimir SU] 5 Aug 2010 13:01
Why there is no koefficient for these two languages?
Yes, we know that these langs are a little bit slower then C++/C/Pascal, but why not to add some multiplier(коэффициент, множитель) for java/c# when counting MLE/TLE?
I think it will be fair, 'cause really some of us (may be not some, but a big half) doesnt know C++/C and they dont need to learn them, 'cause they (for example) participate in contest like TopCoder, CodeForces where solution always possible in any language(dont speak about script langs on CodeForces).

So maybe some good changes?

PS.
I thought about this trying to solve problem "Stacks" ( http://acm.timus.ru/status.aspx?space=1&num=1220&author=73720 ) in C#... but its unreal to get even 500KB (my empty program, without any vars, structs and so on uses ~800-900KB) But if substract for example 700kb from these 800-900 we have 100-200 kb empty working program on C#, so maybe its possible to solve some low memory problems using right technics.

Thx for reading and responding :)

Edited by author 05.08.2010 13:03
Re: Small question about MLE/TLE for such languages as C#/JAVA
Posted by void 6 Aug 2010 02:49
I don't think that coefficient for time is really needed because running time heavily depends on judge system (same  solutions get different time) but it's a good idea to substract a blank solution memory usage and also to show memoru usage with precision to bytes.

It opens new horizons for fighting for bytes and program optimization.

Edited by author 06.08.2010 02:51
Re: Small question about MLE/TLE for such languages as C#/JAVA
Posted by Andrew Hoffmann aka SKYDOS [Vladimir SU] 6 Aug 2010 15:12
About time:
the fastest solution on C# runs 0.078 (0.093), JAVA (0.078) its much more than C++ (0.015) ans Pascal (0.031), so why not to stabilize runnig time for all langs?

and about memory: yes, substracting memy I think is good idea and it really opens new horizonts for challenging solutions in any language!

Waiting for admins and their opinion.
void wrote 6 August 2010 02:49
I don't think that coefficient for time is really needed because running time heavily depends on judge system (same  solutions get different time) but it's a good idea to substract a blank solution memory usage and also to show memoru usage with precision to bytes.

It opens new horizons for fighting for bytes and program optimization.

Edited by author 06.08.2010 02:51
Re: Small question about MLE/TLE for such languages as C#/JAVA
Posted by Vladimir Yakovlev (USU) 6 Aug 2010 17:52
Timus Online Judge always subtracted some constants from memory result. Current constants (aprox.):
C and C++ 0.6 MB
Pascal 1.2 MB
C# 9.9 MB
Java 12.2 MB

C# solution that contains only one infinite loop uses 57 KB of memory.
Re: Small question about MLE/TLE for such languages as C#/JAVA
Posted by Andrew Hoffmann aka SKYDOS [Vladimir SU] 6 Aug 2010 18:01
OMG! I want to look at this solution!
Is it without any "using System.Generic" and other libs?

PS
My empty "A+B" has 393Kb, but its EMPTY... even without any loops or read/write-data functions.

Cant get AC with memory lower then 581kb ( http://acm.timus.ru/status.aspx?space=1&num=1000&author=73720 )

Bad... very bad... this means that its impossible to solve problem @Stacks@ on C#. :(
Vladimir Yakovlev (USU) wrote 6 August 2010 17:52
C# solution that contains only one infinite loop uses 57 KB of memory.

Edited by author 06.08.2010 18:48
Re: Small question about MLE/TLE for such languages as C#/JAVA
Posted by Vladimir Yakovlev (USU) 6 Aug 2010 18:54
public class sum
{
    public static void Main()
    {
        while (true);
    }
}
Re: Small question about MLE/TLE for such languages as C#/JAVA
Posted by Andrew Hoffmann aka SKYDOS [Vladimir SU] 6 Aug 2010 19:59
OMG! It really takes only 53-57Kb....
The main problem is in Console.Write!! When I use it memory raises to 596-600Kb!! Without it - 53-59Kb... No words, just emotions... WTF? maybe there are some other methods for reading/writing data wich are faster then Console.Write?

Thanks.
Vladimir Yakovlev (USU) wrote 6 August 2010 18:54
public class sum
{
    public static void Main()
    {
        while (true);
    }
}

Edited by author 06.08.2010 19:59
Re: Small question about MLE/TLE for such languages as C#/JAVA
Posted by Andrew Hoffmann aka SKYDOS [Vladimir SU] 6 Aug 2010 20:29
I searched the Internet, especially MSDN sites and found out that its better to use this compilers command: /optimize+
Link: http://msdn.microsoft.com/en-us/library/t0hfscdc(v=VS.71).aspx

May be we should try it?
Re: Small question about MLE/TLE for such languages as C#/JAVA
Posted by Vladimir Yakovlev (USU) 7 Aug 2010 01:01
I've added /o+ switch to csc command line.
Re: Small question about MLE/TLE for such languages as C#/JAVA
Posted by Andrew Hoffmann aka SKYDOS [Vladimir SU] 7 Aug 2010 01:24
Heh))
Look at this: http://ipicture.ru/Gallery/Viewfull/803029.html
and memory usage lowered to 585kb... its better than is was!
Re: Small question about MLE/TLE for such languages as C#/JAVA
Posted by Vladimir Yakovlev (USU) 7 Aug 2010 01:46
I've fixed memory constant in such way that infinite loop uses  53-57 KB again

Edited by author 07.08.2010 01:46
Re: Small question about MLE/TLE for such languages as C#/JAVA
Posted by Andrew Hoffmann aka SKYDOS [Vladimir SU] 7 Aug 2010 01:54
Понятно.
Ну да, теперь уже нет выиграша в памяти, видимо отнималось от тех 690-720кб 57кб и поэтому получали 565-585кб . Теперь и этого нет. Блин, жалко, что такие проблемы с памятью.

упс... sorry for russian version.
Vladimir Yakovlev (USU) wrote 7 August 2010 01:46
I've fixed memory constant in such way that infinite loop uses  53-57 KB again

Edited by author 07.08.2010 01:46