#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
void Anna(int N, std::vector<char> S)
{
map<char,char> nxt;
nxt['X'] = 'Y';
nxt['Y'] = 'Z';
nxt['Z'] = 'Z';
char cur = 'X';
for(int i = 0; i < N; i ++)
{
if(S[i] == cur)
{
Send(1);
cur = nxt[cur];
}
else
Send(0);
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
void Bruno(int N, int L, std::vector<int> A)
{
vector<int> zs;
int cnt = 0;
for(int i = 0; i < L; i++)
{
if(cnt < 2 && A[i] == 0)
{
Remove(i);
}
else if(A[i] == 1)
{
cnt++;
if(cnt >= 3)
zs.pb(i);
}
}
for(auto z: zs)
{
for(int i = z - 1; i >= 0 && (A[i] == 0); i--)
{
Remove(i);
}
Remove(z);
}
int sz = (int)(zs.size());
for(int i = N - 1; i > zs[sz - 1]; i--)
Remove(i);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
516 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
34 ms |
7936 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |