180. Boring Strings

Codeforces
IDCF10269180
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
You consider a string of text to be _boring_ if it contains only "a" characters and "b" characters. For example, "abbaba" is boring, while "abcccbabc" is not boring. Given a string, figure out whether or not it is a _boring_ string. The only line of input contains a single string $s$, not containing spaces. If $s$ is _boring_, as described above, output "YES" (no quotes). Otherwise, output "NO". ## Input The only line of input contains a single string $s$, not containing spaces. ## Output If $s$ is _boring_, as described above, output "YES" (no quotes). Otherwise, output "NO". [samples]
**Definitions** Let $ s \in \Sigma^* $ be a string over the alphabet $ \Sigma $. **Constraints** $ s $ contains no spaces. **Objective** Determine whether $ s \subseteq \{a, b\} $. If true, output "YES"; otherwise, output "NO".
API Response (JSON)
{
  "problem": {
    "name": "180. Boring Strings",
    "description": {
      "content": "You consider a string of text to be _boring_ if it contains only \"a\" characters and \"b\" characters. For example, \"abbaba\" is boring, while \"abcccbabc\" is not boring. Given a string, figure out whethe",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269180"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You consider a string of text to be _boring_ if it contains only \"a\" characters and \"b\" characters. For example, \"abbaba\" is boring, while \"abcccbabc\" is not boring.\n\nGiven a string, figure out whethe...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ s \\in \\Sigma^* $ be a string over the alphabet $ \\Sigma $.\n\n**Constraints**  \n$ s $ contains no spaces.\n\n**Objective**  \nDetermine whether $ s \\subseteq \\{a, b\\} $.  \nIf true, ...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments