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. problems when installed mysql in linux ubuntu

    reference:http://www.jb51.net/article/87160.htm?pc 1.ERROR 2002 (HY000): Can't connect to local MySQ ...

  2. 8:django sessions(会话)

    django会话 django提供对匿名会话全方位的支持,会话框架可以存储和检索每个站点访问者的任意数据.会话数据是存储在服务器端的,并且简要了发送和接受cookie的过程,cookies只包含一个s ...

  3. 6:django 通用视图

    上一节我们介绍了django视图函数里面几个常用的函数,这节我们来看一下django为我们提供的一些通用视图吧 在最后面有我自己的示例代码,html部分太多了就不贴了 “简单”视图函数 正如名字所言, ...

  4. LeetCode解题报告—— Combination Sum & Combination Sum II & Multiply Strings

    1. Combination Sum Given a set of candidate numbers (C) (without duplicates) and a target number (T) ...

  5. SQLiScanner:又一款基于SQLMAP和Charles的被动SQL 注入漏洞扫描工具

    https://blog.csdn.net/qq_27446553/article/details/52610095

  6. Pycharm中的Django项目连接mysql数据库

    一.安装Pycharm和Django就不详细说了,自行百度 二.新建Django项目也不说了 三.配置Django连接到mysql 1.models.py写一个类,继承models.Model cla ...

  7. win10的VMware虚机host-only模式下,虚拟机无法ping通物理机,而物理机能ping通虚机

    1.打开控制面板—->Windows防火墙(win10操作系统) 2.点击最上面的”允许应用或功能通过xxxxx” 3.勾上上图的“文件和打印机共享” 然后点确定.

  8. springboot的mvn与gradle启动方式

    1 很简单,直接鼠标右击项目,run启动项目 2 项目目录下的命令行  mvn spring-boot:run 或者  gradlew bootRun 3 进入libs下或者target下 java ...

  9. Centos7yum安装LNMP

    (1)安装nginx 0.关闭防火墙 systemctl stop firewald.service systemctl disable firewald.service 1.使用nginx官方提供的 ...

  10. .Net WebAPI 增加Swagger

    第一部分:创建项目 选择Web/ASP.NET Web Application 这里我选择的是WebAPI,并且增加MVC和Web API,权限部分选择无权限 第二部分:增加EF连接 因为项目需要连接 ...