QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#355510#7863. Parity Gameucup-team1191#AC ✓7ms3844kbC++233.5kb2024-03-16 18:52:112024-03-16 18:52:13

Judging History

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

  • [2024-03-16 18:52:13]
  • 评测
  • 测评结果:AC
  • 用时:7ms
  • 内存:3844kb
  • [2024-03-16 18:52:11]
  • 提交

answer

#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long ll;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, t;
  cin >> n >> t;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int last = n % 2;

  auto make = [&](int x, int y, int z) {
    // 0 - sum, 1 - mult, -1 - impossible
    if (z == 0) {
      if (x == 0 || y == 0) {
        return 1;
      } else {
        return 0;
      }
    } else {
      if (x == 1 && y == 1) {
        return 1;
      } else if (x == 1 || y == 1) {
        return 0;
      } else {
        return -1;
      }
    }
  };

  auto make_op = [&](int p, int op) {
    int x;
    if (op == 0) {
      x = (a[p] + a[p + 1]) % 2;
    } else {
      x = a[p] * a[p + 1];
    }
    a.erase(a.begin() + p);
    a.erase(a.begin() + p);
    a.insert(a.begin() + p, x);
  };

  auto check_good = [&](const vector<int> &a) {
    assert(a.size() % 2 == 1);
    for (int i = 0; i < (int)a.size(); i += 2) {
      if (a[i] == 0) {
        return 1;
      }
    } 
    return 0;
  };

  if (last == t) {
    int play = last;
    cout << (play == 0 ? "Alice" : "Bob") << endl;
    for (int turn = 0; turn < n - 1; ++turn) {
      if (turn % 2 == play) {
        int op = make(a[0], a[1], 0);
        cout << 1 << ' ' << (op == 0 ? "+" : "*") << endl;
        make_op(0, op);
      } else {
        int p; char c;
        cin >> p >> c;
        --p; 
        make_op(p, (c == '+' ? 0 : 1));
      }
    }
  } else {
    bool want_nlast = false;
    if (n % 2 == 1) {
      if (check_good(a)) {
        want_nlast = true;
      }
    } else {
      want_nlast = true;
      for (int i = 0; i + 1 < n; ++i) {
        for (int op = 0; op <= 1; ++op) {
          vector<int> sf = a;
          make_op(i, op);
          if (!check_good(a)) {
            want_nlast = false;
          }
          a = sf;
        }
      }
    }
    int play;
    if (want_nlast) {
      play = last ^ 1;
    } else {
      play = last;
    }
    cout << (play == 0 ? "Alice" : "Bob") << endl;
    for (int turn = 0; turn < n - 1; ++turn) {
      if (turn % 2 == play) {
        if (want_nlast) {
          int idx;
          if (a[0] != 0) {
            idx = 0;
          } else {
            idx = (int)a.size() - 2;
          }
          int op = make(a[idx], a[idx + 1], 0);
          cout << idx + 1 << ' ' << (op == 0 ? "+" : "*") << endl;
          make_op(idx, op);
        } else {
          int idx = -1, go_op = -1;
          for (int i = 0; i + 1 < (int)a.size(); ++i) {
            for (int op = 0; op <= 1; ++op) {
              vector<int> sf = a;
              make_op(i, op); 
              if (!check_good(a)) {
                idx = i, go_op = op;
                break;
              }
              a = sf;
            }
            if (idx != -1) {
              break;
            }
          }
          assert(idx != -1);
          cout << idx + 1 << ' ' << (go_op == 0 ? "+" : "*") << endl;
        }
      } else {
        int p; char c;
        cin >> p >> c;
        --p; 
        make_op(p, (c == '+' ? 0 : 1));
      }
    }
  }
}

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

详细

Test #1:

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

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

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

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: 0ms
memory: 3624kb

input:

3 0
1 1 1
1 +
1

output:

Bob
1 +

result:

ok The player wins!

Test #5:

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

input:

3 1
1 0 1
1 *
1

output:

Bob
1 *

result:

ok The player wins!

Test #6:

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

input:

3 0
1 0 1
1 *
1

output:

Bob
1 +

result:

ok The player wins!

Test #7:

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

input:

2 1
0 1
1

output:

Alice
1 +

result:

ok The player wins!

Test #8:

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

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
498 *
496 *
1 +
1 +
1 +
1 *
1 +
1 *
1 +
1 *
1 *
1 +
1 *
1 +
1 +
1 *
1 +
1 +
1 *
1 +
1 *
1 *
1 +
1 +
1 +
1 +
1 *
1 +
1 +
1 *
1 +
1 +
1 *
1 +
1 +
1 +
1 *
1 +
1 +
1 +
1 +
1 *
1 +
1 +
1 +
1 *
1 +
1 +
1 *
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 #9:

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

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 +
1 +
1 +
1 +
3 +
5 +
5 +
7 +
9 +
11 +
11 +
13 +
13 +
17 +
17 +
17 +
17 +
17 +
19 +
21 +
23 +
23 +
23 +
25 +
25 +
29 +
31 +
33 +
33 +
33 +
33 +
35 +
37 +
43 +
45 +
47 +
47 +
49 +
49 +
51 +
51 +
53 +
57 +
59 +
59 +
61 +
63 +
63 +
65 +
65 +
69 +
69 +
71 +
73 +
75 +
75 +
77 +
77 +
83 +
85 +
85 +
...

result:

ok The player wins!

Test #10:

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

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
1 *
1 +
1 *
1 +
1 +
1 *
1 +
1 +
1 +
1 *
1 *
1 +
1 +
1 *
1 +
1 +
1 *
1 +
1 *
1 +
1 +
1 *
1 +
1 +
1 *
1 +
1 *
1 +
1 +
1 *
1 +
1 +
1 +
1 +
1 *
1 +
1 *
1 +
1 *
1 +
1 *
1 *
1 +
1 +
1 *
1 +
1 *
1 *
1 +
1 +
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 #11:

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

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 +
1 *
1 *
1 *
1 *
1 +
1 *
1 *
1 +
1 +
1 *
1 +
1 *
1 *
1 +
1 +
1 *
1 +
1 *
1 *
1 +
1 +
1 +
1 *
1 +
1 *
1 +
1 +
1 *
1 +
1 +
1 +
1 +
1 *
1 +
1 +
1 *
1 *
1 *
1 +
1 +
1 +
1 +
1 +
1 *
1 *
1 +
1 +
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 #12:

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

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
1 *
1 *
1 +
1 +
1 *
1 +
1 *
1 +
1 +
1 *
1 *
1 +
1 *
1 +
1 +
1 *
1 +
1 *
1 +
1 *
1 +
1 *
1 *
1 +
1 +
1 +
1 +
1 +
1 *
1 +
1 *
1 +
1 *
1 +
1 +
1 +
1 +
1 +
1 *
1 *
1 +
1 *
1 +
1 *
1 +
1 *
1 +
1 *
1 +
1 *
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 #13:

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

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 +
1 +
1 +
1 +
1 +
1 +
3 +
3 +
5 +
11 +
11 +
13 +
13 +
13 +
15 +
15 +
15 +
19 +
21 +
21 +
23 +
23 +
25 +
25 +
25 +
27 +
27 +
27 +
33 +
35 +
35 +
35 +
37 +
37 +
39 +
41 +
41 +
43 +
45 +
45 +
45 +
45 +
49 +
51 +
51 +
57 +
57 +
59 +
61 +
63 +
65 +
71 +
71 +
73 +
73 +
73 +
75 +
77 +
77 +
...

result:

ok The player wins!

Test #14:

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

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: 0ms
memory: 3832kb

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
498 *
496 *
494 *
492 *
490 *
488 *
486 *
484 *
482 *
480 *
478 *
476 *
474 *
472 *
470 *
468 *
466 *
464 *
462 *
460 *
458 *
456 *
454 *
452 *
450 *
448 *
446 *
444 *
442 *
440 *
438 *
436 *
434 *
432 *
430 *
428 *
426 *
424 *
422 *
420 *
418 *
416 *
414 *
412 *
410 *
408 *
406 *
404 *
402 *
...

result:

ok The player wins!

Test #16:

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

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

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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*
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
...

result:

ok The player wins!

Test #19:

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

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

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

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

input:

500 0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15 +
17 +
19 +
21 +
23 +
23 +
25 +
25 +
25 +
27 +
27 +
27 +
27 +
35 +
35 +
35 +
37 +
37 +
39 +
39 +
41 +
43 +
43 +
45 +
47 +
47 +
47 +
49 +
53 +
53 +
59 +
59 +
61 +
61 +
65 +
65 +
71 +
71 +
73 +
73 +
75 +
77 +
79 +
79 ...

result:

ok The player wins!

Test #24:

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

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 +
1 *
1 *
1 *
1 *
1 +
1 *
1 *
1 +
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 +
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 +
1 *
1 *
1 +
1 +
1 *
1 +
1 *
1 *
1 *
1 +
1 +
1 *
1 *
1 +
1 *
1 +
1 *
1 *
1 *
1 *
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 #25:

score: 0
Accepted
time: 3ms
memory: 3572kb

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
251 +
3 +
5 +
11 +
27 +
37 +
41 +
45 +
53 +
61 +
65 +
67 +
91 +
107 +
109 +
111 +
113 +
115 +
119 +
125 +
133 +
135 +
139 +
155 +
155 +
179 +
185 +
201 +
221 +
235 +
243 +
247 +
269 +
269 +
275 +
277 +
289 +
317 +
327 +
341 +
343 +
347 +
357 +
359 +
369 +
369 +
373 +
381 +
387 +
391 +
391 +
1 ...

result:

ok The player wins!

Test #26:

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

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

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
99 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
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: 0ms
memory: 3796kb

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
1 *
1 +
1 *
1 *
1 *
1 *
1 +
1 *
1 *
1 +
1 +
1 *
1 +
1 *
1 +
1 *
1 *
1 +
1 +
1 *
1 +
1 *
1 *
1 *
1 +
1 *
1 +
1 *
1 *
1 +
1 *
1 +
1 +
1 +
1 *
1 +
1 *
1 +
1 *
1 +
1 *
1 +
1 +
1 *
1 *
1 *
1 *
1 *
1 +
1 *
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 #29:

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

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
323 +
5 +
13 +
15 +
17 +
17 +
21 +
21 +
21 +
21 +
23 +
25 +
25 +
31 +
35 +
37 +
39 +
45 +
47 +
49 +
51 +
55 +
59 +
77 +
77 +
79 +
81 +
81 +
83 +
85 +
93 +
93 +
95 +
99 +
105 +
111 +
111 +
111 +
113 +
119 +
125 +
125 +
129 +
135 +
135 +
135 +
139 +
149 +
153 +
159 +
161 +
161 +
165 +
169 +
169 ...

result:

ok The player wins!

Test #30:

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

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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+
35 +
35 +
35 +
35 +
35 +
35 +
37 +
37 +
37 +
41 +
43 +
45 +
45 +...

result:

ok The player wins!

Test #32:

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

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
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
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 #33:

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

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
1 *
496 *
494 *
492 *
490 *
488 *
486 *
484 *
482 *
480 *
478 *
476 *
474 *
472 *
470 *
468 *
466 *
464 *
462 *
460 *
458 *
456 *
454 *
452 *
450 *
448 *
446 *
444 *
442 *
440 *
438 *
436 *
434 *
432 *
430 *
428 *
426 *
424 *
422 *
420 *
418 *
416 *
414 *
412 *
410 *
408 *
406 *
404 *
402 *
400 ...

result:

ok The player wins!

Test #34:

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

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
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
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 #35:

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

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
498 *
496 *
494 *
492 *
490 *
488 *
486 *
484 *
482 *
480 *
478 *
476 *
474 *
472 *
470 *
468 *
466 *
464 *
462 *
460 *
458 *
456 *
454 *
452 *
450 *
448 *
446 *
444 *
442 *
440 *
438 *
436 *
434 *
432 *
430 *
428 *
426 *
424 *
422 *
420 *
418 *
416 *
414 *
412 *
410 *
408 *
406 *
404 *
402 *
40...

result:

ok The player wins!

Test #36:

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

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
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
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 #37:

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

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
498 *
496 *
494 *
492 *
490 *
488 *
486 *
484 *
482 *
480 *
478 *
476 *
474 *
472 *
470 *
468 *
466 *
464 *
462 *
460 *
458 *
456 *
454 *
452 *
450 *
448 *
446 *
444 *
442 *
440 *
438 *
436 *
434 *
432 *
430 *
428 *
426 *
424 *
422 *
420 *
418 *
416 *
414 *
1 *
1 *
1 +
406 *
1 *
1 +
400 *
1 *
1 ...

result:

ok The player wins!

Test #38:

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

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 +
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 +
1 *
1 +
1 +
1 *
1 *
1 *
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 #39:

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

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 +
496 +
494 *
492 *
490 *
488 *
486 *
484 *
482 *
480 *
478 *
476 *
474 *
472 *
470 *
468 *
466 *
464 *
462 *
460 *
458 *
456 *
454 *
452 *
450 *
448 *
446 *
444 *
442 *
440 *
438 *
1 +
1 *
1 +
430 *
1 +
1 +
1 +
1 +
1 +
418 *
1 +
1 +
1 +
1 *
1 +
1 +
1 +
1 +
1 +
398 *
396 *
1 +
1 *
1 +
1 +
1 +
...

result:

ok The player wins!

Test #40:

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

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 +
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 *
1 +
1 +
1 +
1 +
1 *
1 +
1 +
1 +
1 +
1 +
1 *
1 *
1 *
1 *
1 +
1 +
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 #41:

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

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 +
496 +
494 *
492 *
490 *
488 *
486 *
484 *
482 *
480 *
478 *
476 *
474 *
472 *
470 *
468 *
466 *
464 *
462 *
460 *
458 *
456 *
454 *
1 +
1 *
1 +
1 +
1 +
1 +
1 +
1 +
1 +
434 *
1 *
1 +
428 *
1 +
424 *
422 *
1 *
1 *
1 +
1 +
412 *
1 +
1 +
1 +
1 +
1 +
1 +
398 *
1 +
394 *
1 *
1 +
1 +
1 +
1 +
1 +
38...

result:

ok The player wins!

Test #42:

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

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
1 +
3 +
3 +
5 +
7 +
7 +
7 +
9 +
13 +
15 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +

result:

ok The player wins!

Test #43:

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

input:

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

output:

Bob
1 +
1 +
1 +
1 +

result:

ok The player wins!

Extra Test:

score: 0
Extra Test Passed