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 ...
随机推荐
- linux驱动基础系列--Linux mmc sd sdio驱动分析
前言 主要是想对Linux mmc子系统(包含mmc sd sdio)驱动框架有一个整体的把控,因此会忽略某些细节,同时里面涉及到的一些驱动基础,比如平台驱动.块设备驱动.设备模型等也不进行详细说明原 ...
- 110.Balanced Binary Tree---《剑指offer》面试39
题目链接 题目大意:判断一个二叉树是否是平衡二叉树. 法一:dfs.利用求解二叉树的高度延伸,先计算左子树的高度,再计算右子树的高度,然后两者进行比较.o(nlgn).代码如下(耗时4ms): pub ...
- 2015多校第7场 HDU 5379 Mahjong tree 构造,DFS
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5379 题意:一颗n个节点n-1条边的树,现在要给每个节点标号(1~n),要求:(1)每一层的兄弟节点的 ...
- caffe Python API 之激活函数ReLU
import sys import os sys.path.append("/projects/caffe-ssd/python") import caffe net = caff ...
- 构造函数、原型对象prototype、实例、隐式原型__proto__的理解
(欢迎一起探讨,如果有什么地方写的不准确或是不正确也欢迎大家指出来~) PS: 内容中的__proto__可能会被markdown语法导致显示为proto. 建议将构造函数中的方法都定义到构造函数的原 ...
- HDU-2487
Ugly Windows Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tota ...
- 当你用element-ui遇到需要在el-table-column上v-for时,这篇文章你能用的上,也就是你需要二级循环
好链接就要丢过去 https://blog.csdn.net/qq_28929589/article/details/79445354
- hdu 1024(滚动数组+动态规划)
Max Sum Plus Plus Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others ...
- windows命令启动mysql
找到mysql的安装位置,进入bin目录 dos输入 mysql -h localhost -uroot -p ,在输入密码
- SpringBoot学习:读取yml和properties文件的内容
一.在SpringBoot实现属性注入: 1).添加pom依赖jar包: <!-- 支持 @ConfigurationProperties 注解 --> <!-- https://m ...