Solved by 14 users: defrager, UdH-WiNGeR, WsemirZ, dan, murphy, fetetriste, TTLovePP, Yagi_Arthur, RAVEman, Rizvanov, VladimirChelnokov, Dest, ripatti, topspin.
UserDateAttemptTimeCMSC
ripatti`23 jun 2010`C++7500.371582
ripatti`23 jun 2010`C++7400.421582
ripatti`23 jun 2010`C++7200.621582
ripatti`23 jun 2010`C++7101.211582
Rizvanov`07 feb 2010`C++2901.481435
defrager`07 apr 2009`C++601.723014
WsemirZ`13 apr 2009`Kylix1202.402313
ripatti`23 jun 2010`C++7002.511582
TTLovePP`29 dec 2009`C++402.941357
VladimirChelnokov`09 mar 2010`C++202.993207
RAVEman`06 feb 2010`C++2303.011288
Yagi_Arthur`31 dec 2009`Kylix1203.011468
Yagi_Arthur`31 dec 2009`Kylix1003.031465
WsemirZ`13 apr 2009`Kylix1103.062313
topspin`04 aug 2010`Kylix1503.151437
topspin`04 aug 2010`Kylix1703.181265
dan`25 apr 2009`C++203.521358
Rizvanov`06 feb 2010`C++1303.571317
VladimirChelnokov`09 mar 2010`C++103.743193
 C++ 10 Kylix 3 Java 1
` >  >  >  >  >  >  >  >  >  > `

## Pentamino

Time limit = 5 seconds

Polyomino is a connected figure made of one-cell squares, adjacent by its sides. By other words, it is consecutive one-cell figure that could be traced by chess rook. Pentamino is polyomino consisted of 5 one-cell elements. There are exactly 12 different pentaminoes (rotations and reflections do not create new ones).

The problem is to verify whether given 60 one-cells elements figure can be covered with full set of pentaminoes. That means each of 12 figures should beg used exactly once and each cell of the source figure should be covered.

Input. Input contains numbers M and N and rectangle M*N (M rows and N columns) with '0' and '1' elements. There are exactly 60 '1' cells in the rectangle.

Output. Output must contain a single word YES if the given 60-cells figure can be covered with full set of pentaminos and NO otherwise.

 Input#1```10 6 111111 111111 111111 111111 111111 111111 111111 111111 111111 111111 ``` Output#1```YES ```
 Input#2```11 13 0000100000000 0011111000000 0000111010000 0000111010110 1111111111111 1111111111100 1111111100000 0001111000000 0000111000000 0000111000000 0000011000000 ``` Output#2```NO ```

Author:
Here must be also name of Golomb, the inventor of pentamino.
27 Marth 2009

 © acm.mipt DevGroupThe page was generated in 200ms