Codeforces 1108D
题目链接: http://codeforces.com/problemset/problem/1108/D time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have a garland consisting of n lamps. Each lamp is colored red, green or blue. The color of the i-th lamp is si ('R', 'G' and 'B' — colors of lamps in the garland). You have to recolor some lamps in this garland (recoloring a lamp means changing its initial color to another) in such a way that the obtained garland is diverse. A garland is called diverse if any two adjacent (consecutive) lamps (i. e. such lamps that the