#include "Anna.h"
#include <bits/stdc++.h>
#define pii pair<int, int>
#define ff first
#define ss second
using namespace std;
namespace
{
}
void Anna(int N, vector<char> S)
{
for(int i = 0; i < N; ++i)
{
if(S[i] == 'X') Send(0), Send(0);
else if(S[i] == 'Y') Send(0), Send(1);
else Send(1), Send(0);
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
namespace
{
}
void Bruno(int N, int L, vector<int> A)
{
int B[N];
int last = -1;
for(int i = 0; i < N; ++i)
{
B[i] = A[i * 2] * 2 + A[i * 2 + 1];
if(B[i] == 2) last = i;
}
if(last == -1)
{
for(int i = 0; i < N; ++i) Remove(i);
return;
}
vector<int> V;
for(int i = 0; i < last; ++i)
{
if((~V.size() & 1) && B[i] == 0)
{
V.push_back(i);
}
else if((V.size() & 1) && B[i] == 1)
{
V.push_back(i);
}
else if(V.size() && (~V.size() & 1) && B[i] == 2)
{
Remove(V.back());
V.pop_back();
Remove(i);
}
else Remove(i);
}
reverse(V.begin(), V.end());
for(auto i : V) Remove(i);
Remove(last);
for(int i = last + 1; i < N; ++i) Remove(i);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
488 KB |
Output is correct |
2 |
Correct |
2 ms |
488 KB |
Output is correct |
3 |
Correct |
2 ms |
496 KB |
Output is correct |
4 |
Correct |
2 ms |
488 KB |
Output is correct |
5 |
Correct |
1 ms |
488 KB |
Output is correct |
6 |
Correct |
2 ms |
488 KB |
Output is correct |
7 |
Correct |
1 ms |
496 KB |
Output is correct |
8 |
Correct |
2 ms |
488 KB |
Output is correct |
9 |
Correct |
2 ms |
488 KB |
Output is correct |
10 |
Correct |
2 ms |
488 KB |
Output is correct |
11 |
Correct |
2 ms |
500 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
95 ms |
9944 KB |
Partially correct |
2 |
Partially correct |
86 ms |
9952 KB |
Partially correct |
3 |
Partially correct |
85 ms |
9952 KB |
Partially correct |
4 |
Partially correct |
104 ms |
9916 KB |
Partially correct |
5 |
Partially correct |
88 ms |
9896 KB |
Partially correct |
6 |
Partially correct |
88 ms |
9940 KB |
Partially correct |
7 |
Partially correct |
101 ms |
9908 KB |
Partially correct |
8 |
Partially correct |
91 ms |
9940 KB |
Partially correct |
9 |
Partially correct |
89 ms |
9876 KB |
Partially correct |
10 |
Partially correct |
87 ms |
9948 KB |
Partially correct |
11 |
Partially correct |
85 ms |
10076 KB |
Partially correct |
12 |
Partially correct |
88 ms |
9940 KB |
Partially correct |
13 |
Partially correct |
119 ms |
10084 KB |
Partially correct |
14 |
Partially correct |
108 ms |
9888 KB |
Partially correct |
15 |
Partially correct |
93 ms |
9776 KB |
Partially correct |
16 |
Partially correct |
98 ms |
10056 KB |
Partially correct |
17 |
Partially correct |
93 ms |
9908 KB |
Partially correct |
18 |
Partially correct |
97 ms |
9800 KB |
Partially correct |
19 |
Partially correct |
97 ms |
9824 KB |
Partially correct |
20 |
Partially correct |
99 ms |
10040 KB |
Partially correct |
21 |
Partially correct |
99 ms |
10100 KB |
Partially correct |
22 |
Partially correct |
97 ms |
9920 KB |
Partially correct |
23 |
Partially correct |
90 ms |
10088 KB |
Partially correct |
24 |
Partially correct |
92 ms |
9836 KB |
Partially correct |
25 |
Partially correct |
102 ms |
9768 KB |
Partially correct |
26 |
Partially correct |
97 ms |
9844 KB |
Partially correct |
27 |
Partially correct |
96 ms |
9876 KB |
Partially correct |
28 |
Partially correct |
109 ms |
9868 KB |
Partially correct |
29 |
Partially correct |
109 ms |
9728 KB |
Partially correct |
30 |
Partially correct |
101 ms |
9720 KB |
Partially correct |
31 |
Partially correct |
98 ms |
9744 KB |
Partially correct |
32 |
Partially correct |
85 ms |
9952 KB |
Partially correct |
33 |
Partially correct |
85 ms |
9968 KB |
Partially correct |