QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#297481#7863. Parity Gameucup-team1525#AC ✓2ms3812kbC++203.5kb2024-01-04 15:51:012024-01-04 15:51:02

Judging History

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

  • [2024-01-04 15:51:02]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3812kb
  • [2024-01-04 15:51:01]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int N = 505;
int n, t;
int a[N];
int f(int x) {
    int p = 0, len = 0;
    for (int i = 1; i <= x; ++i) {
        if (a[i] == 0) {
            p += len % 2;
            len = 0;
            --p;
        } else
            ++len;
    }
    return p + len % 2;
}
char s[10];

void mv(int x) {
    for (int i = x; i < n; ++i)
        a[i] = a[i + 1];
}
void moni() {
    int p;
    scanf("%d%s", &p, s);
    if (s[0] == '+')
        a[p] ^= a[p + 1];
    else
        a[p] &= a[p + 1];
    mv(p + 1);
}

void inc(int x) {
    for (int i = 1; i < x; ++i)
        if ((a[i] | a[i + 1]) == 0) {
            cout << i << ' ' << '+' << endl;
            a[i] ^= a[i + 1];
            mv(i + 1);
            return;
        }
    // int len = 0;
    for (int i = 1; i < x; i++) {
        if (a[i] == 1)
            continue;
        int len_l = 0, len_r = 0;
        for (int j = i - 1; j >= 1; j--) {
            if (a[j] == 1)
                len_l++;
            else
                break;
        }
        for (int j = i + 1; j <= x; j++) {
            if (a[j] == 1)
                len_r++;
            else
                break;
        }
        if ((len_l + len_r) % 2) {
            cout << i << " +" << endl;
            a[i] ^= a[i + 1];
            mv(i + 1);
            return;
        }
    }
    if (a[x] == 0 && a[x - 1] == 1) {
        cout << x - 1 << ' ' << '+' << endl;
        a[x - 1] ^= a[x];
        mv(x);
        return;
    }
    for (int i = 1; i < x; ++i)
        if (a[i] != a[i + 1]) {
            cout << i << ' ' << '+' << endl;
            a[i] ^= a[i + 1];
            mv(i + 1);
            return;
        }
    cout << "1 *" << endl;
    a[1] &= a[2];
    mv(2);
}
void dec(int x) {
    for (int i = 1; i < x; ++i)
        if (a[i] & a[i + 1]) {
            cout << i << ' ' << '+' << endl;
            a[i] ^= a[i + 1];
            mv(i + 1);
            return;
        }
    for (int i = 1; i < x; ++i)
        if (a[i] != a[i + 1]) {
            cout << i << ' ' << '*' << endl;
            a[i] &= a[i + 1];
            mv(i + 1);
            return;
        }
    cout << "1 *" << endl;
    a[1] &= a[2];
    mv(2);
}
void workA(int d) {
    cout << "Alice" << endl;
    for (int i = 1; i < n; ++i)
        if (i % 2 == 1) {
            for (int j = n - i + 2; j <= n; ++j)
                a[j] = 0;
            if (d)
                inc(n - i + 1);
            else
                dec(n - i + 1);
        } else {
            moni();
        }
}
void workB(int d) {
    cout << "Bob" << endl;
    for (int i = 1; i < n; ++i)
        if (i % 2 == 0) {
            for (int j = n - i + 2; j <= n; ++j)
                a[j] = 0;
            if (d)
                inc(n - i + 1);
            else
                dec(n - i + 1);
        } else {
            moni();
        }
}

int main() {
    scanf("%d%d", &n, &t);
    for (int i = 1; i <= n; ++i) {
        scanf("%d", &a[i]);
        // a[i]%=2;
    }
    int p = f(n);
    if (n % 2 == 0) {
        if (t == 0) {
            workA(0);
        } else {
            if (p >= 0)
                workA(1);
            else
                workB(0);
        }
    } else {
        if (t == 0) {
            if (p > 0)
                workB(1);
            else
                workA(0);
        } else
            workB(0);
    }
    return 0;
}

这程序好像有点Bug,我给组数据试试?

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3800kb

input:

4 1
0 1 0 1
1 *
1

output:

Alice
1 +
1 +

result:

ok The player wins!

Test #2:

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

input:

4 0
1 0 1 0
1 +
1

output:

Alice
1 *
1 *

result:

ok The player wins!

Test #3:

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

input:

5 1
1 1 1 0 0
4 +
1 +
1

output:

Bob
1 +
1 *

result:

ok The player wins!

Test #4:

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

input:

3 0
1 1 1
1 +
1

output:

Bob
1 +

result:

ok The player wins!

Test #5:

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

input:

3 1
1 0 1
1 *
1

output:

Bob
1 *

result:

ok The player wins!

Test #6:

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

input:

3 0
1 0 1
1 *
1

output:

Bob
1 +

result:

ok The player wins!

Test #7:

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

input:

2 1
0 1
1

output:

Alice
1 +

result:

ok The player wins!

Test #8:

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

input:

499 0
0 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 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 0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 1 1 1 1 1 1 1 0 1 0 ...

output:

Alice
2 +
2 +
2 +
4 +
6 +
10 +
12 +
12 +
14 +
14 +
16 +
20 +
20 +
20 +
20 +
22 +
22 +
24 +
24 +
26 +
26 +
26 +
28 +
28 +
28 +
28 +
30 +
30 +
30 +
32 +
32 +
34 +
36 +
38 +
40 +
40 +
48 +
48 +
48 +
48 +
48 +
52 +
54 +
54 +
54 +
58 +
58 +
58 +
60 +
60 +
62 +
66 +
68 +
70 +
70 +
72 +
74 +
76 +
76 +
78 +...

result:

ok The player wins!

Test #9:

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

input:

499 0
1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 0 1 1 1 0 1 ...

output:

Bob
1 +
2 +
2 +
2 +
4 +
6 +
6 +
8 +
10 +
12 +
12 +
14 +
14 +
18 +
18 +
18 +
18 +
18 +
20 +
22 +
24 +
24 +
24 +
26 +
26 +
30 +
32 +
34 +
34 +
34 +
34 +
36 +
38 +
44 +
46 +
48 +
48 +
50 +
50 +
52 +
52 +
54 +
58 +
60 +
60 +
62 +
64 +
64 +
66 +
66 +
70 +
70 +
72 +
74 +
76 +
76 +
78 +
78 +
84 +
86 +
86 +...

result:

ok The player wins!

Test #10:

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

input:

500 0
0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 ...

output:

Alice
2 +
4 +
4 +
6 +
6 +
6 +
10 +
10 +
12 +
12 +
14 +
16 +
16 +
18 +
18 +
20 +
22 +
22 +
24 +
24 +
24 +
24 +
26 +
28 +
30 +
34 +
34 +
36 +
40 +
40 +
42 +
42 +
50 +
50 +
50 +
52 +
54 +
54 +
54 +
56 +
56 +
58 +
58 +
60 +
60 +
60 +
60 +
64 +
66 +
66 +
66 +
66 +
74 +
74 +
78 +
78 +
80 +
82 +
84 +
86 +
...

result:

ok The player wins!

Test #11:

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

input:

499 1
0 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 0 1 0 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 0 1 0 1 0 ...

output:

Bob
1 +
1 +
1 +
9 +
13 +
13 +
15 +
19 +
19 +
21 +
25 +
25 +
25 +
27 +
29 +
29 +
31 +
31 +
31 +
31 +
33 +
33 +
39 +
39 +
39 +
39 +
39 +
43 +
43 +
43 +
45 +
45 +
47 +
47 +
49 +
49 +
49 +
51 +
51 +
53 +
53 +
53 +
55 +
61 +
61 +
63 +
63 +
63 +
65 +
65 +
67 +
67 +
69 +
71 +
71 +
71 +
75 +
75 +
79 +
79 +
...

result:

ok The player wins!

Test #12:

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

input:

499 1
1 0 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 ...

output:

Bob
4 +
4 +
6 +
8 +
8 +
12 +
14 +
14 +
16 +
18 +
20 +
24 +
24 +
24 +
24 +
24 +
26 +
28 +
30 +
30 +
30 +
30 +
30 +
34 +
36 +
38 +
40 +
42 +
44 +
44 +
44 +
44 +
46 +
46 +
50 +
50 +
52 +
52 +
56 +
56 +
60 +
60 +
60 +
62 +
62 +
64 +
64 +
64 +
66 +
68 +
68 +
68 +
70 +
72 +
72 +
74 +
74 +
76 +
76 +
76 +
7...

result:

ok The player wins!

Test #13:

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

input:

500 1
0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 1 1 1 1 1 0 ...

output:

Alice
1 +
1 +
1 +
2 +
2 +
2 +
2 +
2 +
4 +
4 +
6 +
12 +
12 +
14 +
14 +
14 +
16 +
16 +
16 +
20 +
22 +
22 +
24 +
24 +
26 +
26 +
26 +
28 +
28 +
28 +
34 +
36 +
36 +
36 +
38 +
38 +
40 +
42 +
42 +
44 +
46 +
46 +
46 +
46 +
50 +
52 +
52 +
58 +
58 +
60 +
62 +
64 +
66 +
72 +
72 +
74 +
74 +
74 +
76 +
78 +
78 +
...

result:

ok The player wins!

Test #14:

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

input:

500 0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ...

output:

Alice
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
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 The player wins!

Test #15:

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

input:

499 0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ...

output:

Alice
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
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 The player wins!

Test #16:

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

input:

499 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ...

output:

Bob
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
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 The player wins!

Test #17:

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

input:

500 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ...

output:

Alice
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
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 The player wins!

Test #18:

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

input:

499 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ...

output:

Bob
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
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 The player wins!

Test #19:

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

input:

499 1
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ...

output:

Bob
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
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 The player wins!

Test #20:

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

input:

500 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ...

output:

Alice
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
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 The player wins!

Test #21:

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

input:

500 1
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ...

output:

Alice
499 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
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 The player wins!

Test #22:

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

input:

500 0
1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 ...

output:

Alice
1 +
3 +
5 +
7 +
7 +
7 +
9 +
9 +
13 +
13 +
15 +
15 +
17 +
19 +
19 +
21 +
23 +
23 +
23 +
25 +
25 +
25 +
27 +
29 +
29 +
35 +
35 +
37 +
39 +
41 +
41 +
41 +
49 +
51 +
51 +
51 +
53 +
55 +
55 +
55 +
55 +
57 +
59 +
59 +
59 +
59 +
59 +
63 +
65 +
65 +
67 +
67 +
73 +
73 +
77 +
79 +
79 +
83 +
83 +
85 +
87...

result:

ok The player wins!

Test #23:

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

input:

500 1
1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 0 1 0 1 1 1 1 1 ...

output:

Alice
499 +
1 +
2 +
2 +
4 +
4 +
4 +
4 +
6 +
6 +
6 +
12 +
14 +
14 +
14 +
16 +
16 +
16 +
18 +
20 +
22 +
24 +
24 +
26 +
26 +
26 +
28 +
28 +
28 +
28 +
36 +
36 +
36 +
38 +
38 +
40 +
40 +
42 +
44 +
44 +
46 +
48 +
48 +
48 +
50 +
54 +
54 +
60 +
60 +
62 +
62 +
66 +
66 +
72 +
72 +
74 +
74 +
76 +
78 +
80 +
80 ...

result:

ok The player wins!

Test #24:

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

input:

500 0
1 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 0 1 0 1 0 1 1 1 1 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 0 1 0 1 1 1 ...

output:

Alice
1 +
8 +
12 +
34 +
50 +
54 +
54 +
56 +
62 +
62 +
66 +
68 +
88 +
92 +
102 +
108 +
114 +
120 +
124 +
126 +
128 +
128 +
128 +
146 +
158 +
158 +
162 +
186 +
192 +
194 +
198 +
198 +
234 +
262 +
264 +
272 +
282 +
284 +
284 +
290 +
300 +
312 +
312 +
318 +
340 +
344 +
352 +
358 +
386 +
394 +
1 *
1 *
1 ...

result:

ok The player wins!

Test #25:

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

input:

500 1
1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 ...

output:

Alice
252 +
4 +
6 +
12 +
28 +
38 +
42 +
46 +
54 +
62 +
66 +
68 +
92 +
108 +
110 +
112 +
114 +
116 +
120 +
126 +
134 +
136 +
140 +
156 +
156 +
180 +
186 +
202 +
222 +
236 +
244 +
248 +
270 +
270 +
276 +
278 +
290 +
318 +
328 +
342 +
344 +
348 +
358 +
360 +
370 +
370 +
374 +
382 +
388 +
392 +
392 +
1 ...

result:

ok The player wins!

Test #26:

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

input:

500 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ...

output:

Alice
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
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 The player wins!

Test #27:

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

input:

500 1
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ...

output:

Alice
100 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
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 The player wins!

Test #28:

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

input:

500 0
1 0 1 1 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 ...

output:

Alice
3 +
11 +
15 +
15 +
17 +
19 +
23 +
23 +
25 +
31 +
33 +
37 +
39 +
39 +
39 +
41 +
43 +
45 +
47 +
47 +
57 +
61 +
65 +
71 +
75 +
77 +
79 +
81 +
83 +
83 +
85 +
87 +
89 +
99 +
101 +
103 +
103 +
103 +
105 +
107 +
107 +
109 +
109 +
115 +
115 +
119 +
125 +
137 +
143 +
147 +
151 +
151 +
155 +
157 +
157 +...

result:

ok The player wins!

Test #29:

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

input:

500 1
1 0 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 ...

output:

Alice
324 +
6 +
14 +
16 +
18 +
18 +
22 +
22 +
22 +
22 +
24 +
26 +
26 +
32 +
36 +
38 +
40 +
46 +
48 +
50 +
52 +
56 +
60 +
78 +
78 +
80 +
82 +
82 +
84 +
86 +
94 +
94 +
96 +
100 +
106 +
112 +
112 +
112 +
114 +
120 +
126 +
126 +
130 +
136 +
136 +
136 +
140 +
150 +
154 +
160 +
162 +
162 +
166 +
170 +
170...

result:

ok The player wins!

Test #30:

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

input:

350 0
1 1 1 0 1 1 1 0 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 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 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 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 ...

output:

Alice
1 +
4 +
6 +
6 +
6 +
8 +
8 +
8 +
8 +
10 +
10 +
10 +
12 +
12 +
14 +
16 +
16 +
18 +
18 +
18 +
20 +
20 +
20 +
20 +
20 +
20 +
22 +
22 +
22 +
22 +
22 +
24 +
24 +
24 +
24 +
26 +
26 +
28 +
30 +
32 +
32 +
34 +
36 +
36 +
40 +
40 +
40 +
40 +
40 +
42 +
42 +
42 +
42 +
42 +
44 +
44 +
44 +
46 +
46 +
46 +
48 ...

result:

ok The player wins!

Test #31:

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

input:

350 1
1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

Alice
182 +
1 +
1 +
2 +
2 +
2 +
2 +
2 +
2 +
2 +
4 +
4 +
6 +
6 +
6 +
6 +
8 +
8 +
10 +
10 +
10 +
10 +
12 +
12 +
12 +
12 +
12 +
14 +
14 +
14 +
16 +
16 +
16 +
16 +
18 +
18 +
20 +
20 +
22 +
22 +
24 +
26 +
26 +
28 +
28 +
30 +
32 +
34 +
34 +
36 +
36 +
36 +
36 +
36 +
36 +
36 +
38 +
38 +
38 +
42 +
44 +
46 +
...

result:

ok The player wins!

Test #32:

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

input:

500 0
1 0 1 1 0 1 0 0 0 0 0 1 1 1 0 0 1 0 0 1 1 1 1 1 1 0 1 1 1 1 0 1 0 1 1 1 1 1 0 1 0 1 1 0 0 1 1 0 0 1 0 1 1 1 0 0 0 0 1 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 0 1 1 1 0 0 1 1 1 1 0 0 0 1 1 0 0 1 1 0 1 1 0 1 1 1 1 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 1 1 1 0 0 0 0 0 0 1 1 0 1 0 0 ...

output:

Alice
3 +
10 +
16 +
16 +
16 +
17 +
17 +
20 +
20 +
24 +
26 +
30 +
37 +
42 +
42 +
46 +
49 +
49 +
52 +
54 +
55 +
56 +
56 +
67 +
81 +
81 +
81 +
88 +
98 +
99 +
115 +
117 +
117 +
117 +
122 +
122 +
134 +
135 +
139 +
152 +
155 +
155 +
159 +
171 +
172 +
179 +
180 +
182 +
192 +
192 +
192 +
196 +
198 +
205 +
2...

result:

ok The player wins!

Test #33:

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

input:

500 1
1 0 1 0 0 0 1 1 1 1 0 0 0 1 0 0 0 1 0 1 1 1 0 0 1 1 0 1 1 0 0 0 0 1 0 0 0 0 1 1 1 1 0 1 1 0 0 1 1 0 0 0 1 1 0 1 1 0 1 1 0 0 0 1 1 0 0 0 0 1 1 1 0 0 0 1 1 0 1 0 1 0 0 1 0 1 1 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 0 0 0 0 0 0 1 1 0 1 0 0 1 0 0 0 0 0 1 0 1 0 0 1 1 1 1 0 0 1 0 0 0 1 0 0 0 1 1 0 0 0 1 1 1 ...

output:

Bob
6 +
6 +
15 +
18 +
19 +
28 +
28 +
29 +
31 +
34 +
35 +
36 +
39 +
43 +
47 +
55 +
55 +
58 +
72 +
87 +
87 +
97 +
100 +
100 +
103 +
103 +
103 +
106 +
107 +
107 +
107 +
109 +
110 +
111 +
113 +
113 +
117 +
122 +
123 +
123 +
128 +
129 +
132 +
132 +
132 +
150 +
151 +
155 +
162 +
162 +
164 +
169 +
169 +
16...

result:

ok The player wins!

Test #34:

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

input:

500 0
0 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 1 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 1 1 0 0 1 1 0 0 0 1 0 1 1 0 0 1 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 1 1 0 0 0 1 0 0 0 1 0 1 1 0 0 1 0 1 0 1 0 1 1 0 0 0 0 0 1 0 0 1 0 1 1 0 1 1 0 1 0 0 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 ...

output:

Alice
21 +
45 +
47 +
52 +
80 +
89 +
97 +
107 +
108 +
116 +
144 +
167 +
167 +
172 +
187 +
187 +
216 +
222 +
229 +
242 +
249 +
262 +
268 +
268 +
278 +
302 +
302 +
342 +
381 +
385 +
391 +
402 +
405 +
405 +
408 +
424 +
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
11 *
17 *
21 *
23 *
26 *
26 *
26 ...

result:

ok The player wins!

Test #35:

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

input:

500 1
0 1 1 0 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 1 0 0 0 0 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 1 0 0 1 1 0 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 0 1 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 1 0 0 0 0 0 1 ...

output:

Bob
2 +
9 +
18 +
24 +
28 +
28 +
28 +
40 +
41 +
61 +
80 +
117 +
130 +
131 +
131 +
143 +
159 +
166 +
172 +
201 +
204 +
209 +
210 +
213 +
216 +
235 +
238 +
241 +
262 +
288 +
289 +
296 +
328 +
330 +
337 +
350 +
351 +
356 +
357 +
357 +
358 +
361 +
362 +
391 +
399 +
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
11 ...

result:

ok The player wins!

Test #36:

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

input:

500 0
1 0 1 1 1 1 1 0 1 1 0 1 0 1 0 1 0 0 1 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 0 1 0 0 0 0 0 1 1 1 1 0 1 1 1 0 0 1 1 1 0 0 1 1 1 1 0 0 0 0 0 1 1 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 1 1 0 0 1 0 1 1 1 0 0 0 1 1 1 0 1 1 1 0 1 1 0 1 1 1 1 0 1 0 1 0 0 1 1 0 0 1 0 1 1 1 0 1 1 1 1 1 1 1 ...

output:

Alice
3 +
3 +
5 +
13 +
13 +
13 +
15 +
15 +
17 +
17 +
17 +
19 +
19 +
21 +
29 +
29 +
30 +
33 +
36 +
36 +
41 +
42 +
42 +
45 +
48 +
48 +
52 +
56 +
58 +
60 +
61 +
61 +
67 +
71 +
73 +
73 +
73 +
73 +
75 +
78 +
81 +
81 +
81 +
81 +
83 +
83 +
87 +
87 +
87 +
94 +
98 +
99 +
100 +
100 +
103 +
103 +
105 +
105 +
1...

result:

ok The player wins!

Test #37:

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

input:

500 1
0 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 0 1 0 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 0 1 1 1 0 0 0 1 1 0 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 0 0 0 1 1 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 0 1 1 1 1 0 0 ...

output:

Bob
6 +
10 +
13 +
13 +
13 +
15 +
15 +
15 +
17 +
17 +
20 +
21 +
22 +
22 +
23 +
28 +
28 +
28 +
31 +
31 +
31 +
33 +
33 +
34 +
35 +
39 +
40 +
40 +
42 +
42 +
42 +
42 +
42 +
42 +
42 +
45 +
45 +
48 +
51 +
56 +
56 +
56 +
57 +
57 +
59 +
59 +
59 +
66 +
67 +
68 +
68 +
68 +
81 +
81 +
82 +
83 +
84 +
86 +
89 +
90...

result:

ok The player wins!

Test #38:

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

input:

500 0
1 1 1 1 0 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 0 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 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 0 0 1 1 1 0 0 1 1 1 1 1 1 0 0 1 1 1 0 1 1 0 1 1 1 1 1 ...

output:

Alice
1 +
2 +
3 +
4 +
6 +
8 +
8 +
8 +
8 +
10 +
10 +
10 +
10 +
10 +
16 +
16 +
16 +
18 +
18 +
18 +
20 +
20 +
26 +
26 +
27 +
27 +
30 +
30 +
30 +
30 +
32 +
32 +
33 +
33 +
33 +
33 +
33 +
33 +
33 +
33 +
33 +
33 +
34 +
37 +
40 +
40 +
40 +
42 +
44 +
45 +
45 +
45 +
45 +
45 +
45 +
45 +
45 +
45 +
45 +
45 +
46 ...

result:

ok The player wins!

Test #39:

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

input:

500 1
1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 1 0 1 1 0 0 1 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 0 1 0 1 1 0 0 1 0 1 1 1 1 1 ...

output:

Bob
1 +
2 +
4 +
5 +
5 +
5 +
5 +
5 +
6 +
6 +
6 +
8 +
8 +
8 +
8 +
8 +
9 +
11 +
11 +
11 +
11 +
13 +
14 +
19 +
19 +
19 +
19 +
20 +
20 +
20 +
24 +
24 +
24 +
24 +
24 +
24 +
27 +
27 +
27 +
27 +
31 +
31 +
31 +
31 +
31 +
32 +
32 +
34 +
40 +
44 +
44 +
44 +
47 +
47 +
48 +
48 +
49 +
52 +
54 +
55 +
56 +
56 +
56 ...

result:

ok The player wins!

Test #40:

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

input:

500 0
1 1 1 1 1 1 0 0 1 0 1 0 1 1 1 1 0 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 1 0 1 0 0 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 0 0 1 1 0 1 1 0 1 1 1 1 1 1 0 0 1 1 0 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 ...

output:

Alice
1 +
2 +
2 +
7 +
7 +
9 +
9 +
9 +
10 +
10 +
10 +
10 +
10 +
11 +
11 +
11 +
13 +
13 +
13 +
13 +
15 +
15 +
15 +
15 +
15 +
25 +
25 +
25 +
29 +
29 +
32 +
33 +
34 +
34 +
34 +
36 +
37 +
38 +
40 +
42 +
46 +
46 +
46 +
46 +
46 +
46 +
46 +
50 +
52 +
56 +
56 +
56 +
56 +
56 +
56 +
60 +
60 +
60 +
60 +
60 +
61...

result:

ok The player wins!

Test #41:

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

input:

500 1
1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 1 1 1 0 0 1 0 0 1 0 1 1 0 1 1 1 1 ...

output:

Bob
1 +
2 +
4 +
4 +
4 +
4 +
4 +
4 +
4 +
7 +
8 +
13 +
13 +
14 +
14 +
14 +
14 +
14 +
14 +
15 +
18 +
18 +
18 +
18 +
18 +
19 +
19 +
22 +
22 +
22 +
24 +
24 +
24 +
24 +
27 +
27 +
28 +
28 +
28 +
28 +
29 +
29 +
30 +
30 +
30 +
30 +
30 +
36 +
36 +
42 +
43 +
43 +
43 +
43 +
45 +
45 +
45 +
45 +
46 +
46 +
48 +
48...

result:

ok The player wins!

Test #42:

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

input:

39 0
1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 0 1 0 1 1 1 0 1 1 1 0 1
3 +
5 +
5 +
7 +
9 +
9 +
9 +
11 +
15 +
17 +
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1

output:

Bob
2 +
4 +
4 +
6 +
8 +
8 +
8 +
10 +
14 +
16 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +

result:

ok The player wins!

Test #43:

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

input:

9 0
1 0 1 1 1 1 1 1 1
3 +
3 +
3 +
1 *
1

output:

Bob
2 +
2 +
2 +
1 +

result:

ok The player wins!

Extra Test:

score: 0
Extra Test Passed