{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"名为“Same”的游戏是在一个10 x 15的棋盘上进行的单人游戏。每个方格都包含着红色(R)、绿色(G)或蓝色(B)的球。如果两个球具有相同的颜色,并且一个可以通过向上、向下、向左和向右四个方向上的相同颜色的球到达另一个球,那么它们属于同一簇。在游戏的每个步骤中,玩家选择一个至少有两个球的簇并将该簇中的所有球从棋盘上移除。然后,棋盘会经过“压缩”两个步骤:\n\u003cbr\u003e1. 将每一列中剩下的球向下移动以填补空白空间。每一列中球的顺序将被保留。\n\u003cbr\u003e2. 如果一列变为空,将剩余的列尽可能地向左移动。列的顺序将被保留。\n\u003cbr\u003e例如,在下面的子棋盘中选择左下角的球将导致:\n\u003cbr\u003e\u003cimg src\u003d\"CDN_BASE_URL/180fe98f1dcd4ab1f5f14e43bad852ff?v\u003d1699445523\"\u003e\n\u003cbr\u003e游戏的目标是将棋盘上的每个球都移除,当每个球都被移除或者每个簇只剩下一个球时,游戏结束。每个游戏的得分如下。玩家开始时得分为0。当移除一个有m个球的簇时,玩家的得分增加(m-2)^2分。如果在游戏结束时所有的球都被移除,将获得额外的1000分。\n\u003cbr\u003e你怀疑一个好的策略也许是在每一步中选择能够获得最大可能簇的球,你想编写一个程序来模拟使用这一策略进行游戏。如果有两个或更多的球可供选择,程序应该选择最左边的能够获得最大簇的球。如果仍然存在平局,应该选择这些最左边的球中最下面的球。"}},{"title":"Input","value":{"format":"HTML","content":"输入中会给出多个游戏。输入的第一行包含一个正整数,表示接下来会有多少个游戏。每个游戏的初始球的排列都是一行一行给出的,从上到下。每一行包含15个字符,每个字符都是“R”、“G”或“B”中的一个,指定了从左到右该行中球的颜色。每个游戏之间会有一个空行。"}},{"title":"Output","value":{"format":"HTML","content":"对于每个游戏,打印游戏编号,然后换行,接着打印关于每一步移动的信息,最后是最终得分。每一步移动都应该以如下格式打印:\n\u003cbr\u003e第x步:选择(r,c)位置的球:移除了b个颜色为C的球,得到了s分。\n\u003cbr\u003e其中x是移动的编号,r和c分别是选择的球的行号和列号。行号从底部编号为1到10,列号从左边编号为1到15。b是移除的簇中的球的数量。C是“R”、“G”或“B”中的一个,表示移除的球的颜色。s是这一步的得分。得分不包括在移动后所有的球都被移除时的1000分奖励。\n\u003cbr\u003e最终得分应该报告如下:\n\u003cbr\u003e最终得分:s,剩下b个球。\n\u003cbr\u003e在每个游戏的输出之间插入一个空行。即使对应的值为1,也要使用“球”和“分”的复数形式。"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3 \nRGGBBGGRBRRGGBG \nRBGRBGRBGRBGRBG\nRRRRGBBBRGGRBBB\nGGRGBGGBRRGGGBG\nGBGGRRRRRBGGRRR\nBBBBBBBBBBBBBBB\nBBBBBBBBBBBBBBB\nRRRRRRRRRRRRRRR\nRRRRRRGGGGRRRRR\nGGGGGGGGGGGGGGG\n\nRRRRRRRRRRRRRRR\nRRRRRRRRRRRRRRR\nGGGGGGGGGGGGGGG\nGGGGGGGGGGGGGGG\nBBBBBBBBBBBBBBB\nBBBBBBBBBBBBBBB\nRRRRRRRRRRRRRRR\nRRRRRRRRRRRRRRR \nGGGGGGGGGGGGGGG\nGGGGGGGGGGGGGGG\n\nRBGRBGRBGRBGRBG\nBGRBGRBGRBGRBGR\nGRBGRBGRBGRBGRB\nRBGRBGRBGRBGRBG\nBGRBGRBGRBGRBGR\nGRBGRBGRBGRBGRB\nRBGRBGRBGRBGRBG\nBGRBGRBGRBGRBGR\nGRBGRBGRBGRBGRB\nRBGRBGRBGRBGRBG\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eGame 1: \n\nMove 1 at (4,1): removed 32 balls of color B, got 900 points. \nMove 2 at (2,1): removed 39 balls of color R, got 1369 points. \nMove 3 at (1,1): removed 37 balls of color G, got 1225 points. \nMove 4 at (3,4): removed 11 balls of color B, got 81 points. \nMove 5 at (1,1): removed 8 balls of color R, got 36 points. \nMove 6 at (2,1): removed 6 balls of color G, got 16 points. \nMove 7 at (1,6): removed 6 balls of color B, got 16 points. \nMove 8 at (1,2): removed 5 balls of color R, got 9 points. \nMove 9 at (1,2): removed 5 balls of color G, got 9 points. \nFinal score: 3661, with 1 balls remaining. \n\nGame 2: \n\nMove 1 at (1,1): removed 30 balls of color G, got 784 points. \nMove 2 at (1,1): removed 30 balls of color R, got 784 points. \nMove 3 at (1,1): removed 30 balls of color B, got 784 points. \nMove 4 at (1,1): removed 30 balls of color G, got 784 points. \nMove 5 at (1,1): removed 30 balls of color R, got 784 points. \nFinal score: 4920, with 0 balls remaining. \n\nGame 3: \n\nFinal score: 0, with 150 balls remaining. \u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}