File size: 1,707 Bytes
1f3a244 | 1 2 3 4 5 | {"type": "session", "harness": "opencode", "id": "cf-1008-A", "name": "Codeforces: Romaji"}
{"type": "message", "message": {"role": "system", "content": "You are an expert competitive programmer. You solve problems by analyzing requirements, designing algorithms, and writing clean, efficient code."}}
{"type": "message", "message": {"role": "user", "content": "Problem: Romaji (Rating: 900)\nTags: implementation, strings\n\nVitya 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.\n\nIn 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.\n\nHelp Vitya find out if a word $s$ is Berlanese.\n\nInput: The first line of the input contains the string $s$ consisting of $|s|$ ($1\\leq |s|\\leq 100$) lowercase Latin letters.\n\nOutput: Print \"YES\" (without quotes) if there is a vowel after every consonant except \"n\", otherwise print \"NO\".\n\nYou can print each letter in any case (upper or lower).\n\nExamples:\nInput: sumimasen\nOutput: YES\n\nInput: ninja\nOutput: YES\n\nInput: codeforces\nOutput: NO\n"}}
{"type": "message", "message": {"role": "assistant", "content": "You need to check if after every letter except one of for these \"aouien\", there goes one of these \"aouie\". Do not forget to check the last letter."}}
|