QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#54062#2921. Land EqualityBeevo#WA 3ms3692kbC++17888b2022-10-06 18:56:342022-10-06 18:56:36

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-06 18:56:36]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3692kb
  • [2022-10-06 18:56:34]
  • 提交

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;
}

详细

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'