Codeforces Gym 100269A Arrangement of Contest 水题
Problem A. Arrangement of Contest
题目连接:
http://codeforces.com/gym/100269/attachments
Description
Little Dmitry and little Petr want to arrange a contest. Their little friends submitted several task
proposals and now Dmitry and Petr want to select some of them for the contest. As they are just little
boys, they cannot estimate quality of tasks, but they know for sure that in good contest title of the first
problem starts with A, the title of the second one — with B, and so on.
Given titles of the proposed tasks, help little brothers to determine the maximal number of problems in
a good contest they can arrange.
Input
The first line contains single integer n — the number of problem proposals received by the little
brothers (1 ≤ n ≤ 100).
Next n lines contain titles of proposed problems, one per line. The length of each title does not exceed
30 characters. Each title starts with an uppercase letter and contains only English letters, digits and
underscores.
Output
Output a single number — the maximal number of problems in a good contest. In case there is no good
contest that may be arranged, output 0.
Sample Input
12
Arrangement of Contest
Ballot Analyzing Device
Correcting Curiosity
Dwarf Tower
Energy Tycoon
Flight Boarding Optimization
Garage
Heavy Chain Clusterization
Intellectual Property
J
Kids in a Friendly Class
Lonely Mountain
Sample Output
12
Hint
题意
问这些句子的首字母最长连接到什么位置……
题解:
阅读题
代码
#include<bits/stdc++.h>
using namespace std;
int num = 0;
int ans = 0;
string s;
int vis[30];
int main()
{
freopen("arrange.in","r",stdin);
freopen("arrange.out","w",stdout);
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
cin>>s;
vis[s[0]-'A']=1;
}
for(int i=0;i<27;i++)
if(vis[i]==0)
{
cout<<i<<endl;
return 0;
}
}
Codeforces Gym 100269A Arrangement of Contest 水题的更多相关文章
- codeforces Gym 100187H H. Mysterious Photos 水题
H. Mysterious Photos Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/p ...
- codeforces Gym 100500H H. ICPC Quest 水题
Problem H. ICPC QuestTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/a ...
- Codeforces Gym 100513F F. Ilya Muromets 水题
F. Ilya Muromets Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100513/probl ...
- Educational Codeforces Round 7 B. The Time 水题
B. The Time 题目连接: http://www.codeforces.com/contest/622/problem/B Description You are given the curr ...
- Educational Codeforces Round 7 A. Infinite Sequence 水题
A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/622/problem/A Description Consider the ...
- Codeforces Testing Round #12 A. Divisibility 水题
A. Divisibility Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/597/probl ...
- Codeforces Beta Round #37 A. Towers 水题
A. Towers 题目连接: http://www.codeforces.com/contest/37/problem/A Description Little Vasya has received ...
- Codeforces Gym 100269B Ballot Analyzing Device 模拟题
Ballot Analyzing Device 题目连接: http://codeforces.com/gym/100269/attachments Description Election comm ...
- Codeforces - 1194B - Yet Another Crosses Problem - 水题
https://codeforc.es/contest/1194/problem/B 好像也没什么思维,就是一个水题,不过蛮有趣的.意思是找缺黑色最少的行列十字.用O(n)的空间预处理掉一维,然后用O ...
随机推荐
- 任务调度框架kunka
kunka kunka是一个任务调度框架.用户只需要在Task接口中实现自己要执行的功能,并且选择合适的执行器,放入TaskManager中,就可以了完成整个任务了. 实现细节 整个任务信息存放在内存 ...
- Django【设计】settings方案
配置文件: 目标:配置文件,默认配置和手动配置分开,参考django的配置文件方案,默认配置文件放在内部,只让用户做常用配置 /bin/settings.py(手动配置) PLUGIN_ITE ...
- (八)hope
vi svnserve.conf vi passwdvi authz svnserve -d -r /usr/svnkillall svnserveps -ef | grep svnserve svn ...
- Linux抓包工具tcpdump
Linux抓包工具tcpdump http://www.xuchanggang.cn/archives/1107.html
- [session篇]看源码学习session(一)
假如你是使用过或学习过PHP,你一定觉得很简单.session只不过是$_SESSION就可以搞得,这还不简单只是对一个key-value就能工作了.我觉得可以大多数的phper都是这样的,这是语言本 ...
- $scope作用及模块化解决全局问题
$scope对象就是一个普通的JavaScript对象,我们可以在其上随意修改或添加属性.$scope对象在AngularJS中充当数据模型,但与传统的数据模型不一样,$scope并不负责处理和操作数 ...
- 【数位dp入门】【HDU2089】62
为了我的点歪的技能树…… 所以开始补一些sb的东西…… #include<bits/stdc++.h> typedef long long ll; using namespace std; ...
- VI编辑,backspace无法删除解决方法
系统ubuntu 1,sudo apt-get install vim 安装vim 2, sudo vi /etc/vim/vimrc.tiny 修改 set compatible为set noc ...
- Hadoop(hadoop,HBase)组件import到eclipse
1.简介: 将源代码import到eclipse可以方便的阅读和修改源码. 2.环境说明: mac mvn工具(Apache Maven 3.3.3 ) 3.hadoop(CDH5.4.2) 1.进入 ...
- 12-4 NSString
原文:http://rypress.com/tutorials/objective-c/data-types/nsstring NSString 在本教程的内容可能我们已经看到过很多次了,NSStri ...