B. Pen spinning accident

Codeforces
IDCF10179B
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
See PDF statement in attachment. [samples]
**Definitions** Let $ s_1, s_2 $ be two palindromic strings over the alphabet $ \Sigma = \{a, b, \dots, z\} $. Let $ f: \Sigma \to \mathbb{N} $ be the frequency function of the multiset union $ s_1 \cup s_2 $, i.e., $ f(c) = \text{count of } c \text{ in } s_1 + \text{count of } c \text{ in } s_2 $. **Constraints** 1. $ |s_1| \leq 100 $, $ |s_2| \leq 100 $ 2. $ s_1 $ and $ s_2 $ are palindromes. **Objective** Determine whether there exists a permutation of the multiset $ s_1 \cup s_2 $ that forms a palindrome. This is possible if and only if at most one character in $ f $ has an odd frequency. $$ \boxed{\text{YES if } \left| \left\{ c \in \Sigma \mid f(c) \text{ is odd} \right\} \right| \leq 1 \text{, otherwise NO}} $$
API Response (JSON)
{
  "problem": {
    "name": "B. Pen spinning accident",
    "description": {
      "content": "See PDF statement in attachment. ",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10179B"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "See PDF statement in attachment.\n\n[samples]...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ s_1, s_2 $ be two palindromic strings over the alphabet $ \\Sigma = \\{a, b, \\dots, z\\} $.  \nLet $ f: \\Sigma \\to \\mathbb{N} $ be the frequency function of the multiset union $ s_...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments