https://i2.wp.com/eblogarithm.com/wp-content/uploads/2017/08/Codeforces-Round-429-Div-2-problem-A-Generous-Kefa-Solution-in-CC1.png?fit=640%2C360

Codeforces Round #429 (Div. 2), problem: (A) Generous Kefa Solution in C/C++

#include<iostream>
using namespace std;
int i,j,n,k,a[26];
string s;
main(){
for(cin>>n>>k>>s;i<s.size();)a[s[i++]-‘a’]++;
for(i=0;j<26;)a[j++]>k?i=1:0;
cout<<(i?”NO\n”:”YES\n”);
}

(Visited 97 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: