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 ...
随机推荐
- 定制LFS镜像及安装过程
定制LFS镜像及安装过程 http://blog.csdn.net/decload/article/details/7407698 一.定制LFS镜像 定制LFS镜像的思想是在已构建完成 ...
- hadoop安装 伪分布
伪分布hadoop 安装总结 准备,在配置中hadoop用的9000端口,如果有其它软件用着这个端口,建议更换后再进行下面配置,以避免出现错误.比如php-fpm经常使用9000端口. 一.下载jdk ...
- edittext 的一个案例
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= ...
- [hadoop][会装]zookeeper安装
1.简介 分布式场景下的各个进程间的协调运作离不开zookeeper, zookeeper已经是大数据领域提供分布式协调服务的事实标准. 本文只介绍zookeeper的安装方法. 2. 节点规划如下: ...
- django 上传图片、使用PIL制作缩略图并保存到sea的storage
上传图片解析: SAE的设置指引如下: 处理用户上传文件 在setttings.py中添加以下配置. # 修改上传时文件在内存中可以存放的最大size为10m FILE_UPLOAD_MAX_MEMO ...
- Centos7 环境准备
Centos7 环境准备 #关闭防火墙 systemctl stop firewalld systemctl disable firewalld #关闭selinux sed -i 's/SELINU ...
- maven设置打jar包并引入依赖包
--------------------------------------------------------方法一:将jar包和项目打在一起---------------------------- ...
- window下线程同步之(Semaphores(信号量))
HANDLE WINAPI CreateSemaphore( _In_opt_ LPSECURITY_ATTRIBUTES lpSemaphoreAttributes _In_ LONG lIniti ...
- OpenFalcon-SuitAgent
http://www.cnblogs.com/qianlong2016/archive/2016/09/08/5853899.html
- lr_Vugen界面图