CodeForces 733A - Grasshopper And the String
来源:互联网 发布:盘锦网络维护培训学校 编辑:程序博客网 时间:2024/05/17 00:01
题目大意: 对于给定的一个字符串序列,找到最大的两个元音字符之间的距离
我们可以比较容易的得到公式
然后遍历字符串即可。需要的特殊处理末尾
#include <cstdio>#include <string>#include<iostream>#include<vector>#include <stack>#include <queue>#include <map>#include <cstdlib>#include<string.h>#include <cstring>#include <algorithm>using namespace std;typedef long long ll;typedef pair<int, int>pii;typedef pair<ll, ll> pll;typedef pair<int, ll> pil;bool cheak(char s){ if (s == 'A' || s == 'E' || s == 'O' || s == 'U' || s == 'I' || s == 'Y')return true; else return false;}int main(){ string s; cin >> s; int maxx = 0; int now = 0; s += ' '; for (int i = 0; i < s.size(); i++) { now++; maxx = max(maxx, now); if (cheak(s[i]))now = 0;; } cout << maxx << endl; //system("pause");}
0 0
- Codeforces 733A Grasshopper And the String
- codeforces--733A. Grasshopper And the String
- CodeForces 733A - Grasshopper And the String
- Codeforces 733A Grasshopper And the String
- 【非常高%】【codeforces 733A】Grasshopper And the String
- 733A Grasshopper And the String codeforces(水题)
- CodeForces 733A Grasshopper And the String(水题)
- CodeForces 733 A.Grasshopper And the String(水~)
- 733A Grasshopper And the String
- A. Grasshopper And the String
- A. Grasshopper And the String
- Codeforces Round #378 (Div. 2)A. Grasshopper And the String
- Codeforces Round #378 (Div. 2) A. Grasshopper And the String
- codeforces#378 Div.2 A. Grasshopper And the String
- [codeforces] A. Grasshopper And the String 简单模拟
- codeforces 733A 733B之Grasshopper And the String Parade
- CodeForces 733A Grasshopper And the String(蚂蚱跳字符)
- 【codeforces】Grasshopper And the String(div2A)
- 八皇后(递归实现)
- 【Flask】从Excel中批量导入数据
- 总结一下之前的学习笔记
- C++的命名空间
- css三大特性
- CodeForces 733A - Grasshopper And the String
- 世安杯-LSB隐写-png
- 导航条左右扩大
- Hadoop生态系统搭建(1)——Ubuntu16.04环境搭建 Hadoop 2.7.0 全分布式环境
- Distinct Subsequences(研究之后用自己的方法做的解释,易懂)
- 传智HTML5笔记
- 汇编语言 王爽(第三版)实验十三
- 深入理解java虚拟机-读书笔记1-Java内存区域与内存溢出异常
- Sublime Text 3(v3126)破解和汉化