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. 比 file_get_contents() 更优的 cURL 详解(附实例)

    PHP 可以使用 file_get_content() 函数抓取网页内容,但却无法进行更复杂的处理,譬如文件的上传或下载. Cookie 操作等等.而 cURL 提供了这些功能. 一.cURL简介 在 ...

  2. smb windows中使用的文件共享协议(主要用于与windows互通)

    主要是samba服务. SMB协议又成为CIFS(Common Internet File System)协议 samba服务功能: 1文件共享 2打印共享 3加入windows2000/2003/2 ...

  3. ASP.NET MVC 文件上传

    如果想要用HTML表单实作文件上传的功能,那么必须在输出的<form>表单标签加上一个enctype属性,且内容必须设定为multipart/form-data,要通过Html.Begin ...

  4. 修改mysql权限

    关于mysql的用户管理,笔记 1.创建新用户 通过root用户登录之后创建 >> grant all privileges on *.* to testuser@localhost id ...

  5. linux命令(39):ss命令

    ss是Socket Statistics的缩写.顾名思义,ss命令可以用来获取socket统计信息,它可以显示和netstat类似的内容.但ss的优势在于它能够显示更多更详细的有关TCP和连接状态的信 ...

  6. linux下输入密码不回显

    这几天在做一个登陆的程序,需要将输入的密码屏蔽掉,自己百度,找到了两种方法,先贴下第一种方法, #include<stdio.h> #include<unistd.h> int ...

  7. nginx的http负载均衡

    注意:nginx自带的http服务后端检测有缺陷,无法根据状态码来检测,建议使用tengine的nginx_upstream_check_module来实现后端服务的http健康状态检测 (1)负载均 ...

  8. C++ 取整数学函数

    C++ 取整数学函数 将浮点数取整或者四舍五入的数据处理情况经常见到,下面做一下总结. 注意:函数取整返回值均为 double 型,在用 printf 输出时应注意. 数学头文件 #include&l ...

  9. redis三种连接方式

    安装 tar zxvf redis-2.8.9.tar.gz cd redis-2.8.9 #直接make 编译 make #可使用root用户执行`make install`,将可执行文件拷贝到/u ...

  10. ngCordova安装配置使用教程

    ngCordova是什么 ngCordova是在Cordova Api基础上封装的一系列开源的AngularJs服务和扩展,让开发者可以方便的在HybridApp开发中调用设备能力,即可以在Angul ...