CF78A.Haiku

入门

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Haiku is a genre of Japanese traditional poetry.

A haiku poem consists of 17 syllables split into three phrases, containing 5, 7 and 5 syllables correspondingly (the first phrase should contain exactly 5 syllables, the second phrase should contain exactly 7 syllables, and the third phrase should contain exactly 5 syllables). A haiku masterpiece contains a description of a moment in those three phrases. Every word is important in a small poem, which is why haiku are rich with symbols. Each word has a special meaning, a special role. The main principle of haiku is to say much using a few words.

To simplify the matter, in the given problem we will consider that the number of syllable in the phrase is equal to the number of vowel letters there. Only the following letters are regarded as vowel letters: "a", "e", "i", "o" and "u".

Three phases from a certain poem are given. Determine whether it is haiku or not.

俳句(Haiku)是日本传统诗歌的一种体裁。

一首俳句由17个音节组成,分为三行,每行分别包含5、7、5个音节(即第一行必须恰好包含5个音节,第二行必须恰好包含7个音节,第三行必须恰好包含5个音节)。一首优秀的俳句作品需用这三行来描绘某一瞬间。在短小的诗中,每个词都至关重要,因此俳句富含象征意义;每个词都具有特殊的含义与作用。俳句的核心原则是以极少的词语表达丰富的内涵。

为简化问题,在本题中,我们定义:某一行中的音节数等于该行中元音字母的数量。仅以下字母被视为元音字母:“a”、“e”、“i”、“o”和“u”。

现给出某首诗的三行。请判断它是否为俳句。

输入格式

The input data consists of three lines. The length of each line is between 1 and 100, inclusive. The i-th line contains the i-th phrase of the poem. Each phrase consists of one or more words, which are separated by one or more spaces. A word is a non-empty sequence of lowercase Latin letters. Leading and/or trailing spaces in phrases are allowed. Every phrase has at least one non-space character. See the example for clarification.

输入数据包含三行。每行的长度在 1 到 100 之间(含端点)。第 ii 行包含诗歌的第 ii 个短语。每个短语由一个或多个单词组成,单词之间以一个或多个空格分隔。单词是指由小写拉丁字母组成的非空序列。短语中允许存在前导和/或尾随空格。每个短语至少包含一个非空格字符。参见示例以进一步明确。

输出格式

Print "YES" (without the quotes) if the poem is a haiku. Otherwise, print "NO" (also without the quotes).

如果这首诗是俳句,则输出 "YES"(不带引号);否则,输出 "NO"(同样不带引号)。

输入输出样例

  • 输入#1

    on  codeforces 
    beta round is running
       a rustling of keys

    输出#1

    YES
  • 输入#2

    how many gallons
    of edo s rain did you drink
                                    cuckoo

    输出#2

    NO

输入解题思路,AI测评打分。不知道怎么写?

首页