三部曲二(基本算法、动态规划、搜索)-1006-The Same Game
| Time Limit: 1000MS | Memory Limit: 10000K | |
| Total Submissions: 4585 | Accepted: 1699 |
Description
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
Output
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的更多相关文章
- LeetCode初级算法--动态规划01:爬楼梯
LeetCode初级算法--动态规划01:爬楼梯 搜索微信公众号:'AI-ming3526'或者'计算机视觉这件小事' 获取更多算法.机器学习干货 csdn:https://blog.csdn.net ...
- 算法-动态规划 Dynamic Programming--从菜鸟到老鸟
算法-动态规划 Dynamic Programming--从菜鸟到老鸟 版权声明:本文为博主原创文章,转载请标明出处. https://blog.csdn.net/u013309870/ar ...
- LeetCode探索初级算法 - 动态规划
LeetCode探索初级算法 - 动态规划 今天在LeetCode上做了几个简单的动态规划的题目,也算是对动态规划有个基本的了解了.现在对动态规划这个算法做一个简单的总结. 什么是动态规划 动态规划英 ...
- ASP.NET Core中使用IOC三部曲(二.采用Autofac来替换IOC容器,并实现属性注入)
前言 本文主要是详解一下在ASP.NET Core中,自带的IOC容器相关的使用方式和注入类型的生命周期. 这里就不详细的赘述IOC是什么 以及DI是什么了.. emm..不懂的可以自行百度. 目录 ...
- 算法-动态规划DP小记
算法-动态规划DP小记 动态规划算法是一种比较灵活的算法,针对具体的问题要具体分析,其宗旨就是要找出要解决问题的状态,然后逆向转化为求解子问题,最终回到已知的初始态,然后再顺序累计各个子问题的解从而得 ...
- python基础(9)--递归、二叉算法、多维数组、正则表达式
1.递归 在函数内部,可以调其他函数,如果一个函数在内部调用它本身,这个函数就是递归函数.递归算法对解决一大类问题是十分有效的,它往往使算法的描述简洁而且易于裂解 递归算法解决问题的特点: 1)递归是 ...
- hihocoder#1098 : 最小生成树二·Kruscal算法
#1098 : 最小生成树二·Kruscal算法 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 随着小Hi拥有城市数目的增加,在之间所使用的Prim算法已经无法继续使用 ...
- Hihocoder #1098 : 最小生成树二·Kruskal算法 ( *【模板】 )
#1098 : 最小生成树二·Kruscal算法 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 随着小Hi拥有城市数目的增加,在之间所使用的Prim算法已经无法继续使用 ...
- 垃圾回收GC:.Net自己主动内存管理 上(二)内存算法
垃圾回收GC:.Net自己主动内存管理 上(二)内存算法 垃圾回收GC:.Net自己主动内存管理 上(一)内存分配 垃圾回收GC:.Net自己主动内存管理 上(二)内存算法 垃圾回收GC:.Net自己 ...
- 分布式共识算法 (二) Paxos算法
系列目录 分布式共识算法 (一) 背景 分布式共识算法 (二) Paxos算法 分布式共识算法 (三) Raft算法 分布式共识算法 (四) BTF算法 一.背景 1.1 命名 Paxos,最早是Le ...
随机推荐
- NSISの堆栈操作
一 .堆栈 堆栈是 NSIS 维护的一堆数据,你可以根据需要往堆栈中存入任意大小的数据(as big as you like),所以你可以向堆栈中推入或读取数据,堆栈只有一个,堆栈遵守 LIFO (后 ...
- Java开发中经典的小实例-(do{}while())
import java.util.Scanner;public class Test13 { public static void main(String[] args) { // ...
- 怎样让webservice在浏览器远程浏览时像在本地浏览一样有参数输入框
从远程客户端访问服务器上的WebService能够显示,但点击调用相关的方法时显示“只能用于来自本地计算机的请求”,这时提醒我们还需要在服务器进行相关的配置才能让其他机器正常访问该WebService ...
- 【java】关于时间
import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; /** * Created b ...
- C#浅拷贝与深拷贝区别
也许会有人这样解释C# 中浅拷贝与深拷贝区别: 浅拷贝是对引用类型拷贝地址,对值类型直接进行拷贝. 不能说它完全错误,但至少还不够严谨.比如:string 类型咋说? 其实,我们可以通过实践来寻找答案 ...
- CSS3中的2D转换
通过 CSS3 转换,我们能够对元素进行移动.缩放.转动.拉长或拉伸. 转换是使元素改变形状.尺寸和位置的一种效果. 注:Internet Explorer 10.Firefox 以及 Opera 支 ...
- collectionView布局原理及瀑布流布局方式
一直以来都想研究瀑布流的具体实现方法(起因是因为一则男女程序员应聘的笑话,做程序的朋友应该都知道).最近学习到了瀑布流的实现方法,瀑布流的实现方式有多种,这里应用collectionView来重写其U ...
- 理解RxJava线程模型
RxJava作为目前一款超火的框架,它便捷的线程切换一直被人们津津乐道,本文从源码的角度,来对RxJava的线程模型做一次深入理解.(注:本文的多处代码都并非原本的RxJava的源码,而是用来说明逻辑 ...
- [css] CSS相对定位|绝对定位
第一篇链接:http://www.zhangxinxu.com/wordpress/2010/12/css-%E7%9B%B8%E5%AF%B9%E7%BB%9D%E5%AF%B9%E5%AE%9A% ...
- spring boot初探
又被领导鄙视了,说让先把程序跑起来,再去研究深层次的东西.. 我又一次没有学会走就要开始跑了..说干就干 eclipse mars下载 新建maven project 加依赖 <dependen ...