i don't know if its allowed to discuss this here so soon..
but the competition is over and the solutions are already put up so i
take the liberty to discuss it..
- Start -
 .......
 .......
.......
...R...
...RB.. <=
..BRB..
.RBBR..

- Gravity -
.......
.......
 .......
R......
BB..... <=
BRR....
RBBR...

the analysis says..
just push everything to the right..with the following code..
for (int row = 1; row < n; ++row) {
      int x = n-1;
      for (int col = n-1; col >= 0; col--)
        if (piece[row][col] != '.') {
          piece[row][x] = piece[row][col]; x--;
        }
      while(x>=0) {piece[row][x]='.'; x--;}
    }

well thats what i thought of initially..but then how did the letters
change in the marked columns! i mean how did RB become BB while BRB
become BRR!

some 2010 people have solved it! so i guess im missing
something..would like to know what..
thanks in advance..

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

Reply via email to