Revizia anterioară Revizia următoare
Fişierul intrare/ieşire: | ciocolata2.in, ciocolata2.out | Sursă | Algoritmiada 2017, Runda 1 |
Autor | Vlad Gavrila | Adăugată de | |
Timp execuţie pe test | 0.5 sec | Limită de memorie | 262144 kbytes |
Scorul tău | N/A | Dificultate | N/A |
Vezi solutiile trimise | Statistici
Ciocolata 2
Henry şi Hetty are playing a game. They have a N by M sized grid and a lot of chocolate pieces. A piece of chocolate has size 2 by 1 and can be placed anywhere on the grid as long as it covers exactly two squares. The pieces can be placed either horizontally or vertically and must not overlap with other pieces placed on the grid.
Henry starts the game by asking Hetty to place chocolate pieces on the grid in order to cover it fully. Then, the following two steps happen K times:
1. Henry chooses a set of cells of the grid and blocks them. Once a cell is blocked, it remains blocked for all the following steps.
2. Hetty's goal is to uncover all the blocked cells while covering all the unblocked ones, if possible. To do so, she may remove any set of existing pieces and add any set of new ones.
Help Hetty do the required moves – if she does all of them correctly, she gets to eat all the chocolate!
Date de intrare
Fişierul de intrare ciocolata2.in ...
Date de ieşire
În fişierul de ieşire ciocolata2.out ...
Restricţii
- ... ≤ ... ≤ ...
Exemplu
ciocolata2.in | ciocolata2.out |
---|---|
This is some text written on multiple lines. | This is another text written on multiple lines. |
şş
Explicaţie
...