CF1082B Vova and Trophies

题目描述

你现在有 $n$ 枚奖牌,每枚奖牌为金牌或银牌。这些奖牌现在按顺序排成一排。现在你可以调换任意一对奖牌的位置,求金牌最长连续段。

输入格式

输出格式

说明/提示

In the first example Vova has to swap trophies with indices $ 4 $ and $ 10 $ . Thus he will obtain the sequence "GGGGGGGSGS", the length of the longest subsegment of golden trophies is $ 7 $ . In the second example Vova can make no swaps at all. The length of the longest subsegment of golden trophies in the sequence is $ 4 $ . In the third example Vova cannot do anything to make the length of the longest subsegment of golden trophies in the sequence greater than $ 0 $ .