Fifi的天马行空

关注

CodeForces - 841A Generous Kefa——思路题

Fifi的天马行空

关注

阅读 73

2022-08-17


#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k; cin >> n >> k;
string s; cin >> s;
int cnt[30] = {0};
for (int i = 0; i < s.size(); i++) {
cnt[s[i] - 'a']++;
}
bool ok = true;
for (int i = 0; i < 26; i++) {
if (cnt[i] > k) {
ok = false; break;
}
}
if (ok) cout << "YES" << endl;
else cout << "NO" << endl;
return 0;
}


相关推荐

兮城

CodeForces - 841B Godsend——思路题

兮城 47 0 0

那小那小

CodeForces - 841C Leha and Function——思路题

那小那小 46 0 0

言诗把酒

Kefa and Watch CodeForces - 580E

言诗把酒 77 0 0

googlefrank

【CodeForces - 580D】Kefa and Dishes (状压dp)

googlefrank 18 0 0

沪钢木子

Kefa and Park CodeForces - 580(dfs,如何判断叶子结点)

沪钢木子 41 0 0

丹柯yx

#yyds干货盘点# LeetCode刷题集841 - 850

丹柯yx 56 0 0

Raow1

【4.11】Codeforces 刷题

Raow1 50 0 0

爱情锦囊

2024年MathorCup数学建模思路A题B题C题D题思路分享

爱情锦囊 10 0 0

青青子衿谈育儿

算法题的思路

青青子衿谈育儿 97 0 0

彭维盛

Codeforces刷题导航

彭维盛 23 0 0

精彩评论(0)

0 0 举报