QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#54063#2921. Land EqualityBeevo#WA 2ms3740kbC++171.1kb2022-10-06 19:11:022022-10-06 19:11:04

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 19:11:04]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3740kb
  • [2022-10-06 19:11:02]
  • 提交

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 g[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;

            g[i][j] = x;

            if (!x)
                z++;
            else if (x == 1)
                o++;
            else
                t++;
        }
    }

    if (z >= 2) {
        cout << 0;

        return;
    }

    if (z == 1) {
        if (!o)
            cout << 2;
        else {
            if (r > 1 && c > 1)
                cout << 1;
            else if (g[r - 1][c - 1] == 1)
                cout << 1;
            else
                cout << 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: 2ms
memory: 3588kb

input:

1 2
0 1

output:

1

result:

ok single line: '1'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

1 2
0 2

output:

2

result:

ok single line: '2'

Test #3:

score: 0
Accepted
time: 1ms
memory: 3648kb

input:

1 2
1 2

output:

1

result:

ok single line: '1'

Test #4:

score: 0
Accepted
time: 2ms
memory: 3564kb

input:

2 1
1
1

output:

0

result:

ok single line: '0'

Test #5:

score: 0
Accepted
time: 2ms
memory: 3740kb

input:

2 1
0
0

output:

0

result:

ok single line: '0'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3556kb

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: 3628kb

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: 2ms
memory: 3636kb

input:

2 3
0 1 2
1 1 2

output:

1

result:

ok single line: '1'

Test #9:

score: 0
Accepted
time: 2ms
memory: 3636kb

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: 3696kb

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: 0
Accepted
time: 2ms
memory: 3632kb

input:

1 3
0 1 2

output:

2

result:

ok single line: '2'

Test #12:

score: 0
Accepted
time: 2ms
memory: 3580kb

input:

1 6
2 1 2 0 1 2

output:

2

result:

ok single line: '2'

Test #13:

score: 0
Accepted
time: 2ms
memory: 3608kb

input:

6 1
2
1
2
0
1
2

output:

2

result:

ok single line: '2'

Test #14:

score: 0
Accepted
time: 2ms
memory: 3632kb

input:

1 5
0 1 1 1 2

output:

2

result:

ok single line: '2'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

1 6
2 1 2 0 2 1

output:

1

result:

ok single line: '1'

Test #16:

score: -100
Wrong Answer
time: 0ms
memory: 3528kb

input:

1 6
1 1 2 0 1 2

output:

2

result:

wrong answer 1st lines differ - expected: '1', found: '2'