QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#269111#7863. Parity Gameucup-team1209#AC ✓3ms3620kbC++203.4kb2023-11-29 12:59:142023-11-29 12:59:15

Judging History

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

  • [2023-11-29 12:59:15]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3620kb
  • [2023-11-29 12:59:14]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for (int i=(x);i<=(y);i++)
#define drep(i,y,x) for (int i=(y);i>=(x);i--)
#define pii pair<int,int>
#define fir first
#define sec second
#define MP make_pair
template<typename T> bool chkmin(T &x,T y){return x>y?x=y,1:0;}
template<typename T> bool chkmax(T &x,T y){return x<y?x=y,1:0;}
void file() {
    #ifdef zqj
    freopen("a.in","r",stdin);
    #endif
}
typedef long long ll;
#define sz 555

int n,t;
int a[sz];

// unsigned long long seed = 94587174228670ull; 
unsigned long long seed = time(0) + (size_t)(new char);
mt19937 rng(seed);

void input() {
    int p; char op;
    #ifndef zqj
    cin>>p;
    cin>>op;
    #else
    p = rng()%n+1;
    op = "+*"[rng()%2];
    #endif
    if (op=='+') a[p]^=a[p+1];
    else a[p]&=a[p+1];
    rep(i,p+1,n-1) a[i]=a[i+1];
}

void workodd(int self) {
    int cur=0;
    while (n!=1) {
        if (cur==self) {
            static int b[sz];
            rep(i,1,n-1) if (a[i]||a[i+1]) {
                rep(j,1,i-1) b[j]=a[j];
                b[i]=1;
                rep(j,i+2,n) b[j-1]=a[j];
                int ok=1;
                for (int i=1;i<=n;i+=2) ok&=b[i];
                if (ok) {
                    cout<<i<<' '<<"*+"[a[i]!=a[i+1]]<<'\n';
                    rep(i,1,n-1) a[i]=b[i];
                    break;
                }
            }
        }
        else input();
        --n; cur^=1;
    }
    assert(a[1]==1);
    exit(0);
}

void workeven(int self) {
    int cur=0;
    while (n!=1) {
        if (cur==self) {
            for (int i=1;i<=n;i+=2) if (!a[i]) {
                if (i==1) {
                    cout<<2<<' '<<"*+"[a[2]==a[3]]<<'\n';
                    a[i+1]=0;
                    rep(j,i+3,n) a[j-1]=a[j];
                }
                else {
                    cout<<i-2<<' '<<"*+"[a[i-2]==a[i-1]]<<'\n';
                    a[i-2]=0;
                    rep(j,i,n) a[j-1]=a[j];
                }
                break;
            }
        }
        else input();
        --n; cur^=1;
    }
    assert(a[1]==0);
    exit(0);
}


int main() {
    #ifndef zqj
    cin>>n>>t;
    rep(i,1,n) cin>>a[i];
    #else
    n = rng() % 6 + 2;
    t = rng() % 2;
    rep(i,1,n) a[i] = rng() % 2;
    cerr<<n<<' '<<t<<'\n';
    rep(i,1,n) cerr<<a[i]<<" \n"[i==n];
    cerr<<seed<<'\n';
    #endif
    if (n%2==t) {
        cout<<(t?"Bob":"Alice")<<'\n';
        int cur=0;
        while (n!=1) {
            if (cur==t) {
                cout<<n-1<<' ';
                if (a[n-1]==a[n]) cout<<"+\n";
                else cout<<"*\n";
                a[n-1]=0;
            }
            else input();
            cur^=1; --n;
        }
        assert(a[1]==0);
        return 0;
    }
    if (t==0) {
        int ok=1;
        for (int i=1;i<=n;i+=2) ok&=a[i];
        if (ok) {
            cout<<"Bob\n";
            workodd(1);
        }
        else {
            cout<<"Alice\n";
            workeven(0);
        }
    }
    else {
        static int b[sz];
        rep(i,1,n-1) if (a[i]||a[i+1]) {
            rep(j,1,i-1) b[j]=a[j];
            b[i]=1;
            rep(j,i+2,n) b[j-1]=a[j];
            int ok=1;
            for (int i=1;i<=n;i+=2) ok&=b[i];
            if (!ok) continue;
            cout<<"Alice\n";
            workodd(0);
        }
        cout<<"Bob\n";
        workeven(1);
    }
    return 0;
}

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

详细

Test #1:

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

input:

4 1
0 1 0 1
1 *
1

output:

Alice
1 +
1 +

result:

ok The player wins!

Test #2:

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

input:

4 0
1 0 1 0
2 +
1

output:

Alice
3 *
1 *

result:

ok The player wins!

Test #3:

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

input:

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

output:

Bob
3 *
1 *

result:

ok The player wins!

Test #4:

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

input:

3 0
1 1 1
1 +
1

output:

Bob
1 +

result:

ok The player wins!

Test #5:

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

input:

3 1
1 0 1
1 *
1

output:

Bob
1 *

result:

ok The player wins!

Test #6:

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

input:

3 0
1 0 1
1 *
1

output:

Bob
1 +

result:

ok The player wins!

Test #7:

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

input:

2 1
0 1
1

output:

Alice
1 +

result:

ok The player wins!

Test #8:

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

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 +
2 *
2 +
2 *
2 +
2 *
2 *
2 +
2 *
2 +
2 +
2 *
2 +
2 +
2 *
2 +
2 *
2 *
2 +
2 +
2 +
2 +
2 *
2 +
2 +
2 *
2 +
2 +
2 *
2 +
2 +
2 +
2 *
2 +
2 +
2 +
2 +
2 *
2 +
2 +
2 +
2 *
2 +
2 +
2 *
2 +
2 *
2 +
2 *
2 +
2 *
2 +
2 +
2 *
2 *
2 *
2 *
2 +
2 +
2 +
2 +
2 +
2 *
2 *
2 +
2 *
2 +
2 +
2 +
2 *
2 *
2 ...

result:

ok The player wins!

Test #9:

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

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

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
499 +
497 *
495 *
493 *
491 *
489 *
487 *
485 *
483 *
481 *
479 *
477 *
475 *
473 *
471 *
469 *
467 *
465 *
463 *
461 *
459 *
457 *
455 *
453 *
451 *
449 *
447 *
445 *
443 *
441 *
439 *
437 *
435 *
433 *
431 *
429 *
427 *
425 *
423 *
421 *
419 *
417 *
415 *
413 *
411 *
409 *
407 *
405 *
403 *
...

result:

ok The player wins!

Test #11:

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

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
497 +
495 *
493 *
491 *
489 *
487 *
485 *
483 *
481 *
479 *
477 *
475 *
473 *
471 *
469 *
467 *
465 *
463 *
461 *
459 *
457 *
455 *
453 *
451 *
449 *
447 *
445 *
443 *
441 *
439 *
437 *
435 *
433 *
431 *
429 *
427 *
425 *
423 *
421 *
419 *
417 *
415 *
413 *
411 *
409 *
407 *
405 *
403 *
401 *
39...

result:

ok The player wins!

Test #12:

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

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
497 +
495 *
493 *
491 *
489 *
487 *
485 *
483 *
481 *
479 *
477 *
475 *
473 *
471 *
469 *
467 *
465 *
463 *
461 *
459 *
457 *
455 *
453 *
451 *
449 *
447 *
445 *
443 *
441 *
439 *
437 *
435 *
433 *
431 *
429 *
427 *
425 *
423 *
421 *
419 *
417 *
415 *
413 *
411 *
409 *
407 *
405 *
403 *
401 *
39...

result:

ok The player wins!

Test #13:

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

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

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
499 *
497 *
495 *
493 *
491 *
489 *
487 *
485 *
483 *
481 *
479 *
477 *
475 *
473 *
471 *
469 *
467 *
465 *
463 *
461 *
459 *
457 *
455 *
453 *
451 *
449 *
447 *
445 *
443 *
441 *
439 *
437 *
435 *
433 *
431 *
429 *
427 *
425 *
423 *
421 *
419 *
417 *
415 *
413 *
411 *
409 *
407 *
405 *
403 *
...

result:

ok The player wins!

Test #15:

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

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

result:

ok The player wins!

Test #16:

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

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

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

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
497 *
495 *
493 *
491 *
489 *
487 *
485 *
483 *
481 *
479 *
477 *
475 *
473 *
471 *
469 *
467 *
465 *
463 *
461 *
459 *
457 *
455 *
453 *
451 *
449 *
447 *
445 *
443 *
441 *
439 *
437 *
435 *
433 *
431 *
429 *
427 *
425 *
423 *
421 *
419 *
417 *
415 *
413 *
411 *
409 *
407 *
405 *
403 *
401 *
39...

result:

ok The player wins!

Test #19:

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

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
497 *
495 *
493 *
491 *
489 *
487 *
485 *
483 *
481 *
479 *
477 *
475 *
473 *
471 *
469 *
467 *
465 *
463 *
461 *
459 *
457 *
455 *
453 *
451 *
449 *
447 *
445 *
443 *
441 *
439 *
437 *
435 *
433 *
431 *
429 *
427 *
425 *
423 *
421 *
419 *
417 *
415 *
413 *
411 *
409 *
407 *
405 *
403 *
401 *
39...

result:

ok The player wins!

Test #20:

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

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
499 *
497 *
495 *
493 *
491 *
489 *
487 *
485 *
483 *
481 *
479 *
477 *
475 *
473 *
471 *
469 *
467 *
465 *
463 *
461 *
459 *
457 *
455 *
453 *
451 *
449 *
447 *
445 *
443 *
441 *
439 *
437 *
435 *
433 *
431 *
429 *
427 *
425 *
423 *
421 *
419 *
417 *
415 *
413 *
411 *
409 *
407 *
405 *
403 *
...

result:

ok The player wins!

Test #21:

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

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

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
499 *
497 *
495 *
493 *
491 *
489 *
487 *
485 *
483 *
481 *
479 *
477 *
475 *
473 *
471 *
469 *
467 *
465 *
463 *
461 *
459 *
457 *
455 *
453 *
451 *
449 *
447 *
445 *
443 *
441 *
439 *
437 *
435 *
433 *
431 *
429 *
427 *
425 *
423 *
421 *
419 *
417 *
415 *
413 *
411 *
409 *
407 *
405 *
403 *
...

result:

ok The player wins!

Test #23:

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

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 +
1 +
1 +
3 +
3 +
3 +
3 +
5 +
5 +
5 +
11 +
13 +
13 +
13 +
15 +
15 +
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: 0ms
memory: 3500kb

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
499 *
497 *
495 *
493 *
491 *
489 *
487 *
485 *
483 *
481 *
479 *
477 *
475 *
473 *
471 *
469 *
467 *
465 *
463 *
461 *
459 *
457 *
455 *
453 *
451 *
449 *
447 *
445 *
443 *
441 *
439 *
437 *
435 *
433 *
431 *
429 *
427 *
425 *
423 *
421 *
419 *
417 *
415 *
413 *
411 *
409 *
407 *
405 *
403 *
...

result:

ok The player wins!

Test #25:

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

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

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
499 *
497 *
495 *
493 *
491 *
489 *
487 *
485 *
483 *
481 *
479 *
477 *
475 *
473 *
471 *
469 *
467 *
465 *
463 *
461 *
459 *
457 *
455 *
453 *
451 *
449 *
447 *
445 *
443 *
441 *
439 *
437 *
435 *
433 *
431 *
429 *
427 *
425 *
423 *
421 *
419 *
417 *
415 *
413 *
411 *
409 *
407 *
405 *
403 *
...

result:

ok The player wins!

Test #27:

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

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

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
499 +
497 *
495 *
493 *
491 *
489 *
487 *
485 *
483 *
481 *
479 *
477 *
475 *
473 *
471 *
469 *
467 *
465 *
463 *
461 *
459 *
457 *
455 *
453 *
451 *
449 *
447 *
445 *
443 *
441 *
439 *
437 *
435 *
433 *
431 *
429 *
427 *
425 *
423 *
421 *
419 *
417 *
415 *
413 *
411 *
409 *
407 *
405 *
403 *
...

result:

ok The player wins!

Test #29:

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

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

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
349 +
347 *
345 *
343 *
341 *
339 *
337 *
335 *
333 *
331 *
329 *
327 *
325 *
323 *
321 *
319 *
317 *
315 *
313 *
311 *
309 *
307 *
305 *
303 *
301 *
299 *
297 *
295 *
293 *
291 *
289 *
287 *
285 *
283 *
281 *
279 *
277 *
275 *
273 *
271 *
269 *
267 *
265 *
263 *
261 *
259 *
257 *
255 *
253 *
...

result:

ok The player wins!

Test #31:

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

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
181 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
1 +
3 +
3 +
5 +
5 +
5 +
5 +
7 +
7 +
9 +
9 +
9 +
9 +
11 +
11 +
11 +
11 +
11 +
13 +
13 +
13 +
15 +
15 +
15 +
15 +
17 +
17 +
19 +
19 +
21 +
21 +
23 +
25 +
25 +
27 +
27 +
29 +
31 +
33 +
33 +
35 +
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: 3600kb

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
499 +
497 *
495 *
493 *
491 +
489 *
487 *
485 +
483 *
481 +
479 *
477 *
475 *
473 +
471 +
469 +
467 +
465 *
463 +
461 +
459 +
457 *
455 +
453 +
451 *
449 *
447 +
445 *
443 +
441 +
439 +
437 *
435 +
433 *
431 +
429 *
427 +
425 *
423 *
421 +
419 +
417 *
415 +
413 +
411 *
409 *
407 *
405 *
403 *
...

result:

ok The player wins!

Test #33:

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

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
3 *
1 *
2 +
2 +
2 +
2 *
2 +
2 *
2 *
2 +
2 +
2 +
2 *
2 *
2 +
2 *
2 +
2 +
2 +
2 +
2 *
2 *
2 *
2 *
2 +
2 +
2 *
2 *
2 +
2 +
2 *
2 *
2 +
2 *
2 +
2 +
2 *
2 *
2 *
2 *
2 *
2 *
2 +
2 +
2 +
2 +
2 *
2 +
2 *
2 *
2 +
2 +
2 +
2 +
2 *
2 +
2 *
2 +
2 +
2 *
2 *
2 *
2 +
2 *
2 *
2 +
2 *
2 +
2 *
2 *
2 +
2 +
2 +
2 *
...

result:

ok The player wins!

Test #34:

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

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
499 +
497 +
495 +
493 +
491 *
489 *
487 +
485 +
483 +
481 +
479 +
477 *
475 +
473 +
471 +
469 +
467 +
465 +
463 +
461 +
459 +
457 +
455 *
453 *
451 +
449 +
447 +
445 *
443 *
441 *
439 *
437 +
435 +
433 *
431 *
429 *
427 +
425 +
423 +
421 +
419 *
417 +
415 *
413 +
411 *
409 +
407 +
405 *
403 *
...

result:

ok The player wins!

Test #35:

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

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 +
2 *
2 +
2 +
2 *
2 *
2 *
2 +
2 *
2 +
2 +
2 +
2 *
2 +
2 +
2 +
2 +
2 +
2 +
2 +
2 *
2 *
2 +
2 +
2 *
2 +
2 +
2 *
2 +
2 +
2 *
2 +
2 +
2 +
2 +
2 +
2 +
2 +
2 *
2 *
2 +
2 *
2 +
2 +
2 +
2 +
2 *
2 *
2 +
2 +
2 *
2 *
2 +
2 *
2 *
2 +
2 *
2 +
2 *
2 +
2 +
2 +
2 +
2 +
2 *
2 +
2 *
2 +
2 *
2 *
2 +
2 +
2 *
2 *
...

result:

ok The player wins!

Test #36:

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

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
499 *
497 +
495 +
493 *
491 *
489 *
487 *
485 *
483 *
481 +
479 *
477 *
475 *
473 *
471 *
469 *
467 *
465 *
463 *
461 *
459 *
457 +
455 *
453 +
451 *
449 *
447 +
445 *
443 *
441 +
439 *
437 *
435 +
433 +
431 *
429 +
427 *
425 *
423 *
421 +
419 +
417 *
415 *
413 +
411 *
409 *
407 +
405 *
403 +
...

result:

ok The player wins!

Test #37:

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

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
2 *
2 *
2 +
2 *
2 +
2 +
2 *
2 *
2 +
2 +
2 +
2 *
2 +
2 +
2 +
2 *
2 +
2 *
2 *
2 +
2 *
2 *
2 +
2 +
2 *
2 *
2 *
2 *
2 +
2 +
2 +
2 *
2 *
2 +
2 +
2 +
2 *
2 +
2 *
2 +
2 *
2 +
2 +
2 *
2 *
2 +
2 +
2 +
2 +
2 +
2 +
2 +
2 +
2 +
2 +
2 *
2 *
2 +
2 *
2 +
2 +
2 +
2 *
2 +
2 +
2 +
2 +
2 +
2 +
2 *
2 +
2 *
2 *
2 +
...

result:

ok The player wins!

Test #38:

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

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
499 *
497 *
495 *
493 *
491 +
489 *
487 *
485 *
483 *
481 *
479 *
477 *
475 +
473 +
471 *
469 *
467 *
465 *
463 +
461 +
459 *
457 *
455 +
453 *
451 +
449 *
447 *
445 +
443 *
441 *
439 +
437 *
435 *
433 *
431 *
429 *
427 *
425 *
423 *
421 *
419 *
417 *
415 *
413 *
411 *
409 *
407 *
405 *
403 *
...

result:

ok The player wins!

Test #39:

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

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
7 +
5 *
3 +
1 +
2 +
2 +
2 +
2 +
2 +
2 *
2 +
2 +
2 +
2 *
2 +
2 +
2 +
2 +
2 *
2 +
2 *
2 *
2 +
2 +
2 +
2 *
2 *
2 *
2 +
2 +
2 *
2 *
2 +
2 +
2 +
2 *
2 +
2 +
2 +
2 +
2 +
2 +
2 +
2 +
2 +
2 +
2 +
2 +
2 *
2 +
2 +
2 +
2 +
2 *
2 *
2 +
2 +
2 +
2 +
2 *
2 +
2 +
2 *
2 +
2 *
2 *
2 *
2 +
2 +
2 *
2 +
2 +
2 +
2 *
...

result:

ok The player wins!

Test #40:

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

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
499 +
497 *
495 *
493 *
491 *
489 *
487 *
485 *
483 *
481 +
479 +
477 +
475 *
473 *
471 *
469 *
467 *
465 *
463 *
461 *
459 +
457 +
455 *
453 *
451 *
449 *
447 *
445 *
443 *
441 *
439 *
437 *
435 *
433 *
431 *
429 *
427 *
425 *
423 *
421 *
419 *
417 *
415 *
413 *
411 *
409 *
407 *
405 *
403 *
...

result:

ok The player wins!

Test #41:

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

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
19 +
17 +
15 +
13 +
11 +
9 +
7 +
5 *
3 +
1 +
2 *
2 +
2 *
2 *
2 *
2 *
2 +
2 +
2 *
2 +
2 +
2 +
2 +
2 +
2 *
2 +
2 *
2 *
2 +
2 +
2 +
2 +
2 *
2 +
2 +
2 *
2 *
2 +
2 +
2 +
2 *
2 +
2 +
2 +
2 *
2 *
2 +
2 +
2 *
2 +
2 +
2 +
2 *
2 +
2 +
2 *
2 +
2 +
2 +
2 +
2 +
2 *
2 *
2 *
2 +
2 *
2 *
2 +
2 *
2 +
2 *
2 +
2 +...

result:

ok The player wins!

Test #42:

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

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: 1ms
memory: 3476kb

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