Codeforces 841 Generous Kefa(模拟)
来源:互联网 发布:淘宝网店运营策划书 编辑:程序博客网 时间:2024/05/29 17:51
题目地址
题意:给你n个字符,每种字母的个数不超过m。
思路:直接模拟
#include <iostream>#include <cstring>#include <string>#include <queue>#include <vector>#include <map>#include <set>#include <stack>#include <cmath>#include <cstdio>#include <algorithm>#define N 3010#define LL __int64#define inf 0x3f3f3f3f#define lson l,mid,ans<<1#define rson mid+1,r,ans<<1|1#define getMid (l+r)>>1#define movel ans<<1#define mover ans<<1|1using namespace std;const LL mod = 1e9 + 7;map<char, int> mapp;int main() { cin.sync_with_stdio(false); int n, m; string str; while (cin >> n >> m) { cin >> str; for (int i = 0; i < str.length(); i++) { mapp[str[i]]++; } for (map<char, int>::iterator it = mapp.begin(); it != mapp.end(); it++) { if (it->second > m) { cout << "NO" << endl; return 0; } } cout << "YES" << endl; } return 0;}
阅读全文
0 0
- Codeforces 841 Generous Kefa(模拟)
- codeforces 841A Generous Kefa
- codeforces 841A Generous Kefa
- Generous Kefa CodeForces
- Codeforces 429 A. Generous Kefa
- Codeforces Round #429 (Div. 2) 841A Generous Kefa(水)
- CF Generous Kefa(水)
- Codeforces-429-2-A Generous Kefa
- Generous Kefa
- Codeforces Round #429 (Div. 2):A. Generous Kefa
- Codeforces Round #429 (Div. 2) | A. Generous Kefa
- 429A. Generous Kefa
- A. Generous Kefa
- A. Generous Kefa(Round #429 (Div. 2))
- Kefa and Dishes CodeForces
- Codeforces Round #321 Kefa and Dishes(状压DP)
- codeforces 580 D.Kefa and Dishes(状压DP)
- Codeforces #321 E. Kefa and Watch (线段树、哈希)
- C++中string类相关常用功能总结
- 物联网平台概览
- 1linux gcc命令以及c语言动态库静态库编译
- 第十八篇:内部排序之三:堆排序(含完整源码)
- 计算几何模板——凸包
- Codeforces 841 Generous Kefa(模拟)
- Double Queue
- struts2--显示等待页面
- HDU 6154 CaoHaha's staff【找规律】【思维题】【好题】
- 韩信点兵
- 第十九篇:内部排序之四:归并排序和快速排序(含完整源码)
- OFFICE 2016下载与激活
- JAVA开发的23种设计模式之 --- 观察者模式
- BZOJ 2002 分块