QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#426380#7863. Parity GamelmeowdnAC ✓2ms4104kbC++142.9kb2024-05-31 09:36:122024-05-31 09:36:12

Judging History

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

  • [2024-05-31 09:36:12]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:4104kb
  • [2024-05-31 09:36:12]
  • 提交

answer

//Shirasu Azusa 2024.5
#include <bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define mp make_pair
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 i128;
template<class T,class S>
bool chmax(T &a,const S b) {return (a<b?a=b,1:0);}
template<class T,class S>
bool chmin(T &a,const S b) {return (a>b?a=b,1:0);}
int popcnt(int x) {return __builtin_popcount(x);}
int popcnt(ll x)  {return __builtin_popcountll(x);}
int topbit(int x) {return (x==0?-1:31-__builtin_clz(x));}
int topbit(ll x)  {return (x==0?-1:63-__builtin_clzll(x));}
int lowbit(int x) {return (x==0?-1:__builtin_ctz(x));}
int lowbit(ll x)  {return (x==0?-1:__builtin_ctzll(x));}

#define int long long
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
typedef pair<int,int> pii;  
typedef vector<int> vi;
typedef vector<pii> vp;
typedef tuple<int,int,int> tiii;
int read() {
  int x=0,w=1; char c=getchar(); 
  while(!isdigit(c)) {if(c=='-') w=-1; c=getchar();}
  while(isdigit(c)) {x=x*10+(c-'0'); c=getchar();} 
  return x*w;
}

const int N=505;
int a[N],n,k,stp;

void work(int pos,char *opt) {
  if(opt[0]=='*') {
    a[pos]=a[pos]&a[pos+1];
  } else {
    a[pos]=a[pos]^a[pos+1];
  }
  rep(j,pos+2,n) a[j-1]=a[j]; n--;
}
void play(int cur,int role,int p) {
  if(cur==1) {
    if(role==1) puts("Alice");
    else puts("Bob");
    fflush(stdout);
  }
  if(n==1) return;
  if((cur&1)==role) {
    int x=0; static char opt[3]; rep(i,0,2) opt[i]=0;
    if(p==1) {
      bool flag=0;
      rep(i,1,n-1) if(a[i]==0&&a[i+1]==0) flag=1, x=i;
      if(!flag) {
        if(a[1]==0) x=1;
        else if(a[n]==0) x=n-1;
        else {
          rep(i,1,n) if(a[i]==1) {
            int j=i; while(j<=n&&a[j]==1) j++; j--;
            if((j-i+1)%2==0) {
              if(i!=1) x=i-1;
              else if(j!=n) x=j;
              break;
            }
            i=j;
          }
        }
      }
      if(!x) opt[0]='*', x=1;
      else opt[0]='+';
    } else {
      bool flag=0;
      rep(i,1,n) if(a[i]==1&&a[i+1]==1) flag=1, x=i;
      if(!flag) rep(i,1,n-1) if(a[i]==1) x=i;
      if(!x) x=1;
      opt[0]=(flag?'+':'*');
    }
    printf("%lld %s\n",x,opt); fflush(stdout);
    work(x,opt);
  } else {
    int x; char opt[3]; scanf("%lld%s",&x,opt);
    work(x,opt);
  }
  play(cur+1,role,p);
}

signed main() {
  n=read(), k=read();
  rep(i,1,n) a[i]=read();
  rep(i,1,n) {
    if(a[i]==1) stp++;
    if(a[i]&&a[i+1]) i++;
  }
  if(n%2==0) { //Alice dom
    if(k==0) play(1,1,0);
    else {
      int bs=(n-2)/2;
      if(stp<=bs) play(1,0,0);
      else play(1,1,1);
    }
  } else { //Bob dom
    if(k==1) play(1,0,0);
    else {
      int as=(n-1)/2;
      if(stp<=as) play(1,1,0);
      else play(1,0,1);
    }
  }
  return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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

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

input:

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

output:

Bob
2 +
1 *

result:

ok The player wins!

Test #4:

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

input:

3 0
1 1 1
1 +
1

output:

Bob
1 +

result:

ok The player wins!

Test #5:

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

input:

3 1
1 0 1
1 *
1

output:

Bob
2 +

result:

ok The player wins!

Test #6:

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

input:

3 0
1 0 1
1 *
1

output:

Bob
1 +

result:

ok The player wins!

Test #7:

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

input:

2 1
0 1
1

output:

Alice
1 +

result:

ok The player wins!

Test #8:

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

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
495 +
491 +
485 +
483 +
479 +
475 +
471 +
469 +
463 +
461 +
457 +
453 +
451 +
449 +
445 +
439 +
437 +
435 +
433 +
429 +
427 +
421 +
417 +
415 +
411 +
409 +
405 +
403 +
401 +
397 +
395 +
393 +
389 +
383 +
381 +
379 +
375 +
373 +
371 +
367 +
365 +
359 +
355 +
351 +
349 +
347 +
341 +
337 +
335 +
...

result:

ok The player wins!

Test #9:

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

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

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 +
494 +
492 +
488 +
484 +
480 +
476 +
474 +
470 +
466 +
464 +
460 +
458 +
454 +
452 +
450 +
446 +
444 +
442 +
440 +
436 +
434 +
430 +
428 +
424 +
420 +
416 +
414 +
410 +
408 +
402 +
400 +
394 +
392 +
388 +
384 +
380 +
378 +
374 +
370 +
368 +
366 +
364 +
360 +
356 +
354 +
352 +
344 +
340 +
...

result:

ok The player wins!

Test #11:

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

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
498 +
496 +
490 +
488 +
484 +
482 +
480 +
476 +
474 +
470 +
468 +
466 +
464 +
460 +
458 +
454 +
450 +
448 +
444 +
436 +
434 +
432 +
430 +
426 +
424 +
420 +
418 +
416 +
414 +
412 +
406 +
398 +
396 +
392 +
390 +
388 +
384 +
382 +
380 +
374 +
372 +
370 +
364 +
360 +
358 +
352 +
350 +
348 +
346 +
34...

result:

ok The player wins!

Test #12:

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

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
498 +
496 +
494 +
490 +
488 +
484 +
482 +
478 +
476 +
472 +
470 +
466 +
460 +
458 +
452 +
448 +
446 +
442 +
440 +
438 +
432 +
430 +
426 +
424 +
422 +
420 +
416 +
412 +
408 +
406 +
402 +
400 +
398 +
392 +
388 +
386 +
384 +
380 +
378 +
374 +
368 +
366 +
364 +
362 +
360 +
358 +
352 +
348 +
346 +
34...

result:

ok The player wins!

Test #13:

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

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

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
498 *
498 +
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: 3796kb

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

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

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

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

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
498 +
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: 4056kb

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

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

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
498 +
494 +
492 +
490 +
486 +
482 +
478 +
474 +
472 +
468 +
466 +
462 +
458 +
454 +
452 +
450 +
448 +
444 +
442 +
440 +
438 +
436 +
432 +
428 +
424 +
422 +
416 +
414 +
412 +
408 +
402 +
400 +
396 +
392 +
388 +
386 +
382 +
380 +
376 +
370 +
368 +
366 +
364 +
360 +
356 +
354 +
352 +
344 +
340 +
...

result:

ok The player wins!

Test #23:

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

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

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
493 +
498 +
482 +
452 +
444 +
434 +
428 +
404 +
396 +
394 +
380 +
368 +
360 +
358 +
354 +
342 +
332 +
328 +
298 +
260 +
258 +
252 +
248 +
240 +
214 +
208 +
206 +
192 +
172 +
170 +
168 +
164 +
160 +
154 +
146 +
138 +
130 +
118 +
112 +
90 +
86 +
80 +
78 +
70 +
66 +
64 +
58 +
40 +
16 +
10 +
2 +
3...

result:

ok The player wins!

Test #25:

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

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

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
498 *
498 +
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: 3856kb

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

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 +
496 +
492 +
488 +
482 +
478 +
474 +
470 +
468 +
464 +
462 +
450 +
442 +
440 +
438 +
434 +
428 +
426 +
424 +
412 +
410 +
400 +
390 +
388 +
384 +
380 +
378 +
376 +
374 +
372 +
366 +
354 +
342 +
334 +
330 +
328 +
316 +
312 +
310 +
308 +
302 +
296 +
278 +
274 +
268 +
266 +
264 +
260 +
254 +
...

result:

ok The player wins!

Test #29:

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

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

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 +
346 +
342 +
340 +
338 +
334 +
330 +
326 +
322 +
320 +
318 +
314 +
312 +
308 +
306 +
304 +
302 +
298 +
296 +
294 +
292 +
288 +
284 +
282 +
280 +
278 +
276 +
272 +
270 +
268 +
266 +
262 +
260 +
258 +
256 +
254 +
252 +
246 +
244 +
242 +
238 +
236 +
232 +
230 +
228 +
224 +
222 +
220 +
216 +
...

result:

ok The player wins!

Test #31:

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

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

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 +
496 +
491 +
485 +
470 +
456 +
448 +
445 +
440 +
430 +
424 +
410 +
396 +
391 +
383 +
370 +
365 +
361 +
358 +
355 +
352 +
348 +
342 +
336 +
331 +
322 +
307 +
293 +
285 +
282 +
273 +
268 +
261 +
258 +
255 +
241 +
236 +
232 +
223 +
218 +
204 +
196 +
193 +
187 +
171 +
164 +
160 +
146 +
143 +
...

result:

ok The player wins!

Test #33:

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

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
494 +
491 +
484 +
481 +
472 +
465 +
461 +
458 +
454 +
451 +
447 +
426 +
423 +
411 +
408 +
401 +
397 +
394 +
385 +
380 +
374 +
368 +
365 +
360 +
356 +
352 +
342 +
316 +
312 +
309 +
304 +
301 +
298 +
285 +
275 +
270 +
262 +
259 +
247 +
238 +
235 +
232 +
229 +
221 +
217 +
214 +
203 +
196 +
192 +
17...

result:

ok The player wins!

Test #34:

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

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
494 +
475 +
469 +
466 +
461 +
446 +
437 +
431 +
388 +
346 +
343 +
315 +
302 +
299 +
291 +
275 +
264 +
248 +
239 +
229 +
197 +
194 +
176 +
169 +
166 +
139 +
108 +
97 +
93 +
80 +
69 +
57 +
33 +
28 +
25 +
12 +
417 *
396 *
390 *
387 *
384 *
371 *
367 *
362 *
355 *
351 *
343 *
340 *
337 *
332 *
328...

result:

ok The player wins!

Test #35:

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

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
487 +
476 +
444 +
440 +
434 +
430 +
427 +
423 +
415 +
411 +
396 +
385 +
380 +
345 +
335 +
331 +
302 +
278 +
273 +
267 +
244 +
239 +
232 +
228 +
221 +
214 +
182 +
173 +
163 +
144 +
130 +
127 +
122 +
106 +
67 +
44 +
38 +
34 +
27 +
25 +
23 +
19 +
14 +
7 +
2 +
396 *
393 *
389 *
376 *
369 *
362 *
359...

result:

ok The player wins!

Test #36:

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

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
495 +
492 +
489 +
485 +
482 +
479 +
476 +
473 +
466 +
462 +
458 +
451 +
445 +
441 +
435 +
432 +
429 +
426 +
423 +
419 +
412 +
409 +
403 +
398 +
393 +
386 +
383 +
374 +
371 +
364 +
356 +
353 +
350 +
344 +
341 +
338 +
335 +
332 +
325 +
314 +
309 +
305 +
303 +
301 +
297 +
294 +
291 +
289 +
281 +
...

result:

ok The player wins!

Test #37:

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

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
497 +
493 +
490 +
487 +
482 +
477 +
470 +
466 +
461 +
458 +
454 +
451 +
446 +
443 +
440 +
437 +
427 +
423 +
415 +
410 +
405 +
402 +
397 +
394 +
389 +
384 +
381 +
378 +
375 +
370 +
367 +
361 +
356 +
350 +
346 +
344 +
339 +
337 +
333 +
328 +
323 +
319 +
315 +
313 +
311 +
309 +
307 +
299 +
294 +
29...

result:

ok The player wins!

Test #38:

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

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
498 +
495 +
491 +
488 +
485 +
479 +
476 +
471 +
465 +
461 +
457 +
450 +
444 +
441 +
436 +
433 +
429 +
422 +
418 +
414 +
411 +
402 +
392 +
389 +
384 +
380 +
378 +
376 +
374 +
372 +
370 +
368 +
366 +
362 +
360 +
358 +
356 +
354 +
352 +
350 +
348 +
345 +
343 +
341 +
339 +
337 +
335 +
333 +
331 +
...

result:

ok The player wins!

Test #39:

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

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
499 +
497 +
495 +
493 +
489 +
486 +
483 +
480 +
477 +
473 +
467 +
460 +
457 +
454 +
448 +
445 +
441 +
438 +
435 +
432 +
429 +
426 +
423 +
420 +
417 +
408 +
405 +
402 +
398 +
396 +
393 +
378 +
375 +
372 +
369 +
365 +
363 +
361 +
357 +
354 +
352 +
350 +
348 +
346 +
344 +
340 +
335 +
332 +
328 +
32...

result:

ok The player wins!

Test #40:

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

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 +
496 +
493 +
490 +
487 +
481 +
478 +
475 +
472 +
467 +
464 +
461 +
458 +
455 +
452 +
449 +
446 +
442 +
439 +
436 +
433 +
430 +
423 +
421 +
419 +
417 +
415 +
411 +
409 +
407 +
405 +
401 +
399 +
396 +
394 +
391 +
387 +
381 +
379 +
377 +
375 +
373 +
370 +
368 +
364 +
361 +
359 +
353 +
347 +
...

result:

ok The player wins!

Test #41:

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

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
499 +
497 +
493 +
486 +
483 +
480 +
468 +
465 +
461 +
458 +
453 +
447 +
443 +
440 +
437 +
432 +
429 +
424 +
421 +
419 +
413 +
409 +
407 +
405 +
403 +
401 +
399 +
397 +
395 +
393 +
389 +
387 +
384 +
382 +
380 +
378 +
372 +
370 +
367 +
365 +
362 +
359 +
357 +
353 +
350 +
346 +
344 +
338 +
332 +
33...

result:

ok The player wins!

Test #42:

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

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

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