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 水题的更多相关文章

  1. codeforces Gym 100187H H. Mysterious Photos 水题

    H. Mysterious Photos Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/p ...

  2. codeforces Gym 100500H H. ICPC Quest 水题

    Problem H. ICPC QuestTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/a ...

  3. Codeforces Gym 100513F F. Ilya Muromets 水题

    F. Ilya Muromets Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100513/probl ...

  4. Educational Codeforces Round 7 B. The Time 水题

    B. The Time 题目连接: http://www.codeforces.com/contest/622/problem/B Description You are given the curr ...

  5. Educational Codeforces Round 7 A. Infinite Sequence 水题

    A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/622/problem/A Description Consider the ...

  6. Codeforces Testing Round #12 A. Divisibility 水题

    A. Divisibility Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/597/probl ...

  7. Codeforces Beta Round #37 A. Towers 水题

    A. Towers 题目连接: http://www.codeforces.com/contest/37/problem/A Description Little Vasya has received ...

  8. Codeforces Gym 100269B Ballot Analyzing Device 模拟题

    Ballot Analyzing Device 题目连接: http://codeforces.com/gym/100269/attachments Description Election comm ...

  9. Codeforces - 1194B - Yet Another Crosses Problem - 水题

    https://codeforc.es/contest/1194/problem/B 好像也没什么思维,就是一个水题,不过蛮有趣的.意思是找缺黑色最少的行列十字.用O(n)的空间预处理掉一维,然后用O ...

随机推荐

  1. linux命令行todo列表管理工具Taskwarrior介绍

    Taskwarrior 是一款在命令行下使用的TODO列表管理工具,或者说任务管理工具,灵活,快速,高效. 安装 在ubuntu 14.04 中,可从官方仓库安装task软件包 sudo apt-ge ...

  2. redis线程安全性

    总体来说快速的原因如下: 1)绝大部分请求是纯粹的内存操作(非常快速) 2)采用单线程,避免了不必要的上下文切换和竞争条件 3)非阻塞IO 内部实现采用epoll,采用了epoll+自己实现的简单的事 ...

  3. DNS解析原理与Bind部署DNS服务

    DNS是什么? DNS(Domain Name System,域名系统)是互联网上最核心的带层级的分布式系统,它负责把域名转换为IP地址.反查IP到域名的反向解析以及宣告邮件路由等信息,使得基于域名提 ...

  4. Asp.net网页中DataGridView数据导出到Excel

    经过上网找资料,终于找到一种可以直接将GridView中数据导出到Excel文件的方法,归纳方法如下: 1. 注:其中的字符集格式若改为“GB2312”,导出的部分数据可能为乱码: 导出之前需要关闭分 ...

  5. redis之(一)redis的简单介绍

    [一]:概念 --->Redis是一个开源的,高性能的,基于键值对的缓存与存储系统 --->Redis数据库中的多有数据都存储在内存中,由于内存的读写速度远快于硬盘,一秒读写超过10万键值 ...

  6. 稍微谈一下 javascript 开发中的 MVC 模式

    随着前台开发日益受到重视,客户端代码比重日益增加的今天,如何在javascript开发里应用MVC模式,这个问题似乎会一直被提到,所以偶在这里粗略的谈一下自己的看法吧. MVC模式的基本理念,是通过把 ...

  7. PyInstaller:把你的Python转为Exe

    把Python程序转为可执行的EXE文件,之前已经介绍过,像py2exe,bbfreeze. 以我自己使用的经历来看,这两款都还不错,比较适合简单的Python程序,如果你加载的第三方类库比较多的话, ...

  8. LOJ #6281. 数列分块入门 5-分块(区间开方、区间求和)

    #6281. 数列分块入门 5 内存限制:256 MiB时间限制:500 ms标准输入输出 题目类型:传统评测方式:文本比较 上传者: hzwer 提交提交记录统计测试数据讨论 5   题目描述 给出 ...

  9. HTTP协议1:工作原理

    http://blog.csdn.net/huangjin0507/article/details/51678858 1. HTTP简介 HTTP协议(HyperText Transfer Proto ...

  10. Sqli-labs less 14

    Less-14 本关我们直接进行测试,输入username:admin" Pasword:(随意) 可以看到报错了,那么我们知道了id进行了 " 的操作. 这里和less13一样, ...