D. Swap Free

Codeforces
IDCF10242D
Time1000ms
Memory512MB
Difficulty
English · Original
Formal · Original
[samples]
**Definitions** Let $ t \in \mathbb{Z} $ be the number of test cases. Let $ T = \{(n_k, A_k) \mid k \in \{1, \dots, t\}\} $ be the set of test cases, where for each $ k $: - $ n_k \in \mathbb{Z} $ denotes the length of the sequence. - $ A_k = (a_{k,1}, a_{k,2}, \dots, a_{k,n_k}) $ is a sequence of integers. **Constraints** 1. $ 1 \le t \le 1000 $ 2. For each $ k \in \{1, \dots, t\} $: - $ 1 \le n_k \le 50 $ - $ 1 \le a_{k,i} \le 100 $ for all $ i \in \{1, \dots, n_k\} $ **Objective** For each test case $ k \in \{1, \dots, t\} $, compute: $$ S_k = \sum_{i=1}^{n_k} (-1)^{i-1} a_{k,i} $$
API Response (JSON)
{
  "problem": {
    "name": "D. Swap Free",
    "description": {
      "content": "",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 524288
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10242D"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "[samples]...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ t \\in \\mathbb{Z} $ be the number of test cases.  \nLet $ T = \\{(n_k, A_k) \\mid k \\in \\{1, \\dots, t\\}\\} $ be the set of test cases, where for each $ k $:  \n- $ n_k \\in \\mathbb{Z}...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments