OCUK Xmas Programming Challenge

Have to say I'm looking forward to seeing what people have done to return sub-second prime numbers (Rakin? or the SSL library routines?).

I'm down to 20 seconds on the old MBP:
Code:
  Processor Name:	Intel Core 2 Duo
  Processor Speed:	2.4 GHz
  Number Of Processors:	1
  Total Number Of Cores:	2
  L2 Cache:	4 MB
  Memory:	4 GB
  Bus Speed:	800 MHz

I can only surmise that people are running on something a bit bigger..
 
Stage one in 803.904 seconds.
Not sure if it's my computer or what but that seems pretty slow.

I very much doubt it's related to your computer speed. Or language, for that matter. Look at your bottlenecks. I can guarantee there are faster methods of calculating them.
 
Python


I'll have a quick look.

Also for step 5, I don't understand at all. Finding the 13370th Prime number?

What about step 4, do we just forget about that number? Or am I missing something?

You need to work out what the 13370th prime number is, i.e.:

1st: 2
2nd: 3
3rd: 5
4th: 7
5th: 11
6th: 13
7th: 17
8th: 19
etc

keep going until you've generated 13370 numbers which are prime.

You use the answer from stage 4 to decrypt the final message, it's explained somewhere towards the bottom of tntcoder's first post; all the stages are used.
 
Looks like I went wrong somewhere down the line.

89353510.png
 
Look at the Wiki page and understand the algorithm, and the optimisations that can be carried out.

I gave up on understanding those optimisations, to me there seems to be a lot of maths with no clear 'do this' approach :o.


Looks like I went wrong somewhere down the line.

I'm not sure whether tntcoder would want me to point out what, but part of the answer is right in both runs.
 
I gave up on understanding those optimisations, to me there seems to be a lot of maths with no clear 'do this' approach :o.




I'm not sure whether tntcoder would want me to point out what, but part of the answer is right in both runs.

Yer that's ok, 7e7en your first character is correct (and some others...). Assuming your answers to each stage are correct it means you have a probably quite simple bug in your XORing code.
 
Last edited:
I'll edit this post, as I've fixed it all now. Just trying to optimize stage one. Got it down to <500 sec.

Also here's what I used for stage 1.

Stage 1 Spoiler.

And reading the Collatz Conjecture got me it that fast.
 
Last edited:
I've managed to confuse myself. I think stage 8 should be easy, but I've come up with two totally different methods (one mathematical, one brute force) for it which come up with the same wrong answer. :(

Incidentally, the same right answers when I check them for other (although far smaller) values. :o

I should probably go to bed.
 
I've managed to confuse myself. I think stage 8 should be easy, but I've come up with two totally different methods (one mathematical, one brute force) for it which come up with the same wrong answer. :(

Incidentally, the same right answers when I check them for other (although far smaller) values. :o

I should probably go to bed.

Why are you using something mathematical for a process that takes almost no time at all using brute force? Concentrate on optimisations when you've figured out where they're required.
 
Back
Top Bottom