题解——Codeforces Round #508 (Div. 2) T1 (模拟)
依照题意暴力模拟即可A掉
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <set>
using namespace std;
char s[];
int n,k,barrel[];
int main(){
scanf("%d %d",&n,&k);
scanf("%s",s+);
for(int i=;i<=n;i++)
barrel[s[i]-'A'+]++;
int ans=0x3f3f3f3f;
for(int i=;i<=k;i++)
ans=min(ans,barrel[i]);
printf("%d\n",ans*k);
return ;
}
题解——Codeforces Round #508 (Div. 2) T1 (模拟)的更多相关文章
- 题解——Codeforces Round #508 (Div. 2) T3 (贪心)
贪心的选取最优解 然后相减好 记得要开long long #include <cstdio> #include <algorithm> #include <cstring ...
- 题解——Codeforces Round #508 (Div. 2) T2 (构造)
按照题意构造集合即可 注意无解情况的判断 #include <cstdio> #include <algorithm> #include <cstring> #in ...
- Codeforces Round #508 (Div. 2)
Codeforces Round #508 (Div. 2) http://codeforces.com/contest/1038 A #include<bits/stdc++.h> us ...
- [题解] Codeforces Round #549 (Div. 2) B. Nirvana
Codeforces Round #549 (Div. 2) B. Nirvana [题目描述] B. Nirvana time limit per test1 second memory limit ...
- Codeforces 1038F Wrap Around (Codeforces Round #508 (Div. 2) F) 题解
写在前面 此题数据量居然才出到\(n=40\)???(黑人问号)以下给出一个串长\(|S|=100,n=10^9\)的题解. 题目描述 给一个长度不超过\(m\)的01串S,问有多少个长度不超过\(n ...
- Codeforces Round #508 (Div. 2) D. Slime
D. Slime 题目链接:https://codeforces.com/contest/1038/problem/D 题意: 给出两个数,然后每次可以对相邻的两个数合并,比如x,y,那么合并过后就是 ...
- Codeforces Round #366 (Div. 2) C 模拟queue
C. Thor time limit per test 2 seconds memory limit per test 256 megabytes input standard input outpu ...
- Codeforces Round #508 (Div. 2) E. Maximum Matching(欧拉路径)
E. Maximum Matching 题目链接:https://codeforces.com/contest/1038/problem/E 题意: 给出n个项链,每条项链左边和右边都有一种颜色(范 ...
- Codeforces Round #281 (Div. 2) B 模拟
B. Vasya and Wrestling time limit per test 2 seconds memory limit per test 256 megabytes input stand ...
随机推荐
- sitecore系列教程之Sitecore个性化-试点开始,测试,优化,增量
这是利用Sitecore的个性化引擎实现数字化转型的三部分系列的第三部分.之前的帖子旨在通过为您的个性化体验定义内容策略并在Sitecore中配置该策略来设置基础. 在此之前,我们讨论了内容策略以 ...
- python之小数据池
代码块 Python 程序 是由代码块构造的.块是一个python程序的文本,它是作为一个执行单元的. 代码块:一个模块,一个函数,一个类,一个文件等都是一个代码块. 而作为交互方式输入的每个命令都是 ...
- 在hue中使用hive
一.创建新表 建表语句如下: CREATE TABLE IF NOT EXISTS user_collection_9( user_id string , seller_id string , pro ...
- Linux基础命令---pgrep
pgrep pgrep指令可以按名字或者其他属性搜索指定的进程,显示出进程的id到标准输出. 此命令的适用范围:RedHat.RHEL.Ubuntu.CentOS.SUSE.openSUSE.Fedo ...
- 关于Ajax无法下载文件到浏览器本地的问题
最近在做网站的时候遇到这样一个功能,在如图所示的页面中,需要用户点击链接的时候,能够以异步Ajax的方式判断服务器中是否存储有相应的Excel文件,如果没有的话就提示用户没有找到,如果有的话就下载到用 ...
- LCA 最近公共祖先 (模板)
#include <iostream> #include <stdio.h> #include <cstring> #include <vector> ...
- oj练习---dp专题
1.POJ 3744 Scout YYF I 经典的dp模型,但是要用到快速矩阵幂加速,分段的思想 # include <stdio.h> # include <algorithm& ...
- linux 搭建svn(待完成)
http://blog.csdn.net/lazy_cc/article/details/8726500搭建仓库 http://blog.csdn.net/xocoder/article/detail ...
- Sort aborted Error in MySQL Error Log
现象 [ERROR] lines containing "Sort aborted" are present in the MySQL error log file. [Warni ...
- php使用phpexcel导出文件
php使用phpexcel导出文件 首先需要去官网https://github.com/PHPOffice/PHPExcel/下载PHPExcel 代码如下: <?php date_defaul ...