F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Tetris Comes Back

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 482    Accepted Submission(s): 199


Problem Description
Working in corporation is toilsome and rest is important. In leisure time, WisKey like to play Tetris. The Tetris game in board is N*5, and there are 8 kinds of blocks.
  Look that, red mean the area can¡¯t be place. Other colors mean different kinds of blocks. If I give you C grey blocks (the 1st kind), and other infinite color blocks, Can you fulfil the board without any blocks overlap.
 

Input
Each case will contain two integers N (1<=N<=1000) and C (0<=C<=100).
N*5 grid follow it. The ¡®1¡¯ represent red area, it can¡¯t be place. The ¡®0¡¯ represent normal area.
Process cases to end of file.

 

Output
If you can full of the Tetris, print ¡°YES¡±, otherwise, print ¡°NO¡±.
 

Sample Input
1 1 00000 1 1 00100 1 1 01010 4 1 10000 00101 10010 00000
 

Sample Output
YES YES NO YES
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-20 05:32:25, Gzip enabled