Atenţie! Aceasta este o versiune veche a paginii, scrisă la 2017-03-18 19:00:23.
Revizia anterioară   Revizia următoare  

 

Fişierul intrare/ieşire:ciocolata2.in, ciocolata2.outSursăAlgoritmiada 2017, Runda 1
AutorVlad GavrilaAdăugată deGavrilaVladGavrila Vlad GavrilaVlad
Timp execuţie pe test0.5 secLimită de memorie262144 kbytes
Scorul tăuN/ADificultateN/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.inciocolata2.out
This is some
text written on
multiple lines.
This is another
text written on
multiple lines.

şşş

Explicaţie

...

Trebuie sa te autentifici pentru a trimite solutii. Click aici

Cum se trimit solutii?