#Lutece1855. Zero One Problem
Zero One Problem
Migrated from Lutece 1855 Zero One Problem
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Given a matrix only consisting 0
and 1
. In this problem you should find the difference of two given sub-matrix.
Input
The first line of the input contains two integers (), the height and width of the matrix.
Then lines follows, each contains a string (), representing the row of the matrix. contains only 0
and 1
.
The next line contains number of query ().
Each question contains eight integers ,,,,,,,
(), denote the top-left point and bottom-right point of the first and second sub-matrix.
Output
For each query output one line which means the answer.
If they are the same sub-rectangle, print the word Perfect
If they are different in one cell, print the sentence One difference
Otherwise print the word Wrong
on a single line.
Samples
Resources
The 16th UESTC Programming Contest Preliminary