I am using java, BigInteger.

setBit while creating equations and testBit and xor while solving.

setBit, toString and substring to retrieve the solution.

Works rather fine ... still running on 294 requires under 30s.

BTW: My compose time (creating equations) on level 350 is twice as big as solving time ... with total around one minute.

--- edit ---

OK, I have changed the create equations part to process buttons in horizontal blocks "together" and than buttons in vertical blocks together. This speeded the compose time to about one tenth of solving time.

So now both parts together require about one third of original time.

BTW, now I use subtraction as well (and of course or as well).

--- edit ---

Now on around 450 it takes around 3 minutes per level.

--- edit ---

Level 522 seems to be roughly same size as 521, but I have reached Out of memory there ... seems recoding my own "BigInteger" will be needed (BTW solution times till it were under 5 mins in most cases).

--- edit ---

there is Xmx switch which could help, let us see for how long ...

--- edit ---

Next problem is on level 550 ... web challenge ... the page was downloaded just partially missing end of the board. OK accept encodding gzip helped with this problem.

--- edit ---

Problems with memory have returned on level 555 ... I am afraid I am almost on limits of easy implementation.

--- edit ---

Hmm, tonight it stopped by not downloading 568 level, even when repeat works fine.

Maximal solving times are under 25 minutes.

--- edit ---

I have decided to change the algorithm (I was "almost" computing inverse matrix originally) I have decided to switch to diagonalizacion instead of triangularizacion (with square of "inverse") and the algorithm slowed down rapidly. So I changed it back to triangularizacion, but without "the square of inverse", but I speeded up the values retrieval from the triangle without further changing the matrix.

Seems this is faster than the original. ... Making small change to a BigInteger is indead very slow and implementing arrrays of longs must be much faster. But unless the boards would expand much more faster in levels above 575 the BigIntegers would be good enough ... now the solving time is less than 10 minutes per level.

--- edit ---

OK, I have decided to code matrix based on longs to replace BigInteger. I made a lot of (of 1 bugs), but comparision with results of previous implementations helped to debug them rather quickly ...

Now the running time should be O(n^3/64) compared to O(n^4/64) caused by BigInteger copying.

The speedup is visible even on low levels. (Levels around 300 under 3s per level)

--- edit ---

Hmm, its just about 5 times faster, and I got to out of Heap Space again. ... I reallocate the matrix for each level, but ... OK, let us see if it was caused by running too many levels in a row ... OK, maybe its a problem of long[][] alocation in one chunk instead of several...