三部曲二(基本算法、动态规划、搜索)-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 ...
随机推荐
- Java菜鸟培训第二天
HTML——超文本标记语言…………… 静态网页:不需要访问数据库. 动态网页:在网上发布的好的,我们能通过网络浏览到的都是动态的,需要访问数据库. <html>--开始标签 <hea ...
- HDU 4947 GCD Array 容斥原理+树状数组
GCD Array Time Limit: 11000/5500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total ...
- elasticsearch之python备份
一:elasticsearch原理 Elasticsearch是一个基于Apache Lucene(TM)的开源搜索引擎.无论在开源还是专有领域,Lucene可以被认为是迄今为止最先进.性能最好的.功 ...
- Hadoop集群环境搭建
----------------------------------------------------------- 自学记录,交流学习请发送邮件至gxz1984@gmail.com ------- ...
- 利用win7系统自带的dos命令把笔记本无线网卡当无线路由器(无线AP发射器)
利用win7系统自带的dos命令把笔记本无线网卡当无线路由器(无线AP发射器). 1.打开win7开始菜单,找到命令提示符选项,以管理员身份运行cmd.2.在命令行上输入:netsh wlan set ...
- Cheatsheet: 2015 06.01 ~ 06.30
Web The Front-End Optimization Checklist [ASP.NET 5] Production Ready Web Server on Linux. Kestrel + ...
- nodejs的express使用介绍
Express框架 来自<JavaScript 标准参考教程(alpha)>,by 阮一峰 目录 概述 运行原理 底层:http模块 什么是中间件 use方法 Express的方法 all ...
- Http 状态码对照表
1xx 消息 1. 100 Continue 2. 101 Switching Protocol 3. 102 Processing 2xx 成功 1. 200 OK ...
- phonegap开发经验谈之一命令行建立项目和准备工作
一安装与配置 安装命令行配置,这个可以参见网上的.3.0的最好用命令行配置. 大家在安装android sdk的时候,会发现里面自带了一个eclipse,并且继承了adt,直接用这个就好了.当然你已经 ...
- SPI总线(同步)
一.SPI总线简介 串行外围设备接口SPI(serial peripheral interface)总线技术是Motorola公司推出的一种同步串行接口.SPI 用 于CPU与各种外围器件进行全双工. ...