The Same Game
Time Limit: 1000MS   Memory Limit: 10000K
Total Submissions: 4585   Accepted: 1699

Description

The game named "Same" is a single person game played on a 10 \Theta 15 board. Each square contains a ball colored red (R), green (G), or blue (B). Two balls belong to the same cluster if they have the same color, and one can be reached from another by following balls of the same color in the four directions up, down, left, and right. At each step of the game, the player chooses a ball whose cluster has at least two balls and removes all balls in the cluster from the board. Then, the board is "compressed" in two steps: 
1. Shift the remaining balls in each column down to fill the empty spaces. The order of the balls in each column is preserved. 
2. If a column becomes empty, shift the remaining columns to the left as far as possible. The order of the columns is preserved. 
For example, choosing the ball at the bottom left corner in the sub-board below causes: 
 
The objective of the game is to remove every ball from the board, and the game is over when every ball is removed or when every cluster has only one ball. The scoring of each game is as follows. The player starts with a score of 0. When a cluster of m balls is removed, the player's score increases by (m-2)^2 . A bonus of 1000 is given if every ball is removed at the end of the game. 
You suspect that a good strategy might be to choose the ball that gives the largest possible cluster at each step, and you want to test this strategy by writing a program to simulate games played using this strategy. If there are two or more balls to choose from, the program should choose the leftmost ball giving the largest cluster. If there is still a tie, it should choose the bottommost ball of these leftmost balls.

Input

You will be given a number of games in the input. The first line of input contains a positive integer giving the number of games to follow. The initial arrangement of the balls of each game is given one row at a time, from top to bottom. Each row contains 15 characters, each of which is one of "R", "G", or "B", specifying the colors of the balls in the row from left to right. A blank line precedes each game.

Output

For each game, print the game number, followed by a new line, followed by information about each move, followed by the final score. Each move should be printed in the format: 
Move x at (r,c): removed b balls of color C, got s points. 
where x is the move number, r and c are the row number and column number of the chosen ball, respectively. The rows are numbered from 1 to 10 from the bottom, and columns are numbered from 1 to 15 from the left. b is the number of balls in the cluster removed. C is one of "R", "G", or "B", indicating the color of the balls removed. s is the score for this move. The score does not include the 1000 point bonus if all the balls are removed after the move. 
The final score should be reported as follows: 
Final score: s, with b balls remaining. 
Insert a blank line between the output of each game. Use the plural forms "balls" and "points" even if the corresponding value is 1.

Sample Input

3
RGGBBGGRBRRGGBG
RBGRBGRBGRBGRBG
RRRRGBBBRGGRBBB
GGRGBGGBRRGGGBG
GBGGRRRRRBGGRRR
BBBBBBBBBBBBBBB
BBBBBBBBBBBBBBB
RRRRRRRRRRRRRRR
RRRRRRGGGGRRRRR
GGGGGGGGGGGGGGG RRRRRRRRRRRRRRR
RRRRRRRRRRRRRRR
GGGGGGGGGGGGGGG
GGGGGGGGGGGGGGG
BBBBBBBBBBBBBBB
BBBBBBBBBBBBBBB
RRRRRRRRRRRRRRR
RRRRRRRRRRRRRRR
GGGGGGGGGGGGGGG
GGGGGGGGGGGGGGG RBGRBGRBGRBGRBG
BGRBGRBGRBGRBGR
GRBGRBGRBGRBGRB
RBGRBGRBGRBGRBG
BGRBGRBGRBGRBGR
GRBGRBGRBGRBGRB
RBGRBGRBGRBGRBG
BGRBGRBGRBGRBGR
GRBGRBGRBGRBGRB
RBGRBGRBGRBGRBG

Sample Output

Game 1: 

Move 1 at (4,1): removed 32 balls of color B, got 900 points.
Move 2 at (2,1): removed 39 balls of color R, got 1369 points.
Move 3 at (1,1): removed 37 balls of color G, got 1225 points.
Move 4 at (3,4): removed 11 balls of color B, got 81 points.
Move 5 at (1,1): removed 8 balls of color R, got 36 points.
Move 6 at (2,1): removed 6 balls of color G, got 16 points.
Move 7 at (1,6): removed 6 balls of color B, got 16 points.
Move 8 at (1,2): removed 5 balls of color R, got 9 points.
Move 9 at (1,2): removed 5 balls of color G, got 9 points.
Final score: 3661, with 1 balls remaining. Game 2: Move 1 at (1,1): removed 30 balls of color G, got 784 points.
Move 2 at (1,1): removed 30 balls of color R, got 784 points.
Move 3 at (1,1): removed 30 balls of color B, got 784 points.
Move 4 at (1,1): removed 30 balls of color G, got 784 points.
Move 5 at (1,1): removed 30 balls of color R, got 784 points.
Final score: 4920, with 0 balls remaining. Game 3: Final score: 0, with 150 balls remaining. 令人恶心的模拟,也许在大神们看来是水题,但我还是WA了很久,回头想想也不是太难,就是各种小错误,各种想不到的情况,最后用了别人的测试数据才找出错误,哎。
 #include <iostream>
#include <cstring>
#include <stdio.h> using namespace std; int step[][]={{,},{-,},{,},{,-}}; int board[][],cnt;
bool vis[][],marked[][]; void cnt_ball(int x,int y,int cl)
{
int i;
vis[x][y]=true;
for(i=;i<;i++)
{
int tx=x+step[i][],ty=y+step[i][];
if(tx>=&&tx<&&ty>=&&ty<&&!vis[tx][ty]&&board[tx][ty]==cl)
{
vis[tx][ty]=true;
cnt++;
cnt_ball(tx,ty,cl);
}
}
return;
} void mark(int x,int y,int cl)
{
int i;
marked[x][y]=true;
for(i=;i<;i++)
{
int tx=x+step[i][],ty=y+step[i][];
if(tx>=&&tx<&&ty>=&&ty<&&board[tx][ty]==cl&&!marked[tx][ty])
{
marked[tx][ty]=true;
mark(tx,ty,cl);
}
}
return;
} void eliminate()
{
int i,j,k;
for(i=;i<;i++)
{
for(j=;j<;j++)
{
if(marked[i][j])
{
board[i][j]=;
}
}
}
for(j=;j<;j++)
{
for(i=;i>=;i--)
{
if(board[i][j]==)
{
int t=,ti=i;
while(ti>=&&board[ti][j]==)
{
t++;
ti--;
}
if(ti==-)
break;
for(k=i;k>=t;k--)
{
board[k][j]=board[k-t][j];
}
for(k=;k<t;k++)
{
board[k][j]=;
}
}
}
}
// for(i=0;i<10;i++)
// {
// for(j=0;j<15;j++)
// cout<<board[i][j];
// cout<<endl;
// }
// cout<<endl;
for(j=;j<;j++)
{
if(board[][j]==)
{
int t=,tj=j;
while(tj<&&board[][tj]==)
{
t++;
tj++;
}
if(tj==)
break;
for(k=j;k<-t;k++)
{
for(i=;i<;i++)
{
board[i][k]=board[i][k+t];
}
}
for(k=;k>-t;k--)
{
for(i=;i<;i++)
{
board[i][k]=;
}
}
}
}
// for(i=0;i<10;i++)
// {
// for(j=0;j<15;j++)
// cout<<board[i][j];
// cout<<endl;
// }
} int main()
{
// freopen("in.txt","r",stdin);
int T,cas=;
scanf("%d",&T);
while(T--)
{
cas++;
int i,j;
memset(board,,sizeof(board));
char tmp[];
for(i=;i<;i++)
{
scanf("%s",tmp);
for(j=;j<;j++)
{
if(tmp[j]=='R')
board[i][j]=;
else if(tmp[j]=='G')
board[i][j]=;
else if(tmp[j]=='B')
board[i][j]=;
}
}
printf("Game %d:\n\n",cas);
int mov=,tot=;
while(true)
{
int process[],num=,color=;
memset(vis,false,sizeof(vis));
for(j=;j<;j++)
{
for(i=;i>=;i--)
{
if(board[i][j]!=&&!vis[i][j])
{
cnt=;
cnt_ball(i,j,board[i][j]);
if(cnt>num)
{
memset(marked,false,sizeof(marked));
mark(i,j,board[i][j]);
process[]=-i;
process[]=j+;
num=cnt;
color=board[i][j];
} }
}
}
if(num<=)
break;
else
{
int score=(num-)*(num-);
tot+=score;
mov++;
eliminate();
char c;
if(color==)
c='R';
else if(color==)
c='G';
else if(color==)
c='B';
printf("Move %d at (%d,%d): removed %d balls of color %c, got %d points.\n",mov,process[],process[],num,c,score);
}
}
int rem=;
for(i=;i>=;i--)
{
for(j=;j<;j++)
{
if(board[i][j])
rem++;
}
}
if(rem==)
tot+=;
printf("Final score: %d, with %d balls remaining.\n\n",tot,rem);
}
return ;
}
 附上大神的测试数据:
20
BBRRBRGGRBBBRGR
BRBGGGGBGRRGBBB
BGBGGRBRRGBGBGG
BGRBRBBRGGRBGRR
RBBGGRRBRRBGBGR
BGGGBGBGRGBRBBR
GGBRBRBGGBGBRGG
GGBBGBBBRGGBGGG
RGBGBBGRBRBRGRR
RGBRGRBGGBBRBBG
Game 1: Move 1 at (3,1): removed 11 balls of color G, got 81 points.
Move 2 at (5,1): removed 15 balls of color B, got 169 points.
Move 3 at (2,5): removed 7 balls of color B, got 25 points.
Move 4 at (2,13): removed 6 balls of color G, got 16 points.
Move 5 at (1,12): removed 9 balls of color R, got 49 points.
Move 6 at (1,10): removed 10 balls of color B, got 64 points.
Move 7 at (3,10): removed 8 balls of color B, got 36 points.
Move 8 at (2,10): removed 7 balls of color G, got 25 points.
Move 9 at (1,13): removed 6 balls of color G, got 16 points.
Move 10 at (1,10): removed 6 balls of color R, got 16 points.
Move 11 at (4,4): removed 4 balls of color G, got 4 points.
Move 12 at (4,3): removed 4 balls of color R, got 4 points.
Move 13 at (5,6): removed 4 balls of color B, got 4 points.
Move 14 at (4,7): removed 5 balls of color G, got 9 points.
Move 15 at (3,7): removed 8 balls of color R, got 36 points.
Move 16 at (1,8): removed 4 balls of color G, got 4 points.
Move 17 at (1,7): removed 6 balls of color B, got 16 points.
Move 18 at (2,4): removed 3 balls of color G, got 1 points.
Move 19 at (1,7): removed 3 balls of color G, got 1 points.
Move 20 at (1,6): removed 4 balls of color R, got 4 points.
Move 21 at (2,6): removed 3 balls of color R, got 1 points.
Move 22 at (1,6): removed 3 balls of color G, got 1 points.
Move 23 at (1,1): removed 2 balls of color R, got 0 points.
Move 24 at (1,2): removed 2 balls of color G, got 0 points.
Move 25 at (1,2): removed 3 balls of color R, got 1 points.
Move 26 at (1,1): removed 4 balls of color B, got 4 points.
Move 27 at (1,1): removed 2 balls of color R, got 0 points.
Final score: 587, with 1 balls remaining. BRBRGBGBGBRBGBB
GRGBBRBBRGGGGGR
RGBRGBGBRBBRGRB
GGBRRBBBGBBRBRG
BRGBRBGRGGRGRBB
GGGGBBBBBRRGGRR
BBRBBBGRRGBGBGG
BRBBBRGGGBGBGRB
BGRBBBBBGRBGGGG
RRRBRRRGGRBBGBB
Game 2: Move 1 at (3,3): removed 26 balls of color B, got 576 points.
Move 2 at (1,1): removed 15 balls of color R, got 169 points.
Move 3 at (1,7): removed 10 balls of color G, got 64 points.
Move 4 at (9,9): removed 7 balls of color G, got 25 points.
Move 5 at (2,11): removed 6 balls of color G, got 16 points.
Move 6 at (1,10): removed 8 balls of color B, got 36 points.
Move 7 at (1,2): removed 5 balls of color G, got 9 points.
Move 8 at (1,1): removed 10 balls of color B, got 64 points.
Move 9 at (1,6): removed 5 balls of color R, got 9 points.
Move 10 at (3,6): removed 7 balls of color R, got 25 points.
Move 11 at (4,7): removed 7 balls of color B, got 25 points.
Move 12 at (1,5): removed 6 balls of color G, got 16 points.
Move 13 at (1,6): removed 5 balls of color G, got 9 points.
Move 14 at (1,1): removed 3 balls of color G, got 1 points.
Move 15 at (2,1): removed 3 balls of color G, got 1 points.
Move 16 at (2,1): removed 4 balls of color R, got 4 points.
Move 17 at (1,5): removed 3 balls of color R, got 1 points.
Move 18 at (1,1): removed 2 balls of color B, got 0 points.
Move 19 at (1,3): removed 2 balls of color B, got 0 points.
Move 20 at (1,3): removed 2 balls of color G, got 0 points.
Move 21 at (1,2): removed 3 balls of color R, got 1 points.
Move 22 at (1,2): removed 2 balls of color B, got 0 points.
Move 23 at (1,2): removed 2 balls of color R, got 0 points.
Final score: 1051, with 7 balls remaining. BGRGBRBRRBRGRGB
GRRRRRRGRRBGRBR
BRBGGRBRBBBRGRG
BBBBGRRGRRRGBRR
GBRBBBGGGBGBBGR
GRBBBRBGBBRBRBG
GBGBRBBRGBRBBRB
BGBBRBRBGRRRBBG
RGGBGBBRBBBRBBG
BBRRBRBBBRRBBRG
Game 3: Move 1 at (7,1): removed 17 balls of color B, got 225 points.
Move 2 at (2,6): removed 12 balls of color B, got 100 points.
Move 3 at (3,4): removed 14 balls of color R, got 144 points.
Move 4 at (1,11): removed 12 balls of color B, got 100 points.
Move 5 at (1,9): removed 14 balls of color R, got 144 points.
Move 6 at (2,2): removed 9 balls of color G, got 49 points.
Move 7 at (3,2): removed 8 balls of color R, got 36 points.
Move 8 at (2,5): removed 6 balls of color G, got 16 points.
Move 9 at (1,5): removed 8 balls of color B, got 36 points.
Move 10 at (1,5): removed 9 balls of color R, got 49 points.
Move 11 at (1,7): removed 5 balls of color G, got 9 points.
Move 12 at (1,1): removed 4 balls of color B, got 4 points.
Move 13 at (3,1): removed 4 balls of color G, got 4 points.
Move 14 at (2,7): removed 4 balls of color G, got 4 points.
Move 15 at (1,6): removed 4 balls of color B, got 4 points.
Move 16 at (1,6): removed 4 balls of color R, got 4 points.
Move 17 at (2,3): removed 3 balls of color B, got 1 points.
Move 18 at (2,6): removed 3 balls of color G, got 1 points.
Move 19 at (2,1): removed 2 balls of color B, got 0 points.
Move 20 at (1,4): removed 2 balls of color G, got 0 points.
Final score: 930, with 6 balls remaining. BRBRBRRBRGRBRGB
RRGRGRBRBGBRGGG
RRGRGBGRRBRBBRG
BBRRBRRRRBRRGGB
GRGBBRBRBBGRRRR
BBGGRBRRBGBBRRB
GGGGRGRGRRGRRRG
BGGGRGGRGBBRBGG
BBGGRBRRGBBGBRG
RRBBBGBBRBGRBGB
Game 4: Move 1 at (7,11): removed 13 balls of color R, got 121 points.
Move 2 at (4,1): removed 12 balls of color G, got 100 points.
Move 3 at (6,6): removed 12 balls of color R, got 100 points.
Move 4 at (1,10): removed 10 balls of color B, got 64 points.
Move 5 at (5,8): removed 9 balls of color B, got 49 points.
Move 6 at (2,9): removed 9 balls of color G, got 49 points.
Move 7 at (2,7): removed 10 balls of color R, got 64 points.
Move 8 at (3,4): removed 8 balls of color R, got 36 points.
Move 9 at (1,3): removed 7 balls of color B, got 25 points.
Move 10 at (2,3): removed 9 balls of color G, got 49 points.
Move 11 at (1,4): removed 7 balls of color B, got 25 points.
Move 12 at (2,1): removed 6 balls of color B, got 16 points.
Move 13 at (1,1): removed 6 balls of color R, got 16 points.
Move 14 at (3,1): removed 6 balls of color R, got 16 points.
Move 15 at (3,4): removed 6 balls of color G, got 16 points.
Move 16 at (4,5): removed 4 balls of color G, got 4 points.
Move 17 at (1,6): removed 4 balls of color B, got 4 points.
Move 18 at (1,3): removed 3 balls of color G, got 1 points.
Move 19 at (1,2): removed 3 balls of color B, got 1 points.
Move 20 at (1,2): removed 3 balls of color R, got 1 points.
Move 21 at (2,1): removed 2 balls of color B, got 0 points.
Final score: 757, with 1 balls remaining. GRRGGBBBGBRRGRR
GRBBBGRGRBGBGRG
RGBBBRGBGBGRBRB
BBRGRBBBBGRBRGG
RRGGGRGBBBBGRRG
RGRGGBGRRBGBRGB
GBRRBRGGRGGRRRR
GGRBGGBBRGBRRGG
BGBGRBGRGBRGGRB
GGRRBBBBBBGBRBB
Game 5: Move 1 at (7,6): removed 10 balls of color B, got 64 points.
Move 2 at (3,12): removed 10 balls of color R, got 64 points.
Move 3 at (3,10): removed 14 balls of color G, got 144 points.
Move 4 at (1,5): removed 15 balls of color B, got 169 points.
Move 5 at (6,6): removed 10 balls of color G, got 64 points.
Move 6 at (3,7): removed 10 balls of color R, got 64 points.
Move 7 at (3,4): removed 7 balls of color B, got 25 points.
Move 8 at (6,3): removed 8 balls of color G, got 36 points.
Move 9 at (1,3): removed 8 balls of color R, got 36 points.
Move 10 at (1,1): removed 6 balls of color G, got 16 points.
Move 11 at (1,1): removed 8 balls of color B, got 36 points.
Move 12 at (1,1): removed 7 balls of color R, got 25 points.
Move 13 at (1,13): removed 5 balls of color B, got 9 points.
Move 14 at (1,12): removed 6 balls of color R, got 16 points.
Move 15 at (1,4): removed 4 balls of color G, got 4 points.
Move 16 at (3,1): removed 3 balls of color G, got 1 points.
Move 17 at (2,2): removed 3 balls of color B, got 1 points.
Move 18 at (2,1): removed 3 balls of color R, got 1 points.
Move 19 at (1,5): removed 3 balls of color G, got 1 points.
Move 20 at (1,3): removed 2 balls of color R, got 0 points.
Move 21 at (1,4): removed 2 balls of color G, got 0 points.
Final score: 776, with 6 balls remaining. BBGGRBRGRGGRBRR
GGGBBBBBGRGGGGR
BGGRRBBBBGBBRGB
GRGRRGBBGBGRGRR
GBRRGGBBRRGBRRB
BGBBGBBGRBBRGRG
RRRGBRGBRGGRBRR
BGGBGGRGRRGRRGG
BGRBGGRBBGRGBRR
RRBGRBBBGBRGBRG
Game 6: Move 1 at (9,4): removed 16 balls of color B, got 196 points.
Move 2 at (9,1): removed 8 balls of color G, got 36 points.
Move 3 at (6,3): removed 7 balls of color R, got 25 points.
Move 4 at (10,10): removed 7 balls of color G, got 25 points.
Move 5 at (6,13): removed 9 balls of color R, got 49 points.
Move 6 at (3,9): removed 6 balls of color R, got 16 points.
Move 7 at (3,8): removed 7 balls of color G, got 25 points.
Move 8 at (1,6): removed 10 balls of color B, got 64 points.
Move 9 at (2,5): removed 4 balls of color G, got 4 points.
Move 10 at (4,4): removed 6 balls of color G, got 16 points.
Move 11 at (1,5): removed 5 balls of color R, got 9 points.
Move 12 at (1,6): removed 4 balls of color G, got 4 points.
Move 13 at (1,6): removed 4 balls of color R, got 4 points.
Move 14 at (1,6): removed 4 balls of color G, got 4 points.
Move 15 at (1,7): removed 4 balls of color R, got 4 points.
Move 16 at (1,5): removed 7 balls of color B, got 25 points.
Move 17 at (4,1): removed 3 balls of color R, got 1 points.
Move 18 at (2,2): removed 4 balls of color G, got 4 points.
Move 19 at (2,1): removed 5 balls of color B, got 9 points.
Move 20 at (1,1): removed 4 balls of color R, got 4 points.
Move 21 at (1,2): removed 5 balls of color B, got 9 points.
Move 22 at (1,1): removed 3 balls of color G, got 1 points.
Move 23 at (1,4): removed 3 balls of color R, got 1 points.
Move 24 at (1,3): removed 6 balls of color G, got 16 points.
Move 25 at (1,3): removed 3 balls of color B, got 1 points.
Move 26 at (1,2): removed 4 balls of color R, got 4 points.
Move 27 at (1,1): removed 2 balls of color B, got 0 points.
Final score: 1556, with 0 balls remaining. RGRGBGBBGRBGGBR
GGRBBGBBGBRBBGG
RRBRGGRGRGGBGGG
GGGBBBRBRRGRRRR
RBRBGBRGRGRGBRR
GRBRGRRBGBRBGBB
RBGGGRGBGGGRGRG
BGGRGRBGBBRGRGR
BGRBGRGRRGGRGRB
RGRRBGRRGBBBRRR
Game 7: Move 1 at (1,2): removed 11 balls of color G, got 81 points.
Move 2 at (2,6): removed 8 balls of color R, got 36 points.
Move 3 at (2,4): removed 6 balls of color B, got 16 points.
Move 4 at (1,5): removed 8 balls of color G, got 36 points.
Move 5 at (1,5): removed 8 balls of color B, got 36 points.
Move 6 at (2,2): removed 10 balls of color R, got 64 points.
Move 7 at (2,1): removed 8 balls of color B, got 36 points.
Move 8 at (1,5): removed 8 balls of color G, got 36 points.
Move 9 at (7,9): removed 6 balls of color R, got 16 points.
Move 10 at (7,10): removed 5 balls of color G, got 9 points.
Move 11 at (7,9): removed 7 balls of color B, got 25 points.
Move 12 at (6,8): removed 7 balls of color G, got 25 points.
Move 13 at (4,7): removed 5 balls of color R, got 9 points.
Move 14 at (4,6): removed 6 balls of color G, got 16 points.
Move 15 at (1,7): removed 7 balls of color B, got 25 points.
Move 16 at (1,6): removed 10 balls of color R, got 64 points.
Move 17 at (1,1): removed 3 balls of color R, got 1 points.
Move 18 at (1,1): removed 6 balls of color G, got 16 points.
Move 19 at (1,1): removed 4 balls of color R, got 4 points.
Move 20 at (1,2): removed 4 balls of color B, got 4 points.
Move 21 at (2,1): removed 3 balls of color R, got 1 points.
Move 22 at (1,1): removed 4 balls of color G, got 4 points.
Move 23 at (1,1): removed 2 balls of color R, got 0 points.
Final score: 560, with 4 balls remaining. BBGBRGBBBRBBGGR
BGGRBRRRBBRGBBR
GRBGGBGBGGRGRGR
GBGRRBRRGBBGBRR
RBRGRBBGBBGRBGB
GRGGBRRGBRGBBGG
RBGGGGGBBBGRRGG
RGGRBRGBBBRBRGR
GBBRBRGGRGGGBGR
RGGRGRRRRRBGRGG
Game 8: Move 1 at (3,2): removed 13 balls of color G, got 121 points.
Move 2 at (3,7): removed 12 balls of color B, got 100 points.
Move 3 at (1,6): removed 11 balls of color R, got 81 points.
Move 4 at (1,14): removed 9 balls of color G, got 49 points.
Move 5 at (2,5): removed 7 balls of color B, got 25 points.
Move 6 at (3,3): removed 7 balls of color R, got 25 points.
Move 7 at (1,2): removed 6 balls of color G, got 16 points.
Move 8 at (1,7): removed 6 balls of color G, got 16 points.
Move 9 at (2,10): removed 4 balls of color G, got 4 points.
Move 10 at (3,11): removed 6 balls of color G, got 16 points.
Move 11 at (3,10): removed 8 balls of color R, got 36 points.
Move 12 at (2,8): removed 15 balls of color B, got 169 points.
Move 13 at (1,6): removed 14 balls of color R, got 144 points.
Move 14 at (3,1): removed 3 balls of color R, got 1 points.
Move 15 at (1,2): removed 6 balls of color B, got 16 points.
Move 16 at (2,1): removed 6 balls of color G, got 16 points.
Move 17 at (1,1): removed 4 balls of color R, got 4 points.
Move 18 at (1,2): removed 5 balls of color B, got 9 points.
Move 19 at (1,3): removed 3 balls of color G, got 1 points.
Move 20 at (1,1): removed 2 balls of color G, got 0 points.
Move 21 at (1,1): removed 2 balls of color B, got 0 points.
Final score: 849, with 1 balls remaining. GGGGRGBRRGGRRGG
RRBGBGRRBRRBGGR
RBRGGGGGBRGRBGG
BGGGBGGBRBBBRBR
GRGRRBRBGBRBGGB
BGGRRRRRGBGRGGG
GRBGGRGRRBBRBBR
BBRRGRGRRRGGBRG
BBBGGBRBRBBGRBB
BGGGRGGBRRBGBGB
Game 9: Move 1 at (10,1): removed 20 balls of color G, got 324 points.
Move 2 at (4,2): removed 22 balls of color R, got 400 points.
Move 3 at (1,8): removed 14 balls of color B, got 144 points.
Move 4 at (1,1): removed 9 balls of color B, got 49 points.
Move 5 at (1,1): removed 9 balls of color G, got 49 points.
Move 6 at (9,13): removed 6 balls of color G, got 16 points.
Move 7 at (1,11): removed 5 balls of color G, got 9 points.
Move 8 at (1,10): removed 6 balls of color R, got 16 points.
Move 9 at (1,11): removed 9 balls of color B, got 49 points.
Move 10 at (1,2): removed 4 balls of color R, got 4 points.
Move 11 at (1,1): removed 5 balls of color B, got 9 points.
Move 12 at (1,6): removed 4 balls of color G, got 4 points.
Move 13 at (2,4): removed 7 balls of color R, got 25 points.
Move 14 at (1,3): removed 5 balls of color G, got 9 points.
Move 15 at (1,5): removed 4 balls of color G, got 4 points.
Move 16 at (1,5): removed 3 balls of color R, got 1 points.
Move 17 at (1,3): removed 4 balls of color B, got 4 points.
Move 18 at (1,2): removed 3 balls of color R, got 1 points.
Move 19 at (1,1): removed 4 balls of color G, got 4 points.
Move 20 at (1,1): removed 3 balls of color B, got 1 points.
Move 21 at (1,1): removed 4 balls of color R, got 4 points.
Final score: 2126, with 0 balls remaining. GGGRBBBBRBRRGGB
GBGGBBRGGBRGRGG
BBBRRRBBBGGBRBG
BRBRRRRBRBBGBBB
BGRBRBGBBRRGGBG
GRGGRBBGGBBBGRG
RBBRBGRRRGGGRGR
RRRGGRRBGBRRGGB
BRBGGBGBGBGGGBR
BGBRGGBGBBGRBBG
Game 10: Move 1 at (7,4): removed 9 balls of color R, got 49 points.
Move 2 at (6,4): removed 15 balls of color B, got 169 points.
Move 3 at (6,1): removed 7 balls of color B, got 25 points.
Move 4 at (1,11): removed 7 balls of color G, got 25 points.
Move 5 at (2,4): removed 6 balls of color G, got 16 points.
Move 6 at (8,11): removed 6 balls of color G, got 16 points.
Move 7 at (3,1): removed 5 balls of color R, got 9 points.
Move 8 at (3,1): removed 8 balls of color G, got 36 points.
Move 9 at (1,1): removed 6 balls of color B, got 16 points.
Move 10 at (1,2): removed 5 balls of color R, got 9 points.
Move 11 at (1,6): removed 5 balls of color B, got 9 points.
Move 12 at (5,4): removed 4 balls of color G, got 4 points.
Move 13 at (3,4): removed 4 balls of color R, got 4 points.
Move 14 at (3,4): removed 4 balls of color B, got 4 points.
Move 15 at (1,5): removed 4 balls of color G, got 4 points.
Move 16 at (1,7): removed 4 balls of color R, got 4 points.
Move 17 at (4,6): removed 6 balls of color G, got 16 points.
Move 18 at (3,6): removed 10 balls of color B, got 64 points.
Move 19 at (2,6): removed 8 balls of color R, got 36 points.
Move 20 at (1,9): removed 4 balls of color B, got 4 points.
Move 21 at (1,1): removed 3 balls of color G, got 1 points.
Move 22 at (1,6): removed 3 balls of color G, got 1 points.
Move 23 at (1,1): removed 2 balls of color R, got 0 points.
Move 24 at (1,2): removed 2 balls of color B, got 0 points.
Move 25 at (1,1): removed 2 balls of color G, got 0 points.
Move 26 at (3,1): removed 2 balls of color R, got 0 points.
Move 27 at (1,3): removed 2 balls of color R, got 0 points.
Move 28 at (1,3): removed 2 balls of color G, got 0 points.
Move 29 at (1,2): removed 3 balls of color B, got 1 points.
Final score: 522, with 2 balls remaining. GGGBRGGRRBBRGGG
BBRRRBGRGRRGGBR
GRGBRBRGGBGRBRG
RGRGGRBRBRGRGGR
BGBGBGRGGBRRRGR
BGRGGBRRBRBBGGB
BBBGBGGRGGGBBRG
BGBBBRGRBRRRRRG
GBGRRRRRRRGBGBB
GRGGBRBRGGBRBRB
Game 11: Move 1 at (2,4): removed 21 balls of color R, got 361 points.
Move 2 at (3,1): removed 7 balls of color B, got 25 points.
Move 3 at (4,1): removed 13 balls of color G, got 121 points.
Move 4 at (2,4): removed 7 balls of color B, got 25 points.
Move 5 at (4,9): removed 7 balls of color B, got 25 points.
Move 6 at (5,11): removed 11 balls of color G, got 81 points.
Move 7 at (3,10): removed 10 balls of color R, got 64 points.
Move 8 at (1,8): removed 8 balls of color G, got 36 points.
Move 9 at (1,9): removed 10 balls of color B, got 64 points.
Move 10 at (1,6): removed 7 balls of color G, got 25 points.
Move 11 at (2,4): removed 5 balls of color R, got 9 points.
Move 12 at (2,4): removed 5 balls of color B, got 9 points.
Move 13 at (1,9): removed 5 balls of color R, got 9 points.
Move 14 at (1,3): removed 4 balls of color G, got 4 points.
Move 15 at (1,2): removed 6 balls of color R, got 16 points.
Move 16 at (1,4): removed 4 balls of color G, got 4 points.
Move 17 at (1,2): removed 5 balls of color B, got 9 points.
Move 18 at (1,2): removed 4 balls of color R, got 4 points.
Move 19 at (1,1): removed 3 balls of color G, got 1 points.
Move 20 at (1,3): removed 3 balls of color G, got 1 points.
Final score: 893, with 5 balls remaining. RRBBBRGGGRGBBRR
GBRBBRGGRGBRGBB
RRRRBBBBBGBBRBB
GGGGRGRGGBBBBBB
RRRRRRGRGBGGRRR
BBRBRGGGBBRBGRR
BBGRRGRRGRBRBRB
BRRGRGRBRRRGGBR
RGGBBBBRBBGRRGR
GGGGRBBRGGGRBRR
Game 12: Move 1 at (5,9): removed 16 balls of color B, got 196 points.
Move 2 at (3,6): removed 14 balls of color G, got 144 points.
Move 3 at (6,1): removed 26 balls of color R, got 576 points.
Move 4 at (2,4): removed 16 balls of color B, got 196 points.
Move 5 at (6,12): removed 10 balls of color R, got 64 points.
Move 6 at (1,1): removed 8 balls of color G, got 36 points.
Move 7 at (1,1): removed 5 balls of color R, got 9 points.
Move 8 at (1,1): removed 5 balls of color B, got 9 points.
Move 9 at (1,8): removed 5 balls of color G, got 9 points.
Move 10 at (1,1): removed 4 balls of color G, got 4 points.
Move 11 at (1,1): removed 4 balls of color R, got 4 points.
Move 12 at (1,2): removed 4 balls of color B, got 4 points.
Move 13 at (1,9): removed 4 balls of color R, got 4 points.
Move 14 at (1,3): removed 3 balls of color G, got 1 points.
Move 15 at (1,2): removed 3 balls of color R, got 1 points.
Move 16 at (1,4): removed 3 balls of color R, got 1 points.
Move 17 at (3,4): removed 3 balls of color B, got 1 points.
Move 18 at (2,5): removed 3 balls of color G, got 1 points.
Move 19 at (1,5): removed 3 balls of color B, got 1 points.
Move 20 at (1,1): removed 2 balls of color G, got 0 points.
Move 21 at (1,2): removed 2 balls of color B, got 0 points.
Move 22 at (1,2): removed 4 balls of color G, got 4 points.
Move 23 at (1,1): removed 2 balls of color R, got 0 points.
Final score: 1265, with 1 balls remaining. GGBRGBGGGGRBGRR
GRGRBRRGRBGRGGG
BRGRBGRGGGRRRBB
GGBBGGRRBGBBBBG
RBGBBBRBRBRRRRR
RRGBRGGBBBBBGRG
BGRRBBRRBBRBRBG
RGRGRBRGRRBGGBB
BBRRBGBGBBBBGBR
GBGGRBBBBGRBGBG
Game 13: Move 1 at (1,6): removed 11 balls of color B, got 81 points.
Move 2 at (4,8): removed 13 balls of color B, got 121 points.
Move 3 at (1,9): removed 11 balls of color R, got 81 points.
Move 4 at (1,8): removed 13 balls of color G, got 121 points.
Move 5 at (2,13): removed 6 balls of color B, got 16 points.
Move 6 at (2,3): removed 5 balls of color R, got 9 points.
Move 7 at (3,2): removed 7 balls of color G, got 25 points.
Move 8 at (2,1): removed 10 balls of color B, got 64 points.
Move 9 at (1,4): removed 5 balls of color R, got 9 points.
Move 10 at (6,5): removed 5 balls of color R, got 9 points.
Move 11 at (4,4): removed 8 balls of color G, got 36 points.
Move 12 at (3,3): removed 6 balls of color B, got 16 points.
Move 13 at (1,6): removed 5 balls of color R, got 9 points.
Move 14 at (1,9): removed 5 balls of color R, got 9 points.
Move 15 at (4,1): removed 4 balls of color R, got 4 points.
Move 16 at (3,10): removed 4 balls of color G, got 4 points.
Move 17 at (4,1): removed 3 balls of color G, got 1 points.
Move 18 at (1,5): removed 3 balls of color G, got 1 points.
Move 19 at (3,1): removed 2 balls of color B, got 0 points.
Move 20 at (3,1): removed 2 balls of color G, got 0 points.
Move 21 at (1,3): removed 2 balls of color G, got 0 points.
Move 22 at (1,3): removed 2 balls of color B, got 0 points.
Move 23 at (1,2): removed 3 balls of color R, got 1 points.
Move 24 at (1,5): removed 2 balls of color G, got 0 points.
Move 25 at (1,4): removed 3 balls of color B, got 1 points.
Move 26 at (1,4): removed 2 balls of color R, got 0 points.
Move 27 at (1,3): removed 2 balls of color G, got 0 points.
Move 28 at (1,2): removed 2 balls of color B, got 0 points.
Move 29 at (1,1): removed 2 balls of color G, got 0 points.
Move 30 at (1,1): removed 2 balls of color R, got 0 points.
Final score: 1618, with 0 balls remaining. GGBBGRBGBBRBBBR
RGGRRRBRBBBBBRR
RBGRBRGGRGRRGGB
GGBGRGGGRBGGGRG
RGRBRRBGBBGGRGR
GBBBGRGRGRGRGGG
GGBGGGGRBRGGGBG
RGBBRBRRGGGGRRR
GGGBRGRGRGRBGRG
GBGGRBBRBBRRBBB
Game 14: Move 1 at (3,9): removed 21 balls of color G, got 361 points.
Move 2 at (2,9): removed 15 balls of color R, got 169 points.
Move 3 at (1,9): removed 15 balls of color B, got 169 points.
Move 4 at (1,1): removed 10 balls of color G, got 64 points.
Move 5 at (1,2): removed 7 balls of color B, got 25 points.
Move 6 at (4,2): removed 10 balls of color G, got 64 points.
Move 7 at (4,4): removed 9 balls of color R, got 49 points.
Move 8 at (2,7): removed 7 balls of color R, got 25 points.
Move 9 at (4,6): removed 7 balls of color G, got 25 points.
Move 10 at (1,5): removed 7 balls of color B, got 25 points.
Move 11 at (3,2): removed 6 balls of color B, got 16 points.
Move 12 at (2,6): removed 5 balls of color R, got 9 points.
Move 13 at (2,8): removed 5 balls of color B, got 9 points.
Move 14 at (1,6): removed 4 balls of color G, got 4 points.
Move 15 at (1,1): removed 2 balls of color R, got 0 points.
Move 16 at (1,1): removed 3 balls of color G, got 1 points.
Move 17 at (1,1): removed 3 balls of color R, got 1 points.
Move 18 at (1,1): removed 2 balls of color G, got 0 points.
Move 19 at (1,1): removed 2 balls of color R, got 0 points.
Move 20 at (1,1): removed 2 balls of color G, got 0 points.
Move 21 at (1,1): removed 2 balls of color R, got 0 points.
Move 22 at (1,2): removed 2 balls of color G, got 0 points.
Move 23 at (1,1): removed 2 balls of color B, got 0 points.
Move 24 at (1,1): removed 2 balls of color R, got 0 points.
Final score: 2016, with 0 balls remaining. GRBGBBRGBRBGGBG
BBGGGBBBRGRRGGR
BGRRRRBGBGRGBBB
RBGRBGBGBRBRGRR
RRGGGGGGRBBBBGB
RBRBRRRGRRGRRBG
RBBGRGBGGRRBBBR
RGRGGBBBGGRBGRG
GRGBGBRBGBRGRRR
BBRGBGGGBGGGGRB
Game 15: Move 1 at (6,3): removed 16 balls of color G, got 196 points.
Move 2 at (3,1): removed 11 balls of color R, got 81 points.
Move 3 at (2,6): removed 10 balls of color B, got 64 points.
Move 4 at (3,4): removed 9 balls of color G, got 49 points.
Move 5 at (2,5): removed 15 balls of color R, got 169 points.
Move 6 at (2,4): removed 12 balls of color B, got 100 points.
Move 7 at (1,7): removed 8 balls of color G, got 36 points.
Move 8 at (3,1): removed 7 balls of color B, got 25 points.
Move 9 at (2,1): removed 5 balls of color G, got 9 points.
Move 10 at (2,3): removed 5 balls of color G, got 9 points.
Move 11 at (1,9): removed 5 balls of color R, got 9 points.
Move 12 at (1,7): removed 8 balls of color B, got 36 points.
Move 13 at (1,5): removed 5 balls of color R, got 9 points.
Move 14 at (2,6): removed 4 balls of color R, got 4 points.
Move 15 at (1,7): removed 4 balls of color G, got 4 points.
Move 16 at (1,4): removed 6 balls of color B, got 16 points.
Move 17 at (2,2): removed 4 balls of color R, got 4 points.
Move 18 at (1,3): removed 4 balls of color G, got 4 points.
Move 19 at (1,1): removed 5 balls of color B, got 9 points.
Move 20 at (1,2): removed 2 balls of color G, got 0 points.
Move 21 at (1,1): removed 2 balls of color R, got 0 points.
Final score: 833, with 3 balls remaining. GRRRGRGBBGBBRGB
RGBRRRBRBGBBBGR
RGRBGBBGRBBGBRB
RGGGGBBRGBGBBRB
RBGBRBGBBRBGBRG
RGBRBRGBRGBGGGG
RGRRRGGGRRRGBGB
GRRRBRBGGBRBBBR
RGRGRGRBGRGGGRB
BBRRRRGGGRRBBBB
Game 16: Move 1 at (3,2): removed 13 balls of color R, got 121 points.
Move 2 at (7,10): removed 12 balls of color B, got 100 points.
Move 3 at (7,9): removed 13 balls of color G, got 121 points.
Move 4 at (1,6): removed 11 balls of color G, got 81 points.
Move 5 at (4,6): removed 12 balls of color B, got 100 points.
Move 6 at (1,6): removed 13 balls of color R, got 121 points.
Move 7 at (3,1): removed 7 balls of color G, got 25 points.
Move 8 at (2,1): removed 8 balls of color R, got 36 points.
Move 9 at (2,11): removed 6 balls of color B, got 16 points.
Move 10 at (3,13): removed 6 balls of color R, got 16 points.
Move 11 at (1,12): removed 8 balls of color B, got 36 points.
Move 12 at (1,10): removed 6 balls of color G, got 16 points.
Move 13 at (3,3): removed 5 balls of color B, got 9 points.
Move 14 at (1,1): removed 4 balls of color B, got 4 points.
Move 15 at (1,1): removed 4 balls of color G, got 4 points.
Move 16 at (1,1): removed 4 balls of color R, got 4 points.
Move 17 at (4,2): removed 4 balls of color R, got 4 points.
Move 18 at (2,2): removed 3 balls of color G, got 1 points.
Move 19 at (1,3): removed 3 balls of color G, got 1 points.
Move 20 at (1,3): removed 3 balls of color B, got 1 points.
Move 21 at (1,2): removed 3 balls of color R, got 1 points.
Final score: 818, with 2 balls remaining. RRGGGBBGBGBGBRG
RBRGRRGRBGGBGBG
GBBBBRBBGRRRGBB
GBBBGGRRGRGRBGR
BBBGGBRGRRBRGRB
GRRBRGGBGBRBRBB
GRGGGGGGGRBRGRR
BBBGBGBRRGRBRGR
RGRBRRGBGRRGGBG
BRRBRRRRGRGRGGB
Game 17: Move 1 at (4,3): removed 12 balls of color G, got 100 points.
Move 2 at (6,1): removed 10 balls of color B, got 64 points.
Move 3 at (3,1): removed 9 balls of color B, got 49 points.
Move 4 at (1,2): removed 8 balls of color R, got 36 points.
Move 5 at (4,6): removed 8 balls of color R, got 36 points.
Move 6 at (1,5): removed 7 balls of color R, got 25 points.
Move 7 at (1,2): removed 9 balls of color G, got 49 points.
Move 8 at (1,1): removed 6 balls of color B, got 16 points.
Move 9 at (1,3): removed 7 balls of color G, got 25 points.
Move 10 at (2,1): removed 5 balls of color G, got 9 points.
Move 11 at (1,1): removed 4 balls of color R, got 4 points.
Move 12 at (1,4): removed 4 balls of color R, got 4 points.
Move 13 at (2,2): removed 4 balls of color B, got 4 points.
Move 14 at (1,2): removed 6 balls of color R, got 16 points.
Move 15 at (1,2): removed 4 balls of color G, got 4 points.
Move 16 at (2,3): removed 4 balls of color G, got 4 points.
Move 17 at (3,3): removed 5 balls of color R, got 9 points.
Move 18 at (1,1): removed 5 balls of color B, got 9 points.
Move 19 at (2,1): removed 6 balls of color R, got 16 points.
Move 20 at (1,1): removed 7 balls of color G, got 25 points.
Move 21 at (1,1): removed 8 balls of color B, got 36 points.
Move 22 at (1,1): removed 3 balls of color G, got 1 points.
Move 23 at (2,2): removed 3 balls of color B, got 1 points.
Move 24 at (1,2): removed 3 balls of color R, got 1 points.
Move 25 at (1,2): removed 2 balls of color G, got 0 points.
Final score: 543, with 1 balls remaining. RRRBBGBRRRGGBBG
RBRGBRGRRGRBGBG
BBRGGBRGGRGGRBG
RRRGBRRRBBGRGGR
BGRBRRBBRRGBRRB
RGGBRRBBBBGRGBR
GRRBGRRRRBBRRBB
RBRGBGBRGRBGBBG
GRGRBBRRGBGRRRB
BGGRRGGBGRBRBRG
Game 18: Move 1 at (5,5): removed 15 balls of color R, got 169 points.
Move 2 at (7,1): removed 10 balls of color R, got 64 points.
Move 3 at (2,5): removed 10 balls of color B, got 64 points.
Move 4 at (2,5): removed 9 balls of color G, got 49 points.
Move 5 at (4,4): removed 5 balls of color B, got 9 points.
Move 6 at (5,2): removed 8 balls of color G, got 36 points.
Move 7 at (5,11): removed 5 balls of color G, got 9 points.
Move 8 at (1,12): removed 5 balls of color R, got 9 points.
Move 9 at (1,13): removed 6 balls of color B, got 16 points.
Move 10 at (4,10): removed 5 balls of color B, got 9 points.
Move 11 at (3,10): removed 7 balls of color R, got 25 points.
Move 12 at (2,11): removed 8 balls of color G, got 36 points.
Move 13 at (4,13): removed 5 balls of color B, got 9 points.
Move 14 at (6,1): removed 4 balls of color B, got 4 points.
Move 15 at (1,4): removed 4 balls of color R, got 4 points.
Move 16 at (1,2): removed 3 balls of color G, got 1 points.
Move 17 at (1,2): removed 3 balls of color R, got 1 points.
Move 18 at (1,1): removed 4 balls of color B, got 4 points.
Move 19 at (1,5): removed 3 balls of color R, got 1 points.
Move 20 at (1,4): removed 5 balls of color B, got 9 points.
Move 21 at (2,4): removed 4 balls of color R, got 4 points.
Move 22 at (1,3): removed 3 balls of color G, got 1 points.
Move 23 at (1,6): removed 3 balls of color R, got 1 points.
Move 24 at (4,7): removed 3 balls of color G, got 1 points.
Move 25 at (1,2): removed 2 balls of color R, got 0 points.
Move 26 at (1,3): removed 2 balls of color G, got 0 points.
Move 27 at (1,2): removed 3 balls of color B, got 1 points.
Move 28 at (2,1): removed 3 balls of color R, got 1 points.
Move 29 at (1,1): removed 2 balls of color G, got 0 points.
Final score: 537, with 1 balls remaining. BGRGBGGGGRBRRRG
RBBGBRBGBRBGBBR
GGBBBBRRGGBRRRR
GGBGBGRRRBRGBGR
BGRGRGRBBGBGRGG
RBRRGRGRRBRGRGR
GRBBRBBBRGGRGRR
BRGBBBBGGGRBGRG
GGRBBGRRRRGBGGG
BBGGRBGBGGRRBBR
Game 19: Move 1 at (4,3): removed 11 balls of color B, got 81 points.
Move 2 at (4,7): removed 9 balls of color R, got 49 points.
Move 3 at (5,4): removed 6 balls of color B, got 16 points.
Move 4 at (3,3): removed 6 balls of color G, got 16 points.
Move 5 at (3,2): removed 10 balls of color R, got 64 points.
Move 6 at (2,5): removed 9 balls of color G, got 49 points.
Move 7 at (8,11): removed 6 balls of color R, got 16 points.
Move 8 at (2,12): removed 6 balls of color G, got 16 points.
Move 9 at (2,12): removed 7 balls of color R, got 25 points.
Move 10 at (2,11): removed 6 balls of color B, got 16 points.
Move 11 at (3,1): removed 5 balls of color B, got 9 points.
Move 12 at (2,1): removed 6 balls of color G, got 16 points.
Move 13 at (2,5): removed 5 balls of color R, got 9 points.
Move 14 at (2,6): removed 5 balls of color B, got 9 points.
Move 15 at (2,5): removed 10 balls of color G, got 64 points.
Move 16 at (3,7): removed 8 balls of color R, got 36 points.
Move 17 at (1,9): removed 9 balls of color G, got 49 points.
Move 18 at (1,5): removed 4 balls of color B, got 4 points.
Move 19 at (1,3): removed 4 balls of color G, got 4 points.
Move 20 at (1,1): removed 3 balls of color B, got 1 points.
Move 21 at (1,3): removed 3 balls of color R, got 1 points.
Move 22 at (1,3): removed 4 balls of color B, got 4 points.
Move 23 at (3,1): removed 2 balls of color G, got 0 points.
Final score: 554, with 6 balls remaining. GGBGGBBRBBGBBBR
GRBRGGRBGGRGRRG
BGBRBRRBBBGBRRR
RBBRGBBGGRBBGRG
RGBRBGBRGBBRRGB
BGRRGRGGGGRGGRR
BRGBBBRBRGGGRBB
GGBRRBBGGRGRBBG
BGGGBRRBBBRBGGG
BBBRGBBGBRGGBGB
Game 20: Move 1 at (5,7): removed 13 balls of color G, got 121 points.
Move 2 at (3,10): removed 9 balls of color R, got 49 points.
Move 3 at (2,8): removed 15 balls of color B, got 169 points.
Move 4 at (1,11): removed 12 balls of color G, got 100 points.
Move 5 at (4,4): removed 8 balls of color B, got 36 points.
Move 6 at (5,3): removed 13 balls of color R, got 121 points.
Move 7 at (1,6): removed 9 balls of color B, got 49 points.
Move 8 at (3,1): removed 8 balls of color G, got 36 points.
Move 9 at (1,1): removed 7 balls of color B, got 25 points.
Move 10 at (4,2): removed 6 balls of color B, got 16 points.
Move 11 at (2,13): removed 6 balls of color R, got 16 points.
Move 12 at (4,1): removed 5 balls of color G, got 9 points.
Move 13 at (1,12): removed 5 balls of color B, got 9 points.
Move 14 at (1,1): removed 4 balls of color R, got 4 points.
Move 15 at (2,5): removed 4 balls of color B, got 4 points.
Move 16 at (2,9): removed 4 balls of color R, got 4 points.
Move 17 at (1,8): removed 7 balls of color G, got 25 points.
Move 18 at (2,6): removed 5 balls of color R, got 9 points.
Move 19 at (1,5): removed 3 balls of color G, got 1 points.
Move 20 at (1,2): removed 2 balls of color G, got 0 points.
Move 21 at (2,3): removed 2 balls of color G, got 0 points.
Final score: 803, with 3 balls remaining.
 

三部曲二(基本算法、动态规划、搜索)-1006-The Same Game的更多相关文章

  1. LeetCode初级算法--动态规划01:爬楼梯

    LeetCode初级算法--动态规划01:爬楼梯 搜索微信公众号:'AI-ming3526'或者'计算机视觉这件小事' 获取更多算法.机器学习干货 csdn:https://blog.csdn.net ...

  2. 算法-动态规划 Dynamic Programming--从菜鸟到老鸟

    算法-动态规划 Dynamic Programming--从菜鸟到老鸟      版权声明:本文为博主原创文章,转载请标明出处. https://blog.csdn.net/u013309870/ar ...

  3. LeetCode探索初级算法 - 动态规划

    LeetCode探索初级算法 - 动态规划 今天在LeetCode上做了几个简单的动态规划的题目,也算是对动态规划有个基本的了解了.现在对动态规划这个算法做一个简单的总结. 什么是动态规划 动态规划英 ...

  4. ASP.NET Core中使用IOC三部曲(二.采用Autofac来替换IOC容器,并实现属性注入)

    前言 本文主要是详解一下在ASP.NET Core中,自带的IOC容器相关的使用方式和注入类型的生命周期. 这里就不详细的赘述IOC是什么 以及DI是什么了.. emm..不懂的可以自行百度. 目录 ...

  5. 算法-动态规划DP小记

    算法-动态规划DP小记 动态规划算法是一种比较灵活的算法,针对具体的问题要具体分析,其宗旨就是要找出要解决问题的状态,然后逆向转化为求解子问题,最终回到已知的初始态,然后再顺序累计各个子问题的解从而得 ...

  6. python基础(9)--递归、二叉算法、多维数组、正则表达式

    1.递归 在函数内部,可以调其他函数,如果一个函数在内部调用它本身,这个函数就是递归函数.递归算法对解决一大类问题是十分有效的,它往往使算法的描述简洁而且易于裂解 递归算法解决问题的特点: 1)递归是 ...

  7. hihocoder#1098 : 最小生成树二·Kruscal算法

    #1098 : 最小生成树二·Kruscal算法 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 随着小Hi拥有城市数目的增加,在之间所使用的Prim算法已经无法继续使用 ...

  8. Hihocoder #1098 : 最小生成树二·Kruskal算法 ( *【模板】 )

    #1098 : 最小生成树二·Kruscal算法 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 随着小Hi拥有城市数目的增加,在之间所使用的Prim算法已经无法继续使用 ...

  9. 垃圾回收GC:.Net自己主动内存管理 上(二)内存算法

    垃圾回收GC:.Net自己主动内存管理 上(二)内存算法 垃圾回收GC:.Net自己主动内存管理 上(一)内存分配 垃圾回收GC:.Net自己主动内存管理 上(二)内存算法 垃圾回收GC:.Net自己 ...

  10. 分布式共识算法 (二) Paxos算法

    系列目录 分布式共识算法 (一) 背景 分布式共识算法 (二) Paxos算法 分布式共识算法 (三) Raft算法 分布式共识算法 (四) BTF算法 一.背景 1.1 命名 Paxos,最早是Le ...

随机推荐

  1. html、css 【珍藏】

       行内元素:会在水平方向排列,不能包含块级元素,设置width无效,height无效(可以设置line-height),margin上下无效,padding上下无效.     块级元素: 各占据一 ...

  2. 动态创建的DOM元素进行事件绑定

    http://files.cnblogs.com/files/xsmhero/jquery.livequery.js <script type="text/javascript&quo ...

  3. Django migrations 重命名

    1:如果migrations文件中想要重命名文件,重命名后有一次修改models文件,再次执行python makegirations ******,再次执行migrate的时候发现报错了,在我往后的 ...

  4. php新手常用的函数(随时更新)

    //数字保留两位小数 $n = sprintf("%1.2f", $n); //方法二 $n = number_format($n, 2, '.', ''); //UTF8转GBK ...

  5. Flex http请求

    下面类支持POST和GET请求,请求数据和出错将返回 package com.sole.util { import flash.events.Event; import flash.events.HT ...

  6. python uuid、hex study

    由 import uuid product[“SourceInfo"]["ProductID"] = uuid.uuid4().hex 引起的uuid 一.概述 uuid ...

  7. neon指令,注意事项

    1. vbic_s8 (int8x8_t a, int8x8_t b) 是  ~(ai & bi),一开始理解成  (~ai )& bi 导致出错 2.uint8x8_t vqshrn ...

  8. APP成功上线前的bug解决方案

    首先测试用例设计阶段,设计并维护一个各个功能入口的说明文档.其实这个文档的作用很大,一方面对于bug回归阶段的人来说,这是用于提醒的;另外一个方面,在随机测试的时候,随机程度也能有所提高,测试人员能够 ...

  9. DIV下的DIV居中

    .ParentDIV{ display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; ...

  10. git drupal eclipse

    eclispe如何打补丁https://www.drupal.org/patch/apply打patch,初级详细教程https://www.drupal.org/node/620014