QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#637061 | #2921. Land Equality | enze114514# | WA | 0ms | 3748kb | C++20 | 826b | 2024-10-13 07:29:53 | 2024-10-13 07:29:53 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 25;
int n, m, zero, one, two;
int a[75][75];
signed main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin >> n >> m;
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= m; ++j) {
cin >> a[i][j];
if (a[i][j] == 0) ++zero;
if (a[i][j] == 1) ++one;
if (a[i][j] == 2) ++two;
}
}
if (zero >= 2) {
cout << "0\n";
return 0;
}
if (zero == 1) {
if (one) cout << "1\n";
else if (two) cout << "2\n";
else cout << "0\n";
return 0;
}
if (two % 2 == 1) {
int k = two / 2;
cout << (1 << k) << '\n';
} else {
cout << "0\n";
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3616kb
input:
1 2 0 1
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
1 2 0 2
output:
2
result:
ok single line: '2'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
1 2 1 2
output:
1
result:
ok single line: '1'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3740kb
input:
2 1 1 1
output:
0
result:
ok single line: '0'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
2 1 0 0
output:
0
result:
ok single line: '0'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
5 5 2 2 2 2 2 2 2 1 2 2 2 1 1 1 2 2 2 1 2 2 2 2 2 2 2
output:
0
result:
ok single line: '0'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
5 5 2 2 2 2 2 2 2 1 2 2 2 1 1 1 2 2 2 1 1 2 2 2 2 2 2
output:
512
result:
ok single line: '512'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
2 3 0 1 2 1 1 2
output:
1
result:
ok single line: '1'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3748kb
input:
2 6 0 2 2 1 2 2 1 1 1 1 2 2
output:
1
result:
ok single line: '1'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3692kb
input:
4 4 2 2 2 2 2 1 2 2 2 0 2 2 2 2 2 2
output:
1
result:
ok single line: '1'
Test #11:
score: -100
Wrong Answer
time: 0ms
memory: 3616kb
input:
1 3 0 1 2
output:
1
result:
wrong answer 1st lines differ - expected: '2', found: '1'