当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。
Given a chain of N (1 ≤ N ≤ 106) balls colored either red (‘R’), green (‘G’) or blue (‘B’) and numbered sequentially 1 through N from left to right, a game proceeds as follows:
Write a program to simulate the process of a game.
The input contains only a string of ‘R’s, ‘G’s and ‘B’s representing the balls in the chain from left to right.
For each segment dislodged, output whatever is reported following the sample output’s example.
GRRBBBRRGB
B 4 5 6 R 2 3 7 8 G 1 9
Case time limit(单组数据时间限制) | 2500MS |
时间上限 | 内存上限 |
4000 | 131072 |