#include "Anna.h"
#include <bits/stdc++.h>
namespace
{
}
void Anna(int N, std::vector<char> S) {
for(int i=0;i<N;i++)
if(S[i]=='X')Send(1);
else Send(0);
/*int x=-1;
int z=-1;
for(int i=0;i<N;i++)
{
if(S[i]=='X'&&x==-1)
{
x=i;
for(int j=0;j<=16;j++)
if((1<<j)&x)Send(1);
else Send(0);
}
}
for(int i=N-1;i>=0;i--)
{
if(S[i]=='Z'&&z==-1)
{
z=i;
for(int j=0;j<=16;j++)
if((1<<j)&z)Send(1);
else Send(0);
}
}*/
for(int i=0;i<N;i++)
if(S[i]=='Y')Send(1);
else Send(0);
}
#include "Bruno.h"
#include <bits/stdc++.h>
namespace
{
int c[100001];
int h[100001];
}
void Bruno(int N, int L, std::vector<int> A)
{
/*if(A.size()!=N+34)
{
for(int i=0;i<N;i++)
Remove(i);
return;
}
int x=0;
for(int i=0;i<=16;i++)
if(A[i]==1)x+=(1<<i);
for(int i=17;i<=34;i++)
if(A[i]==1)z+=(1<<j)*/
for(int i=0;i<N;i++)
c[i]='Z';
for(int i=0;i<N;i++)
if(A[i]==1)c[i]='X';
for(int i=N;i<2*N;i++)
if(A[i]==1)c[i]='Z';
int f=0,l=2;
for(int i=0;i<N;i++)
{
if(f==0)
{
if(c[i]=='X')
{
f=1;
h[i]=1;
}
}
else
{
if(l==2&&c[i]=='Y')l=1,h[i]=1;
else if(l==1&&c[i]=='Z')l=2,h[i]=1;
}
}
for(int i=0;i<N;i++)
if(!h[i])Remove(i);
for(int i=0;i<N;i++)
if(h[i])Remove(i);
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |