Home Posts tagged "project euler"
formats

Project Euler #312

Sometimes I wish I could share solutions to PE problems. They’re so great! I totally enjoyed every bit of this week’s puzzle. At first you don’t know where to start, it seems so complicated and then you just immense yourself in the pleasure of thinking and bit by bit everything becomes crystal clear so that

Read More…

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
9 Comments  comments 
formats

Project Euler #311

Yay! It’s finally getting hard again! The thrill of many hours of computing and being uncertain whether the result will be correct to the last digit… I love it ;D Now I have to figure out the _correct_ (i.e. non semi-brute-force with smart-ass pruning and nifty little optimizations) method of solving this before I start

Read More…

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
4 Comments  comments 
formats

Project Euler #309

Published on November 7, 2010 by in Uncategorized

Oh… GOD! This time I was SO close, soooo close :/ Precision issues played tricks on me again. Long double just doesn’t seem to be good enough with PE problems most of the time. Anyway, crossed ladders problem is a classic (a very fascinating classic nonetheless) and you will figure it out in no time,

Read More…

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
3 Comments  comments 
formats

Project Euler #308

Published on October 31, 2010 by in Uncategorized

You just gotta take a look at this one! It’s one of the absolutely coolest things I’ve seen recently A virtual machine with internal state consisting of just one integer number! And its instruction codes are… fractions! Whoa. It’s Turing-complete and unlike Brainfuck and some other quirky esoteric languages it has this feeling of mathematical

Read More…

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
8 Comments  comments 
formats

Project Euler 306 / Game Theory Books

Published on October 23, 2010 by in Uncategorized

I didn’t have enough time even to start dealing with it last weekend but today I solved PE #306 quite easily. In the process I have stumbled upon several books which look extremely interesting. I will be ordering them soon enough and will let you know if they live up to my high expectations. Today,

Read More…

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

I’m alive

Published on October 3, 2010 by in Uncategorized

I’m alive and well. In case you wondered what was stopping me from posting recently, the answer is PE #289, PE #294 and now the most recent PE #304. The last one was really easy (I had fallen asleep right before it was posted and got to it the next day, still made it to

Read More…

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Project Euler #303

For a positive integer n, define f(n) as the least positive multiple of n that, written in base 10, uses only digits <=2. Thus f(2)=2, f(3)=12, f(7)=21, f(42)=210, f(89)=1121222. Also sum_n=1^100 {f(n)/n} = 11363107 Find sum_n=1^10000 {f(n)/n}. Phew… this was an easy one I made it to the top 30. I hope I will be

Read More…

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
2 Comments  comments 
formats

Merge file sort and swap iterator

During my struggles with Project Euler Problem #302 I made an attempt to semi-brute force it. Unfortunately it required huge amounts of RAM (about 2e9 * 16 bytes) so I figured I could use some help from permanent storage. I implemented two helper classes, namely MergeSort and SwapIterator which look like this: In both cases

Read More…

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Project Euler #300

In a very simplified form, we can consider proteins as strings consisting of hydrophobic (H) and polar (P) elements, e.g. HHPPHHHPHHPH. For this problem, the orientation of a protein is important; e.g. HPP is considered distinct from PPH. Thus, there are 2n distinct proteins consisting of n elements. When one encounters these strings in nature,

Read More…

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
7 Comments  comments 
formats

Becoming a Project Euler addict

Published on August 31, 2010 by in Uncategorized

Jeez, now I’ve solved Project Euler problems #297 and #299. I think I’m becoming an addict #299 required quite a lot of help from my friend (thank you ) while #297 was particularly easy. I managed to code it correctly in about 15 minutes Can you? ;D Each new term in the Fibonacci sequence is

Read More…

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
© 2010-2012 Stanisław Adaszewski
credit