QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#54062 | #2921. Land Equality | Beevo# | WA | 3ms | 3692kb | C++17 | 888b | 2022-10-06 18:56:34 | 2022-10-06 18:56:36 |
Judging History
answer
#include <bits/stdc++.h>
#define el '\n'
#define ll long long
#define ld long double
#define Beevo ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
void testCase() {
int r, c;
cin >> r >> c;
int z = 0, o = 0, t = 0, x;
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
cin >> x;
if (!x)
z++;
else if (x == 2)
t++;
else
o++;
}
}
if (z >= 2) {
cout << 0;
return;
}
if (z == 1) {
cout << (o ? 1 : 2);
return;
}
if (t % 2 == 0)
cout << 0;
else
cout << (1LL << (t / 2));
}
signed main() {
Beevo
int T = 1;
// cin >> T;
while (T--)
testCase();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3520kb
input:
1 2 0 1
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 3ms
memory: 3692kb
input:
1 2 0 2
output:
2
result:
ok single line: '2'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
1 2 1 2
output:
1
result:
ok single line: '1'
Test #4:
score: 0
Accepted
time: 2ms
memory: 3632kb
input:
2 1 1 1
output:
0
result:
ok single line: '0'
Test #5:
score: 0
Accepted
time: 2ms
memory: 3628kb
input:
2 1 0 0
output:
0
result:
ok single line: '0'
Test #6:
score: 0
Accepted
time: 2ms
memory: 3604kb
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: 2ms
memory: 3648kb
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: 3576kb
input:
2 3 0 1 2 1 1 2
output:
1
result:
ok single line: '1'
Test #9:
score: 0
Accepted
time: 2ms
memory: 3576kb
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: 3592kb
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: 2ms
memory: 3624kb
input:
1 3 0 1 2
output:
1
result:
wrong answer 1st lines differ - expected: '2', found: '1'