Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

No imagination :)

Revision en1, by Valeri_Stanchev, 2015-06-11 13:29:46

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! :)

Tags help, strings, problem, whoreadstaganyway

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Valeri_Stanchev 2015-06-11 13:35:10 35
en1 English Valeri_Stanchev 2015-06-11 13:29:46 717 Initial revision (published)