Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

Interesting problem about strings :)

Правка en2, от Valeri_Stanchev, 2015-06-11 13:35:10

Hello everybody,

I need your help! Given a string S (|S| <= 10^5) consisting of uppercase letters and an integer K (K <= |S|). Consider a set consisting of all uppercase letters. We are to choose some letters from that set and replace their occurences in S with a star ('*'). Our goal is to make at least one star appear in each substring of length K and we need to do this choosing minimum number of different letters from the set. Output the minimum number of letters and the letters in different lines. If multiple solutions exist, we can print any of them. For example, if S="ABA" and K=2, then we can choose either 'A' or 'B' and receive "*B*" and "A*A" respectively.

Thanks in advance! :)

Теги help, strings, problem, whoreadstaganyway

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Valeri_Stanchev 2015-06-11 13:35:10 35
en1 Английский Valeri_Stanchev 2015-06-11 13:29:46 717 Initial revision (published)