抱歉,您的浏览器无法访问本站

本页面需要浏览器支持(启用)JavaScript


了解详情 >

B1 - Wonderful Coloring - 1

This is a simplified version of the problem B2. Perhaps you should read the problem B2 before you start solving B1.

Paul and Mary have a favorite string which consists of lowercase letters of the Latin alphabet. They want to paint it using pieces of chalk of two colors: red and green. Let's call a coloring of a string wonderful if the following conditions are met:

  1. each letter of the string is either painted in exactly one color (red or green) or isn't painted;
  2. each two letters which are painted in the same color are different;
  3. the number of letters painted in red is equal to the number of letters painted in green;
  4. the number of painted letters of this coloring is maximum among all colorings of the string which meet the first three conditions.

E.




博客内容遵循 [署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 协议](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)
本站总访问量为 访客数为
本站使用 Volantis 作为主题