|
||||||||||
Reverse ItTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 208 Accepted Submission(s): 74 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
Sample Output
Hint 4 different card placements in the sample are 00, 10, 01, 11. Source | ||||||||||
|