2018学校暑期集训第二天——ACM基础算法

练习题A  ——   CodeForces - 1008A

Romaji


Vitya has just started learning Berlanese language. It is known that Berlanese uses the Latin alphabet. Vowel letters are "a", "o", "u", "i", and "e". Other letters are consonant.

In Berlanese, there has to be a vowel after every consonant, but there can be any letter after any vowel. The only exception is a consonant "n"; after this letter, there can be any letter (not only a vowel) or there can be no letter at all. For example, the words "harakiri", "yupie", "man", and "nbo" are Berlanese while the words "horse", "king", "my", and "nz" are not.

Help Vitya find out if a word ss is Berlanese.

Input

The first line of the input contains the string ss consisting of |s||s| (1≤|s|≤1001≤|s|≤100) lowercase Latin letters.

Output

Print "YES" (without quotes) if there is a vowel after every consonant except "n", otherwise print "NO".

You can print each letter in any case (upper or lower).

Examples

Input

sumimasen

Output

YES

Input

ninja

Output

YES

Input

codeforces

Output

NO

Note

In the first and second samples, a vowel goes after each consonant except "n", so the word is Berlanese.

In the third sample, the consonant "c" goes after the consonant "r", and the consonant "s" stands on the end, so the word is not Berlanese.


贪心题

#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<vector>
#include<cstdio>
#include<cmath>
#include<set>
#include<map>
using namespace std;char a[110];int main(void)
{scanf("%s", a);int n = strlen(a);if(a[n-1]=='a' || a[n-1]=='o' || a[n-1]=='u' || a[n-1]=='i' || a[n-1]=='e' || a[n-1]=='n'){    int judge=1;for(int i=0;i<n-1;i++){//cout << i <<"=="<<endl;if(a[i]!='a' && a[i]!='o' && a[i]!='u' && a[i]!='i' && a[i]!='e' && a[i]!='n'){if(a[i+1]=='a' || a[i+1]=='o' || a[i+1]=='u' || a[i+1]=='i' || a[i+1]=='e'){}else{cout << "NO";judge=0;break;}} }if(judge)cout << "YES";}else{cout << "NO";}return 0;
}

暑期集训2:ACM基础算法 练习题C:CF-1008A相关推荐

  1. 暑期集训2:ACM基础算法 练习题G:POJ - 1298

    2018学校暑期集训第二天--ACM基础算法 练习题G  --  POJ - 1298 The Hardest Problem Ever Julius Caesar lived in a time o ...

  2. 暑期集训2:ACM基础算法 练习题B:CF-1008B

    2018学校暑期集训第二天--ACM基础算法 练习题B  --   CodeForces - 1008B Turn the Rectangles There are nn rectangles in ...

  3. 暑期集训2:ACM基础算法 练习题A:CF-1008C

    2018学校暑期集训第二天--ACM基础算法 练习题A  --  CodeForces - 1008C Reorder the Array You are given an array of inte ...

  4. 暑期集训2:ACM基础算法 例2:POJ-2456

    2018学校暑期集训第二天--ACM基础算法 例二  --   POJ - 2456 Aggressive cows Farmer John has built a new long barn, wi ...

  5. 暑期集训2:ACM基础算法 例1:POJ-1064

    2018学校暑期集训第二天--ACM基础算法 例一  --  POJ - 1064 Cable master Inhabitants of the Wonderland have decided to ...

  6. ACM基础算法入门及题目列表

    对于刚进入大学的计算机类同学来说,算法与程序设计竞赛算是不错的选择,因为我们每天都在解决问题,锻炼着解决问题的能力. 这里以TZOJ题目为例,如果为其他平台题目我会标注出来,同时我的主页也欢迎大家去访 ...

  7. NOIP训练营集训笔记—信息学基础算法(倍增与分治算法

      本文摘自清北OI学堂内部笔记,作者潘恺璠,来自柳铁一中曾参加过清北训练营提高组精英班,主要记录的是信息学基础算法.笔记非常详细,特分享给大家! NOIP2019年夏令营正在报名中,6大校区10种班 ...

  8. CDU集训代码:基础算法和数据结构2

    做题地址: http://acm.hdu.edu.cn/diy/contest_login.php?cid=16636 Problem A: HDU1040 排序题,可以直接使用c++提供的排序,如果 ...

  9. 详解ACM基础算法—DFS深度优先搜索算法 HIT杨朔

    深度优先搜索(DFS)是搜索手段之一.是从某个状态开始不断转移状态直到无法转移为止,然后退回到前一步状态继续转移其他状态,可以想象为一个沿树爬行的虫子,在一个交叉口他会首先随机选择一条分岔路口一直走下 ...

最新文章

  1. No.6 PHP的基本配置与优化
  2. Nature封面:IBM团队发布“AI辩论家”最新研究进展、Insitro创AI制药领域单笔融资金额记录 | AI日报...
  3. numpy数组ndarray如何对每个元素取绝对值,然后生成原数组的绝对值数组
  4. 【JavaScript+JinJa2】表格中将后台传入的None值显示为空字符串,将数据显示为int类型值
  5. git拉取请求_向需要的开源项目提供拉取请求的礼物
  6. mysql中出现乱码问题_Mysql中文乱码问题完美解决方案
  7. SpringMVC中自定义类型转换器
  8. MySQL DBA教程:Mysql性能优化之缓存参数优化
  9. 计算机应用技术基础考试分值,计算机一级考试内容包括哪些 试题分值上是如何分布的...
  10. CTP: 为什么报网络原因发送失败,但连接却成功?
  11. Java8新特性详解
  12. OSChina 周四乱弹 —— 你从小继承了程序员基因
  13. 电信 dns服务器 不稳定,知名DNS服务商114DNS故障,你访问受影响了吗?
  14. java毕业设计——基于java+Eclipse的扫雷游戏设计与实现(毕业论文+程序源码)——扫雷游戏
  15. C++ 变量的生存期
  16. 修改未能正确启动的docker容器的配置文件
  17. 18岁还能长高?该怎么做呢?
  18. 将小米SoundMove 无缝接入 ChatGPT
  19. 关于QT显示SIGSEGV报错的解决方法
  20. JSP中动态添加或删除table的行

热门文章

  1. Python图片处理PIL/pillow/生成验证码/出现KeyError: 和The _imagingft C module is not installed...
  2. python selenium error “Geckodriver executable needs to be in PATH”
  3. 理解RESTful架构
  4. WPF-002 下拉列表的简单实现
  5. 走在网页游戏开发的路上(八)
  6. CCNA基础知识汇总
  7. 著名作者网站论文下载
  8. graphql_普通英语GraphQL指南
  9. es6 generator_让我们探索一下ES6 Generators
  10. 企业不要求工程师资格认证_谁说工程师不能成为企业家?