On Friday, 24 August 2012 at 19:32:53 UTC, maarten van damme
wrote:
I've distiled what I understood from your source and the
resulting
executable managed to solve the impossible one in 27 seconds
while
your source takes 41 seconds.
I've probably violated every D guideline concerning the use of
static,
pure, nothrow,... but it works perfectly :)
It does fail to compile on dpaste, I have no idea why. It does
compile
on my machine though...
http://dpaste.dzfl.pl/8a2aef5b
2012/8/21, Timon Gehr <timon.g...@gmx.ch>:
On 08/21/2012 05:52 PM, maarten van damme wrote:
> On 08/20/2012 11:49 PM, Timon Gehr wrote:> On 08/20/2012
> 10:43 PM,
maarten van damme wrote:
Still it comes nowhere near beating timons solution. Is the
logic of
that documented somewhere because I don't understand it.
Try this:
http://dpaste.dzfl.pl/23b1b6e2
Thank you very much, this makes everything more clearer. I'm
not very
familiar with binary operators so the comments help out a lot.
Would you mind it if I shamelessly copy your solution of
using shorts
to store possibilities in?
Not at all.
I'm also a bit confused. How come the int's you change from a
square
passed from squ are stilled referenced to the original array?
I
thought it lost that reference as soon as you did any
operations (like
concenating) on it?
The used ranges just express patterns of iteration. They
replace manual
for-loops. The data source has assignable elements, and the
relevant
range operations in Phobos all propagate this capability to
their
result.
Your code is 32bitish, while you picked 64bit mode on dpaste.
Here's your code with m32: http://dpaste.dzfl.pl/b4a01f57
Working nice!