K. Keep Calm and Sell Balloons

Codeforces
IDCF10234K
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
The complete problemset is available on http://maratona.ime.usp.br/primfase19/provas/competicao/maratona_en.pdf [samples]
**Definitions** Let $ n \in \mathbb{Z} $ be even, $ 2 \leq n \leq 50 $. The wall is an $ n \times n $ grid. Position $ (i, j) $ must contain: - Stone block if $ i + j \equiv 0 \pmod{2} $, - Sand block if $ i + j \equiv 1 \pmod{2} $. **Constraints** - Only two operations allowed: 1. Place a single block of correct type on a *free* position. 2. Fill all empty positions in a $ 2 \times 2 $ square with a single block type, provided at least one position in the square is *free* and the entire square lies within bounds ($ 1 \leq x, y \leq n-1 $). - No block may be placed in a position where its type contradicts the chequered pattern. - Total operations $ k \leq \frac{3n^2}{4} $. **Objective** Construct a sequence of operations (each of type 1 or 2) that fills the grid according to the chequered pattern, using at most $ \frac{3n^2}{4} $ operations.
API Response (JSON)
{
  "problem": {
    "name": "K. Keep Calm and Sell Balloons",
    "description": {
      "content": "The complete problemset is available on http://maratona.ime.usp.br/primfase19/provas/competicao/maratona_en.pdf ",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10234K"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "The complete problemset is available on http://maratona.ime.usp.br/primfase19/provas/competicao/maratona_en.pdf\n\n[samples]...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be even, $ 2 \\leq n \\leq 50 $.  \nThe wall is an $ n \\times n $ grid. Position $ (i, j) $ must contain:  \n- Stone block if $ i + j \\equiv 0 \\pmod{2} $,  \n- Sa...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments