wondering about other people's code runtimes

Post about everything you want - even if it is not related to programming or this site.

Moderator: Board moderators

wondering about other people's code runtimes

Postby rich_correia » Wed Feb 14, 2007 11:52 am

Hi

I just started solving a couple problems today. As I was wondering about the site I noticed that, while my runtime to problem 100, (the 3n+1 thing), was something relatively lengthy other people had runtimes of 0 and 0.001, something like that, very fast.
Do they write parts of the code in assembler? What gives?

Rich
rich_correia
New poster
 
Posts: 2
Joined: Wed Feb 14, 2007 11:47 am

Postby rio » Wed Feb 14, 2007 12:05 pm

pre-calculate teq, and fast i/o.
User avatar
rio
A great helper
 
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan

Postby rich_correia » Wed Feb 14, 2007 12:06 pm

sorry dude, what does precalculated teq mean?
rich_correia
New poster
 
Posts: 2
Joined: Wed Feb 14, 2007 11:47 am

Postby Debashis Maitra » Sat Feb 17, 2007 7:57 am

precalculated teq means precalculated output
Akash chhoyar swopno
Dream to touch the sky
User avatar
Debashis Maitra
Learning poster
 
Posts: 62
Joined: Sun Jul 09, 2006 8:31 am
Location: University of Dhaka

Postby Roby » Thu Feb 22, 2007 2:53 am

AND print the formatted output directly :D

But I a little bit curious about the fast I/O... I always use gets to make my solution faster... but it was "less" faster than I thought... So, can someone give me an example how to make fast I/O parser? Thanks.
User avatar
Roby
Experienced poster
 
Posts: 101
Joined: Wed May 04, 2005 4:33 pm
Location: Tangerang, Banten, Indonesia

Postby Vexorian » Thu Feb 22, 2007 6:28 am

In a less esoteric way of doing things, 100 has a fast solution in which you keep an array as a table for solutions you got already. For example f(15) requires your to solve f(46) so if you later go through f(46) you don't have to calculate f(46) again since the program 'remembers' the solution for it.

A good thing to do is to solve http://acm.uva.es/problemset/v3/371.html after solving 100 and notice the differences.
Vexorian
Learning poster
 
Posts: 100
Joined: Sat Aug 26, 2006 5:50 am


Return to Off topic (General chit-chat)

Who is online

Users browsing this forum: No registered users and 1 guest