Weregoose: if you had used a
lengthy static list of primes (or equivalent) aimed at returning the result immediately for low inputs, you could indeed have incurred a small judgement penalty. But we duly indicated that
small static lists of primes (say, the 4 primes < 10), which includes equivalent small if chains in my mind, were tolerated, at least an initialization. For instance, I don't think I would have given a penalty to the TI-BASIC equivalents of, say,
- Code: Select all
if (n == 1) { return 2; }
if (n < 5) { return n/2+1; }
or
- Code: Select all
if (n < 5) { n = n/2+1; if (n < 2) { n++; } return n; }
The raw size of Xeda's program and your program is mentioned as an aside note, but didn't play a role in the ranking. What explains the relative rankings of PZ02 and PZ03 (as well as PP01 / PP06), is that the item with highest weight (by far) in the ranking was sheer speed. An indication about the ranking criteria was posted directly in the contest announcement.
Both of your programs work, both respect the rules and both have explanations. The differentiating factor is on speed: your program is consistently slower on average than Xeda's by a factor between 2 and 3 for n <= 100, though the n=250 figures show that your program is likely to be able to surpass Xeda's program at some point (unless the TI-BASIC interpreter plays yet another nasty trick), thanks to an asymptotically better algorithm.
Jacobly's ASM program can chew through n=3000 in less time than Xeda's and your program can chew through n=250.
We know who you are and the fantastic tricks you've pulled for years in TI-BASIC. In fact, when we saw you entered, we thought "OK, we probably have the winner here". But surprisingly, not this time. You made a program whose speed is reasonably close to that of the winner; the three other contestants in your category didn't.
Does the contents of my post seem relevant to you and provide enough insight into the ranking ?
maestroarte: PP08, c'est Excale, voir le premier post

Sa participation était bien sûr hors concours, mais très intéressante.