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

Reverse It

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


Problem Description
Taotao is a boy who is addicted to cards. He comes up with a card-related problem. As usual, Taotao can't solve the problem independently. Thus, he asks your help.
Taotao places n rows and m columns of cards on the desktop. Each card may be face up or it may be reverse side up. Taotao can perform at most two operations. He selects a rectangle of any size in the desktop for each operation and reverses cards in the rectangle. And he wants to know how many different types of card placement he can get. Two card placements are regarded as different only if there is at least one card in the same position reversed.
 

Input
There are multiple test cases.
For each test case, first line contains two integers n, m(1<=n, m<=100).
The next n lines each contain m digitals. '1' represents the card is face up. '0' represents the card is reverse side up.
 

Output
For each test case, you should output one integer represents the number of different card placements.
 

Sample Input
1 2 10
 

Sample Output
4
 

Hint
4 different card placements in the sample are 00, 10, 01, 11.
 

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-05-08 22:45:47, Gzip enabled