Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 different computation time for different languages, compensate?
Index -> Contests
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
chopperdudes




PostPosted: Tue Feb 03, 2009 9:17 pm   Post subject: different computation time for different languages, compensate?

I'm going to be doing CCC, junior this year, however i've been doing a few senior exercises with bigger test cases. the language i'm most proficient at is turing. But one thing i've found out is, turing runs rather slowly, for example:

using jgrasp, a 9999 x 9999 for loop with 1 variable assignment each time takes 0.134 seconds on my machine,
the same operation, with turing, takes over 38 seconds.

i know in junior it wouldn't really matter, but just wondering, do you get adjustment for those problems with time limits for different languages? O.o
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Feb 03, 2009 10:47 pm   Post subject: RE:different computation time for different languages, compensate?

The first stage is marked by your teacher, who gets instruction package from Waterloo. Your teacher would best be able to answer that question. I think it might be more a matter of "runs in reasonable time".
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
SJ




PostPosted: Sat Feb 07, 2009 7:23 pm   Post subject: RE:different computation time for different languages, compensate?

we all use java in my school. my teacher says that 30 seconds is borderline acceptable. a minute at most if it's a special scenario. but honestly most cases won't require more than a second. i'm sure your teacher will be a fair judge.

but wow, i'm a little surprised there, ~a million operations takes 38 seconds in turing? and i thought java was slow...
DemonWasp




PostPosted: Sat Feb 07, 2009 10:35 pm   Post subject: RE:different computation time for different languages, compensate?

Java isn't slow. Turing, however, is quite slow.

JavaScript is worst of all.
Insectoid




PostPosted: Sun Feb 08, 2009 5:33 am   Post subject: RE:different computation time for different languages, compensate?

I notice that perl is rather slow as well, compared to ruby. What took half a second in ruby took half a minute in perl. Perhaps perl is just slow at type conversion, which was used extensively in my friends version of my base converter.
wtd




PostPosted: Sun Feb 08, 2009 1:45 pm   Post subject: RE:different computation time for different languages, compensate?

Show both your Ruby and Perl code. It's possible you were not using idiomatic Perl.
Tony




PostPosted: Sun Feb 08, 2009 2:36 pm   Post subject: Re: different computation time for different languages, compensate?

I am also somewhat suspicious of
chopperdudes @ Tue Feb 03, 2009 9:17 pm wrote:
a 9999 x 9999 for loop with 1 variable assignment each time takes 0.134 seconds on my machine

are you sure that such is being done? It sounds like something that a compiler should remove, for doing redundant work.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Analysis Mode




PostPosted: Mon Feb 23, 2009 11:42 pm   Post subject: Re: different computation time for different languages, compensate?

For USACO contests, Java users are compensated by a time factor of, i can't remember, 2.0? they are slower.
Sponsor
Sponsor
Sponsor
sponsor
DanielG




PostPosted: Tue Feb 24, 2009 9:40 pm   Post subject: RE:different computation time for different languages, compensate?

CCC purposely give one minute so that as long as you use the right algorithm, it runs in any language (yes, it does give advantages to fast languages for cases where you use slower algorithms).
Analysis Mode




PostPosted: Tue Feb 24, 2009 9:42 pm   Post subject: Re: different computation time for different languages, compensate?

well for the first problem, the time limit is definitely not 1 minute.

For S4 and S5, the time limit is indeed 1 minute.
DanielG




PostPosted: Tue Feb 24, 2009 9:44 pm   Post subject: RE:different computation time for different languages, compensate?

actually, you can probably have them run in under a second (I know how to do it for both 4 and 5 [though I didn't know it during the contest]), for at least C++ and other relatively fast languages.
Display posts from previous:   
   Index -> Contests
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 11 Posts ]
Jump to:   


Style:  
Search: