## 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

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

pre-calculate teq, and fast i/o.

rio
A great helper

Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan

sorry dude, what does precalculated teq mean?
rich_correia
New poster

Posts: 2
Joined: Wed Feb 14, 2007 11:47 am

precalculated teq means precalculated output
Akash chhoyar swopno
Dream to touch the sky

Debashis Maitra
Learning poster

Posts: 62
Joined: Sun Jul 09, 2006 8:31 am
Location: University of Dhaka

AND print the formatted output directly

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.

Roby
Experienced poster

Posts: 101
Joined: Wed May 04, 2005 4:33 pm
Location: Tangerang, Banten, Indonesia

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