A. Palindrome

Codeforces
IDCF10241A
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
*Palindrome* is a word that looks the same when you read it from the beginning and from the end. For example "kayak", "level". The same is with numbers: $909$, $1221$, $12321$ are palindromes. For a given list of numbers, please print how many of them are palindromes. In the first line of input we have a single number $1 <= n <= 100$. In the next line there follows $n$ positive numbers, not bigger than $10^(50)$. Print a single number: how many among input numbers are palindromes? ## Input In the first line of input we have a single number $1 <= n <= 100$. In the next line there follows $n$ positive numbers, not bigger than $10^(50)$. ## Output Print a single number: how many among input numbers are palindromes? [samples]
**Definitions** Let $ n \in \mathbb{Z} $, $ n \geq 2 $. Let $ a, b \in \Sigma^n $, where $ \Sigma = \{ \text{a}, \text{b}, \dots, \text{z} \} $, be two strings of length $ n $. **Constraints** 1. $ 2 \leq n \leq 10^5 $ 2. All characters in $ a $ and $ b $ are lowercase English letters. 3. The operation consists of selecting two distinct indices $ x, y \in \{1, \dots, n\} $, $ x \ne y $, and swapping $ a_x \leftrightarrow a_y $ and $ b_x \leftrightarrow b_y $. **Objective** Determine whether there exists a pair $ (x, y) $, $ x \ne y $, such that after the swap, the resulting string $ a' $ is lexicographically greater than $ b' $, i.e., $$ a' >_{\text{lex}} b' $$ If such a pair exists, output $ \text{YES} $ followed by $ x, y $; otherwise, output $ \text{NO} $.
API Response (JSON)
{
  "problem": {
    "name": "A. Palindrome",
    "description": {
      "content": "*Palindrome* is a word that looks the same when you read it from the beginning and from the end. For example \"kayak\", \"level\". The same is with numbers: $909$, $1221$, $12321$ are palindromes. For a g",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10241A"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "*Palindrome* is a word that looks the same when you read it from the beginning and from the end. For example \"kayak\", \"level\". The same is with numbers: $909$, $1221$, $12321$ are palindromes. For a g...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z} $, $ n \\geq 2 $.  \nLet $ a, b \\in \\Sigma^n $, where $ \\Sigma = \\{ \\text{a}, \\text{b}, \\dots, \\text{z} \\} $, be two strings of length $ n $.  \n\n**Constraints** ...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments