QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#524743#6336. CouncilQwerty1232#16 245ms4032kbC++231.2kb2024-08-20 03:55:562024-08-20 03:55:57

Judging History

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

  • [2024-08-20 03:55:57]
  • 评测
  • 测评结果:16
  • 用时:245ms
  • 内存:4032kb
  • [2024-08-20 03:55:56]
  • 提交

answer

#include <bits/stdc++.h>

int32_t main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int n, m;
    std::cin >> n >> m;
    std::vector<int> input(n);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            char ch;
            std::cin >> ch;
            input[i] |= int(ch == '1') << j;
        }
    }

    std::vector<std::vector<int>> prf(n + 1, std::vector<int>(m));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            prf[i + 1][j] = prf[i][j] + (input[i] >> j & 1);
        }
    }

    std::vector<int> ans(n);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (i == j) {
                continue;
            }
            int cnt = 0;
            for (int k = 0; k < m; k++) {
                int val = prf[n][k] - prf[0][k] - (prf[i + 1][k] - prf[i][k]) - (prf[j + 1][k] - prf[j][k]);
                cnt += n / 2 <= val;
            }
            ans[i] = std::max(ans[i], cnt);
        }
    }

    for (int i = 0; i < n; i++) {
        std::cout << ans[i] << " \n"[i == n - 1];
    }

    return 0;
}

詳細信息

Subtask #1:

score: 8
Accepted

Test #1:

score: 8
Accepted
time: 0ms
memory: 3536kb

input:

38 20
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 ...

output:

18 18 1 1 18 18 18 1 1 18 18 18 18 18 18 18 1 18 18 1 18 1 1 18 1 1 18 18 1 1 1 18 1 1 1 18 1 1

result:

ok 38 numbers

Test #2:

score: 8
Accepted
time: 3ms
memory: 3824kb

input:

300 20
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1...

output:

20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...

result:

ok 300 numbers

Test #3:

score: 8
Accepted
time: 0ms
memory: 3464kb

input:

5 20
0 0 0 1 1 0 0 0 1 1 0 1 1 0 0 1 1 1 0 0
1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 0 1
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1 0 1
0 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1
0 1 0 0 1 1 1 1 0 0 0 1 1 1 0 0 1 0 1 1

output:

7 9 9 8 9

result:

ok 5 number(s): "7 9 9 8 9"

Test #4:

score: 8
Accepted
time: 0ms
memory: 3748kb

input:

20 20
1 0 1 1 0 1 1 1 1 1 0 0 0 1 1 0 1 1 0 1
1 0 1 0 0 1 0 0 1 1 1 0 1 1 0 0 1 0 1 0
1 0 0 0 1 0 0 0 1 1 0 1 1 0 0 0 0 0 1 1
0 1 0 1 1 1 1 1 0 1 0 1 0 1 0 0 1 1 0 0
0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 0 0 1 1
1 0 0 0 0 0 1 0 1 1 0 1 1 0 0 1 1 1 1 1
0 1 1 1 1 0 1 0 0 0 0 0 1 1 0 1 1 0 1 0
0 0 0 1 0 0 0 ...

output:

12 13 12 13 12 13 12 13 11 13 12 12 11 11 12 13 12 13 13 11

result:

ok 20 numbers

Test #5:

score: 8
Accepted
time: 3ms
memory: 3576kb

input:

300 20
1 1 0 0 1 1 1 0 1 0 1 1 1 0 1 0 0 0 1 0
0 0 1 0 1 0 0 0 1 1 0 1 1 1 1 0 1 1 0 1
0 1 1 0 0 0 0 0 0 1 1 1 1 0 0 1 0 1 1 1
1 1 1 1 0 0 0 1 1 1 1 0 1 1 1 1 1 0 0 1
0 1 0 1 0 1 0 1 0 1 1 1 1 0 0 1 0 0 1 1
0 1 1 0 0 1 0 1 0 0 0 0 1 0 0 1 0 1 1 0
0 0 0 1 0 1 1 1 1 0 0 1 0 0 1 1 0 1 0 1
1 1 0 0 1 0 1...

output:

10 11 11 10 11 11 11 10 11 11 11 10 10 10 10 10 11 11 11 11 10 10 10 10 10 11 11 11 10 11 10 10 10 10 10 10 11 11 10 11 10 11 11 10 10 11 11 11 11 10 10 11 10 11 11 10 10 11 11 10 10 10 10 11 10 10 10 11 11 10 11 10 11 11 11 10 10 11 11 10 10 10 10 10 11 11 10 11 10 11 10 10 11 10 10 11 10 10 11 10 ...

result:

ok 300 numbers

Test #6:

score: 8
Accepted
time: 0ms
memory: 3524kb

input:

5 20
1 1 1 1 1 0 0 1 1 0 0 1 0 0 0 0 0 1 1 0
1 0 1 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 1 1
0 1 1 1 0 0 0 1 0 0 1 0 1 0 1 1 1 0 0 0
0 0 0 0 1 1 0 1 0 0 1 0 0 1 1 0 0 1 0 0
0 0 0 0 0 1 1 0 0 1 0 1 1 0 0 0 1 1 1 1

output:

10 9 11 11 11

result:

ok 5 number(s): "10 9 11 11 11"

Test #7:

score: 8
Accepted
time: 0ms
memory: 3524kb

input:

20 20
0 0 1 1 0 1 0 1 0 0 0 1 1 1 1 1 1 1 1 1
0 0 0 1 0 0 1 0 1 0 1 0 1 1 1 1 0 0 0 0
1 1 1 1 0 1 0 0 0 0 0 0 0 0 1 1 1 0 1 1
1 1 0 0 0 1 1 1 0 1 0 1 0 0 0 1 0 1 1 1
1 0 1 0 0 0 1 0 1 0 0 1 1 1 1 1 0 1 1 1
0 0 0 1 1 0 1 0 0 0 1 1 0 0 0 0 1 1 1 1
0 0 1 1 1 1 0 0 1 1 0 0 1 0 0 0 0 1 1 0
1 1 0 0 1 1 1 ...

output:

11 11 11 11 10 12 12 11 12 9 11 12 11 13 10 10 13 12 11 11

result:

ok 20 numbers

Test #8:

score: 8
Accepted
time: 3ms
memory: 3560kb

input:

300 20
1 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 0 0 1 0
0 0 1 0 1 1 1 0 1 0 1 1 1 0 1 1 1 1 0 0
0 0 1 0 1 1 1 0 1 0 1 0 0 0 0 1 0 1 0 0
0 1 1 1 0 1 0 0 0 0 1 0 0 1 0 1 0 0 0 1
0 0 1 0 1 1 0 1 1 0 0 0 0 0 0 1 0 0 1 1
0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 0 1 1 0 0
0 0 0 0 1 1 0 0 1 0 0 1 1 1 1 1 1 1 0 0
0 0 0 0 1 0 1...

output:

15 14 15 15 16 16 16 17 15 14 15 17 16 15 14 16 13 16 16 14 16 14 16 15 16 15 15 13 17 14 15 15 14 18 14 17 14 16 16 16 13 17 18 16 16 16 16 13 16 15 18 15 17 17 15 14 15 14 17 13 15 16 14 17 16 14 16 15 12 16 17 16 16 14 15 13 15 14 17 12 15 13 15 12 12 17 14 19 16 17 13 16 12 16 13 16 17 14 15 18 ...

result:

ok 300 numbers

Test #9:

score: 8
Accepted
time: 0ms
memory: 3776kb

input:

3 1
0
1
0

output:

1 0 1

result:

ok 3 number(s): "1 0 1"

Test #10:

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

input:

26 1
1
0
1
1
0
1
0
0
0
1
1
1
0
0
1
1
0
0
1
1
1
1
1
1
1
1

output:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

result:

ok 26 numbers

Test #11:

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

input:

4 2
1 1
1 1
0 1
0 1

output:

1 1 2 2

result:

ok 4 number(s): "1 1 2 2"

Test #12:

score: 8
Accepted
time: 0ms
memory: 3612kb

input:

5 2
0 1
1 1
0 0
0 0
0 0

output:

0 0 1 1 1

result:

ok 5 number(s): "0 0 1 1 1"

Test #13:

score: 8
Accepted
time: 1ms
memory: 3636kb

input:

300 2
1 0
0 1
0 1
0 0
0 0
0 1
1 0
1 1
1 1
1 1
0 0
0 0
1 1
1 0
0 1
1 1
0 1
0 0
0 1
0 1
1 0
0 0
0 0
0 0
0 0
0 1
0 0
0 1
1 1
0 0
0 1
0 0
1 1
1 1
0 1
0 0
1 1
0 1
0 1
1 0
1 0
1 0
1 1
0 1
1 0
1 1
0 0
1 1
0 1
0 0
0 0
0 1
1 0
1 1
1 0
1 0
1 0
1 1
1 0
0 0
0 0
1 1
1 0
0 0
0 0
0 0
1 1
1 0
0 0
0 0
0 1
1 0
0 0
1 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 300 numbers

Test #14:

score: 8
Accepted
time: 0ms
memory: 3612kb

input:

26 1
0
1
0
1
0
0
0
0
1
1
1
1
0
1
1
0
0
1
0
0
0
1
1
1
0
1

output:

1 0 1 0 1 1 1 1 0 0 0 0 1 0 0 1 1 0 1 1 1 0 0 0 1 0

result:

ok 26 numbers

Test #15:

score: 8
Accepted
time: 0ms
memory: 3516kb

input:

4 2
0 1
1 0
1 1
1 1

output:

2 2 1 1

result:

ok 4 number(s): "2 2 1 1"

Test #16:

score: 8
Accepted
time: 0ms
memory: 3616kb

input:

5 2
0 0
1 0
1 1
0 1
1 1

output:

2 2 2 2 2

result:

ok 5 number(s): "2 2 2 2 2"

Test #17:

score: 8
Accepted
time: 1ms
memory: 3564kb

input:

300 2
0 1
1 0
0 1
0 0
1 0
1 1
0 0
1 0
1 1
0 1
0 0
0 1
0 1
0 0
1 1
0 0
0 1
0 1
1 1
1 0
1 1
0 1
0 0
0 1
0 1
0 1
1 0
1 0
0 0
1 0
1 0
0 0
1 1
1 1
1 0
0 1
0 1
1 1
1 1
1 0
0 1
0 0
1 0
1 0
1 1
1 0
1 0
1 1
0 1
1 1
1 1
1 1
0 1
0 1
1 1
0 0
0 1
1 1
0 0
1 0
1 1
1 1
0 1
1 1
0 0
1 0
1 1
0 1
1 0
1 0
0 0
1 1
0 0
0 ...

output:

1 1 1 2 1 0 2 1 0 1 2 1 1 2 0 2 1 1 0 1 0 1 2 1 1 1 1 1 2 1 1 2 0 0 1 1 1 0 0 1 1 2 1 1 0 1 1 0 1 0 0 0 1 1 0 2 1 0 2 1 0 0 1 0 2 1 0 1 1 1 2 0 2 2 1 1 1 1 1 0 1 1 2 0 2 1 2 1 1 0 0 0 0 1 2 1 0 1 2 1 1 1 1 1 0 1 2 1 2 1 1 2 1 2 2 1 1 1 0 2 1 1 2 1 1 2 0 1 2 0 0 0 2 1 2 1 2 0 0 1 1 1 1 0 1 0 2 1 0 1 ...

result:

ok 300 numbers

Test #18:

score: 8
Accepted
time: 0ms
memory: 3532kb

input:

18 10
0 0 0 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 0 1
0 1 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 0
0 0 1 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 0
1 1 1 1 1 1 1 1 1 0
0 0 0 1 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 0
1 1 1 1 1 1 1 1 1 0
0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 0
1 1 1 1 1 1 1 1 1 0
1 1 1 1 1 1 1 ...

output:

8 8 8 8 1 8 1 1 8 1 1 8 1 1 1 8 8 8

result:

ok 18 numbers

Test #19:

score: 8
Accepted
time: 0ms
memory: 3480kb

input:

5 3
1 0 0
1 0 1
0 1 1
1 1 0
0 1 0

output:

3 2 2 2 3

result:

ok 5 number(s): "3 2 2 2 3"

Test #20:

score: 8
Accepted
time: 0ms
memory: 3808kb

input:

31 4
1 1 0 0
0 1 0 0
0 0 1 0
0 1 1 1
0 1 0 0
0 1 1 1
1 1 0 0
1 0 1 0
0 1 0 0
1 1 0 0
1 0 0 0
1 1 1 1
1 1 0 0
0 0 0 1
1 1 1 0
0 0 1 0
1 0 1 0
1 1 1 0
0 0 1 0
1 1 1 0
0 0 0 1
0 1 0 1
1 1 0 1
0 1 0 1
0 1 0 0
1 1 1 0
0 0 1 1
1 0 0 0
1 0 1 1
0 0 1 0
0 0 1 0

output:

2 3 3 3 3 3 2 2 3 2 2 2 2 3 2 3 2 2 3 2 3 3 2 3 3 2 3 2 2 3 3

result:

ok 31 numbers

Test #21:

score: 8
Accepted
time: 0ms
memory: 3524kb

input:

30 5
0 1 1 0 1
0 1 1 0 1
1 0 0 1 0
1 0 0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 1 1 1 0
1 1 0 0 1 1 0 0 0
0 0 0 1 0 0 0 1 1

output:

3 3 4 3 3 3 3 4 3 3 3 3

result:

ok 12 numbers

Test #26:

score: 8
Accepted
time: 0ms
memory: 3484kb

input:

37 10
0 0 1 0 1 1 1 0 0 0
1 0 0 1 0 0 1 0 0 0
0 1 1 1 0 1 0 0 1 1
1 0 1 1 0 0 0 1 0 1
0 1 0 1 0 0 0 1 0 0
0 0 0 1 1 1 0 1 0 0
0 1 0 1 0 0 1 0 1 1
1 1 1 0 0 1 0 1 0 0
0 0 1 1 0 0 1 1 0 0
1 0 0 1 0 0 1 0 1 1
1 1 0 0 1 1 1 0 0 1
0 1 1 1 1 1 0 1 1 0
1 0 1 1 0 1 1 0 0 0
1 1 0 1 0 1 1 0 0 0
1 0 0 1 0 0 1 ...

output:

3 2 3 2 3 3 3 2 3 2 2 3 2 2 2 2 3 2 3 2 3 3 3 2 3 2 3 2 2 3 2 2 3 3 3 2 3

result:

ok 37 numbers

Test #27:

score: 8
Accepted
time: 2ms
memory: 3540kb

input:

300 10
0 1 1 1 0 0 1 0 1 1
0 0 0 1 1 1 1 0 1 1
0 1 0 0 1 1 1 1 1 0
0 0 0 1 0 0 1 0 0 0
0 1 0 1 1 1 0 1 1 0
1 0 0 1 1 1 1 0 1 1
1 0 1 1 1 0 1 0 0 1
1 1 1 0 1 0 1 0 1 0
1 1 1 1 0 1 0 0 0 0
0 0 1 0 1 1 1 0 1 0
1 0 0 0 1 1 0 0 1 0
1 1 1 0 1 1 1 0 1 1
1 0 1 1 0 1 0 0 1 0
1 0 0 1 0 0 1 0 1 1
1 1 0 0 1 0 0...

output:

4 4 5 5 5 4 4 5 5 5 5 4 5 4 4 5 5 4 5 4 5 4 5 4 4 5 5 5 4 5 4 4 5 4 4 5 5 4 5 5 5 4 4 5 4 4 5 5 5 4 5 5 4 5 4 5 5 5 4 5 4 5 4 4 4 4 5 5 5 5 5 4 5 5 5 4 5 5 5 5 4 4 5 4 4 4 4 4 5 4 5 5 5 4 5 5 5 5 5 4 5 4 5 4 5 4 4 4 5 4 5 5 5 4 4 5 4 5 4 5 4 4 5 4 4 5 4 4 4 5 5 4 5 5 5 5 4 4 4 4 5 5 5 4 4 4 4 5 4 4 ...

result:

ok 300 numbers

Test #28:

score: 8
Accepted
time: 0ms
memory: 3816kb

input:

5 3
1 1 1
1 0 1
0 1 1
1 1 0
0 0 0

output:

3 3 3 3 3

result:

ok 5 number(s): "3 3 3 3 3"

Test #29:

score: 8
Accepted
time: 0ms
memory: 3524kb

input:

31 4
0 1 1 1
1 1 0 1
1 0 1 1
1 1 1 0
0 1 1 0
0 0 0 1
0 0 0 0
0 0 1 0
0 0 0 1
1 1 1 0
1 0 0 1
0 1 1 1
0 0 0 1
0 0 0 1
1 0 1 0
1 1 1 1
0 1 0 1
1 0 1 1
0 1 0 0
1 1 0 0
1 1 1 0
1 0 1 1
1 1 1 0
1 0 0 1
0 0 0 0
0 1 1 0
0 1 1 0
0 0 0 0
1 1 1 0
1 0 0 1
1 0 0 0

output:

2 2 3 3 3 3 4 4 3 3 3 2 3 3 4 2 2 3 3 3 3 3 3 3 4 3 3 4 3 3 4

result:

ok 31 numbers

Test #30:

score: 8
Accepted
time: 0ms
memory: 3584kb

input:

30 5
0 1 1 0 1
1 0 0 1 1
0 0 1 1 0
0 1 0 0 1
0 1 0 1 1
1 0 1 0 1
1 0 0 0 1
1 1 1 1 1
1 0 0 1 1
1 0 1 0 0
0 1 1 1 0
0 1 0 1 1
1 1 0 1 0
1 0 1 1 1
1 0 0 1 0
0 1 0 1 0
0 1 1 0 0
1 1 0 1 0
0 1 1 0 1
1 1 0 1 1
0 0 1 0 1
0 1 1 0 1
1 0 1 1 0
0 1 1 1 0
1 0 1 1 1
0 0 0 0 1
1 0 1 0 0
0 1 0 0 0
0 1 0 0 0
1 0 0...

output:

4 4 4 4 4 3 4 3 4 3 4 4 4 3 4 5 4 4 4 4 4 4 3 4 3 5 3 5 5 4

result:

ok 30 numbers

Test #31:

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6

result:

ok 21 numbers

Test #33:

score: 8
Accepted
time: 0ms
memory: 3616kb

input:

53 8
1 0 1 1 1 1 0 0
0 1 1 0 0 1 1 0
0 0 1 0 0 1 0 0
0 1 0 0 1 1 0 0
1 0 0 1 1 0 1 0
1 0 1 1 0 1 1 1
1 1 0 1 1 1 1 1
1 0 0 0 1 0 0 0
0 1 0 1 0 0 1 1
1 1 0 1 1 1 0 1
0 0 1 0 0 1 0 0
1 0 0 0 0 1 1 0
1 1 0 0 0 0 0 1
1 0 1 1 1 0 1 1
1 0 1 0 1 1 1 1
0 1 1 0 1 0 0 0
1 1 0 1 0 0 1 0
0 1 1 1 0 1 1 1
0 0 0 1...

output:

6 7 7 6 7 5 5 7 6 5 7 7 7 6 5 7 7 6 7 8 7 5 7 5 5 5 7 6 7 7 8 7 7 5 6 5 6 7 6 7 7 6 7 7 7 6 7 6 7 6 7 6 6

result:

ok 53 numbers

Test #34:

score: 8
Accepted
time: 0ms
memory: 3552kb

input:

12 9
0 1 1 1 1 1 0 0 0
0 1 1 0 1 0 0 0 0
0 1 0 1 0 0 0 0 0
1 1 0 0 0 1 1 1 1
1 0 0 1 0 0 1 1 0
0 0 0 0 0 0 1 1 1
1 0 1 1 1 1 0 1 1
1 0 1 1 1 1 1 1 1
1 1 1 0 1 1 1 0 1
1 0 1 1 0 0 0 0 1
0 1 0 0 1 0 1 0 0
1 0 0 0 1 1 1 1 1

output:

5 6 7 5 6 6 4 4 5 6 7 5

result:

ok 12 numbers

Test #35:

score: 8
Accepted
time: 0ms
memory: 3748kb

input:

37 10
0 1 0 0 1 0 1 1 1 0
0 1 0 1 1 0 1 0 0 1
0 1 0 0 1 0 1 1 1 0
1 0 1 0 1 0 1 0 0 0
1 1 1 0 0 0 1 1 1 1
1 0 1 0 1 1 0 1 1 0
1 1 1 0 1 1 1 0 0 0
1 1 0 1 0 0 1 1 1 1
0 1 1 1 0 0 1 1 1 0
1 1 1 1 1 1 1 1 1 0
0 1 1 0 0 0 1 0 1 1
0 0 0 0 1 1 0 0 1 1
0 0 1 1 1 0 1 1 0 1
1 0 0 1 1 1 0 0 0 1
0 0 1 1 0 0 1 ...

output:

6 7 6 7 5 5 6 5 6 4 6 7 7 7 7 7 6 7 7 7 6 7 7 7 5 6 6 7 6 7 7 6 7 6 7 7 7

result:

ok 37 numbers

Test #36:

score: 8
Accepted
time: 0ms
memory: 3640kb

input:

300 10
1 0 1 1 0 1 1 1 0 0
1 1 1 0 1 0 0 1 0 1
0 0 0 1 1 1 1 1 0 1
0 1 1 0 1 0 1 0 0 0
0 1 1 0 1 0 0 1 1 0
0 1 0 1 0 0 0 1 0 0
0 0 0 0 1 1 0 0 1 0
0 1 1 0 1 0 1 0 1 1
1 0 1 1 1 1 0 0 1 1
1 1 1 0 1 0 1 0 1 1
0 0 1 1 0 1 1 0 0 0
0 1 0 0 1 0 0 1 1 0
0 0 1 0 0 1 0 1 0 0
1 0 1 0 1 0 1 1 1 1
1 0 0 1 1 0 1...

output:

8 8 8 8 8 10 8 7 7 6 9 8 10 6 6 7 8 7 8 8 6 10 9 8 10 9 7 8 9 6 8 7 9 8 7 7 7 8 9 7 8 8 7 7 8 8 8 8 8 7 9 9 6 8 8 8 8 7 10 8 8 9 9 7 7 8 9 8 9 8 9 9 9 6 7 8 8 9 9 8 7 10 9 9 8 8 8 8 8 6 9 8 9 8 8 9 7 9 8 8 8 7 8 7 8 9 8 8 8 7 9 9 7 8 7 8 8 6 8 6 7 7 8 8 6 7 9 9 9 8 8 7 7 7 9 9 7 7 7 8 7 9 9 8 8 7 8 ...

result:

ok 300 numbers

Test #37:

score: 8
Accepted
time: 0ms
memory: 3524kb

input:

26 14
0 0 0 0 0 0 0 1 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 0
0 0 0 0 0 0 0 0 0 1 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 1 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 0
0 0 0 0 0 0 1 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 0
0 0 0 1 0 0 0 ...

output:

12 1 12 12 1 12 1 12 12 1 12 1 12 12 12 1 12 1 1 12 12 1 1 1 1 12

result:

ok 26 numbers

Test #38:

score: 8
Accepted
time: 0ms
memory: 3528kb

input:

5 14
0 1 1 0 1 1 0 0 1 1 0 0 1 0
0 1 1 0 1 1 0 0 1 1 0 1 1 0
1 0 1 0 0 1 1 0 1 1 1 1 0 0
1 0 1 0 1 1 1 0 0 0 0 1 1 0
0 0 1 1 0 1 0 1 1 1 1 1 0 1

output:

9 9 8 8 9

result:

ok 5 number(s): "9 9 8 8 9"

Test #39:

score: 8
Accepted
time: 0ms
memory: 3812kb

input:

20 14
0 0 0 1 1 0 1 0 1 0 1 1 1 1
1 0 1 0 1 0 0 0 1 1 0 1 1 0
0 1 1 1 0 0 0 1 0 1 1 0 1 1
1 0 0 1 1 1 1 1 1 1 0 1 1 0
0 0 1 1 1 1 0 0 1 1 1 0 0 0
1 0 0 1 0 1 0 1 0 0 1 1 0 0
0 0 0 1 0 0 1 1 0 0 0 0 0 0
1 0 1 0 0 1 0 0 1 0 0 0 0 0
1 1 0 1 1 0 0 1 1 1 1 0 1 0
0 1 1 0 1 1 1 0 0 0 0 1 1 1
1 0 0 1 0 0 0 ...

output:

7 6 7 5 6 5 7 5 6 6 6 5 6 7 6 6 5 7 6 6

result:

ok 20 numbers

Test #40:

score: 8
Accepted
time: 0ms
memory: 3520kb

input:

5 14
0 0 0 1 0 1 0 0 0 1 1 1 0 1
0 0 0 1 0 1 1 1 1 0 0 1 0 0
1 0 1 0 0 0 1 0 0 1 0 0 1 1
1 1 0 1 1 0 1 1 1 1 1 0 0 1
0 1 1 0 1 0 0 0 0 0 0 0 1 0

output:

8 8 9 6 9

result:

ok 5 number(s): "8 8 9 6 9"

Test #41:

score: 8
Accepted
time: 0ms
memory: 3548kb

input:

20 14
1 0 1 0 1 0 0 1 1 0 1 0 1 1
0 0 0 1 0 1 0 1 1 0 1 0 1 0
0 1 1 0 0 1 0 0 1 1 1 1 1 1
1 0 1 0 1 1 0 1 0 1 1 1 1 0
1 1 1 0 1 0 1 1 0 1 0 1 0 1
1 1 1 0 0 0 1 1 0 1 0 1 1 0
0 1 1 1 1 0 0 0 1 0 1 1 1 0
0 0 0 1 0 1 1 0 1 0 0 1 0 0
1 1 0 0 1 1 1 1 1 0 0 1 1 0
0 0 1 1 0 0 1 1 1 0 0 0 0 1
0 1 1 0 0 0 1 ...

output:

11 11 11 9 10 10 12 11 10 11 13 9 9 11 13 11 10 11 9 11

result:

ok 20 numbers

Test #42:

score: 8
Accepted
time: 0ms
memory: 3616kb

input:

32 17
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1
0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 1 0 0 0 ...

output:

15 15 15 15 15 15 15 15 15 15 1 15 1 1 15 1 1 15 15 1 15 1 1 1 1 1 1 1 15 15 1 1

result:

ok 32 numbers

Test #43:

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

input:

5 17
0 0 1 1 1 1 0 1 0 0 1 0 0 1 1 0 0
0 1 0 0 0 0 1 1 1 0 0 1 0 0 0 1 0
0 0 1 0 1 0 1 1 1 1 0 1 1 1 0 1 0
0 1 1 1 1 0 0 1 1 1 1 1 1 0 1 1 1
0 0 0 0 1 1 1 1 1 0 0 1 1 1 0 0 0

output:

10 12 11 9 12

result:

ok 5 number(s): "10 12 11 9 12"

Test #44:

score: 8
Accepted
time: 0ms
memory: 3588kb

input:

20 17
1 1 0 0 0 1 0 0 0 0 1 1 0 0 0 1 0
0 0 1 0 0 0 1 0 0 0 0 1 1 0 1 0 0
0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 1 0
0 1 0 1 1 1 1 1 1 1 1 1 0 1 1 0 1
1 0 1 1 0 1 1 0 0 1 1 1 0 0 1 0 0
0 1 1 1 0 1 1 0 1 0 0 0 0 0 1 0 0
1 0 0 1 1 1 1 1 0 1 1 0 0 1 0 1 0
1 0 1 1 1 1 0 0 1 1 1 0 0 1 1 0 0
1 1 1 1 0 1 0 1 1 1 1 ...

output:

14 14 14 12 13 14 12 12 13 13 13 12 12 13 13 13 13 13 14 13

result:

ok 20 numbers

Test #45:

score: 8
Accepted
time: 0ms
memory: 3544kb

input:

5 17
0 0 1 1 1 1 1 0 0 1 1 1 0 0 1 0 0
1 1 1 1 0 0 0 1 1 0 1 1 0 1 0 1 0
0 0 1 1 0 1 1 0 1 0 1 1 0 1 1 1 1
0 1 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1
1 0 0 0 1 0 1 1 1 0 0 0 1 0 0 1 1

output:

11 11 10 11 10

result:

ok 5 number(s): "11 11 10 11 10"

Test #46:

score: 8
Accepted
time: 0ms
memory: 3528kb

input:

20 17
1 1 1 1 1 0 1 0 0 0 0 0 1 1 1 0 0
0 1 0 1 1 1 1 1 1 0 1 1 1 0 0 1 0
1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1
1 0 0 0 1 0 1 1 1 0 0 0 1 1 0 1 0
1 0 0 1 1 0 1 1 1 1 0 0 0 1 1 1 1
0 0 1 0 1 1 1 0 1 1 0 1 1 1 1 1 1
1 1 1 0 0 0 1 1 1 1 0 0 0 0 0 0 0
0 1 1 1 1 1 1 1 0 0 1 0 1 0 1 0 1
1 1 0 1 1 0 0 1 0 0 1 ...

output:

12 9 12 12 12 10 12 9 10 11 11 14 12 11 13 11 14 9 9 12

result:

ok 20 numbers

Subtask #2:

score: 8
Accepted

Dependency #1:

100%
Accepted

Test #47:

score: 8
Accepted
time: 244ms
memory: 3740kb

input:

3000 20
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 ...

output:

20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...

result:

ok 3000 numbers

Test #48:

score: 8
Accepted
time: 244ms
memory: 3824kb

input:

3000 20
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 3000 numbers

Test #49:

score: 8
Accepted
time: 245ms
memory: 3748kb

input:

3000 20
1 0 1 1 0 1 1 1 1 1 0 1 1 0 1 1 0 0 1 1
0 1 1 1 0 1 1 1 0 0 1 1 0 0 1 1 1 1 0 1
0 0 0 0 1 1 0 0 0 1 1 0 1 1 0 0 1 0 1 1
0 0 0 1 1 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0
0 1 1 0 0 1 0 1 1 0 0 0 1 0 0 1 0 0 1 0
0 1 0 1 0 1 1 1 0 0 0 1 1 1 0 0 1 1 0 0
0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0
0 0 1 0 0 0 ...

output:

13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 ...

result:

ok 3000 numbers

Test #50:

score: 8
Accepted
time: 244ms
memory: 4032kb

input:

3000 20
1 0 1 1 1 0 0 0 0 1 0 0 1 0 0 0 0 0 1 1
0 0 0 1 1 0 0 0 1 1 1 0 0 1 1 1 1 0 1 1
1 0 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1
0 1 1 1 0 1 1 1 1 0 0 1 0 0 0 0 0 1 0 1
1 0 1 1 1 1 1 0 1 0 1 0 1 0 1 1 0 0 0 0
1 1 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1
1 0 1 1 0 0 0 1 0 0 0 1 1 1 0 1 1 0 0 0
0 0 1 1 0 0 ...

output:

17 15 14 14 15 17 15 16 13 17 13 16 15 13 13 15 15 17 13 14 15 13 16 18 15 15 14 17 15 15 13 16 15 15 15 13 15 14 17 13 13 15 14 14 15 14 15 15 16 13 13 17 15 18 13 12 18 16 15 16 17 15 14 16 14 15 14 17 12 15 14 15 13 17 12 15 12 16 18 16 14 15 15 14 16 16 14 11 13 13 15 13 15 16 15 14 12 14 15 17 ...

result:

ok 3000 numbers

Test #51:

score: 8
Accepted
time: 33ms
memory: 3780kb

input:

3000 2
1 0
1 0
0 0
1 1
0 0
1 1
0 0
0 0
1 0
1 1
1 0
0 0
0 0
1 0
0 1
1 0
1 1
0 0
0 0
1 0
0 0
0 0
0 1
1 1
1 0
0 0
0 0
0 1
0 1
0 0
1 1
1 1
0 1
0 1
0 1
0 0
0 1
0 1
0 1
0 0
0 1
0 0
1 1
0 1
1 1
1 1
1 0
0 0
1 0
1 0
1 1
1 0
0 0
0 0
1 0
1 1
1 0
0 0
1 1
0 0
0 1
1 0
0 1
0 0
1 0
0 0
0 0
0 0
0 1
1 1
0 0
1 1
1 0
1...

output:

1 1 2 1 2 1 2 2 1 1 1 2 2 1 2 1 1 2 2 1 2 2 2 1 1 2 2 2 2 2 1 1 2 2 2 2 2 2 2 2 2 2 1 2 1 1 1 2 1 1 1 1 2 2 1 1 1 2 1 2 2 1 2 2 1 2 2 2 2 1 2 1 1 1 1 1 1 1 2 2 2 2 1 1 2 1 2 2 2 1 1 1 1 1 2 1 1 2 2 1 2 2 2 2 2 1 1 2 1 2 2 2 1 1 2 1 1 2 2 1 2 1 1 1 1 1 2 2 2 2 1 1 2 1 2 2 2 2 2 2 2 1 2 2 2 1 1 2 1 2 ...

result:

ok 3000 numbers

Test #52:

score: 8
Accepted
time: 210ms
memory: 3832kb

input:

3000 17
1 1 1 1 0 0 1 0 1 0 0 1 1 1 0 0 1
1 1 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0
1 0 0 0 0 1 0 1 0 1 0 0 1 1 0 0 1
1 1 1 1 0 0 0 1 0 0 1 1 0 0 1 0 0
1 0 0 1 0 0 1 1 1 0 0 0 0 0 1 0 0
1 1 0 1 0 1 1 1 0 1 1 0 1 1 0 1 0
0 1 0 1 1 1 0 0 1 1 0 0 0 1 1 0 1
1 0 0 0 0 1 0 0 1 1 0 0 1 0 1 1 1
1 0 0 0 0 0 0 1 1 1 ...

output:

13 14 12 13 14 11 13 14 13 12 15 14 15 13 12 16 13 13 14 13 14 14 12 13 13 13 14 13 13 13 16 13 14 12 12 14 14 13 14 12 12 13 13 13 12 15 11 13 14 14 14 14 11 12 15 13 14 13 14 13 11 11 15 13 13 15 12 12 12 14 16 14 15 14 14 14 13 14 14 12 15 12 12 12 16 14 14 14 16 14 13 13 13 15 12 14 14 13 14 12 ...

result:

ok 3000 numbers

Subtask #3:

score: 0
Time Limit Exceeded

Test #53:

score: 0
Time Limit Exceeded

input:

300000 2
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1...

output:


result:


Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #5:

0%

Subtask #7:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%