#include "Anna.h"
#include <vector>
void Anna(int N, std::vector<char> S) {
for(int i = 0; i < N; ++i) {
if(S[i] == 'X') {
Send(0);
}
else if(S[i] == 'Y') {
Send(0);
}
else {
Send(1);
}
}
for(int i = 0; i < N; ++i) {
if(S[i] == 'X') {
Send(0);
}
else if(S[i] == 'Y') {
Send(1);
}
else {
Send(0);
}
}
}
#include "Bruno.h"
#include <vector>
void Bruno(int N, int L, std::vector<int> A) {
std::vector<int> S(N);
for(int i = 0; i < N; ++i) {
S[i] = (A[i] << 1) | A[N + i];
}
int first_X = 0;
while(first_X < N && S[first_X] > 0) {
++first_X;
}
std::vector<int> stk;
for(int i = 0; i < first_X; ++i) {
Remove(i);
}
for(int i = first_X; i < N; ++i) {
if(S[i] == 1) {
while(!stk.empty() && S[stk.back()] > 0) {
Remove(stk.back());
stk.pop_back();
}
}
else if(S[i] == 2) {
while(!stk.empty() && first_X < stk.back()) {
Remove(stk.back());
stk.pop_back();
}
}
stk.push_back(i);
}
for(int i : stk) {
Remove(i);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
516 KB |
Output is correct |
2 |
Correct |
1 ms |
520 KB |
Output is correct |
3 |
Correct |
0 ms |
512 KB |
Output is correct |
4 |
Correct |
1 ms |
520 KB |
Output is correct |
5 |
Correct |
0 ms |
592 KB |
Output is correct |
6 |
Correct |
0 ms |
572 KB |
Output is correct |
7 |
Correct |
0 ms |
508 KB |
Output is correct |
8 |
Correct |
1 ms |
520 KB |
Output is correct |
9 |
Correct |
1 ms |
584 KB |
Output is correct |
10 |
Correct |
2 ms |
604 KB |
Output is correct |
11 |
Correct |
1 ms |
512 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
70 ms |
9380 KB |
Partially correct |
2 |
Partially correct |
72 ms |
9832 KB |
Partially correct |
3 |
Partially correct |
69 ms |
9836 KB |
Partially correct |
4 |
Partially correct |
69 ms |
9776 KB |
Partially correct |
5 |
Partially correct |
82 ms |
9804 KB |
Partially correct |
6 |
Partially correct |
88 ms |
9740 KB |
Partially correct |
7 |
Partially correct |
76 ms |
9672 KB |
Partially correct |
8 |
Partially correct |
71 ms |
9832 KB |
Partially correct |
9 |
Partially correct |
73 ms |
9828 KB |
Partially correct |
10 |
Partially correct |
70 ms |
9864 KB |
Partially correct |
11 |
Partially correct |
72 ms |
9700 KB |
Partially correct |
12 |
Partially correct |
70 ms |
9904 KB |
Partially correct |
13 |
Partially correct |
81 ms |
10236 KB |
Partially correct |
14 |
Partially correct |
80 ms |
9796 KB |
Partially correct |
15 |
Partially correct |
74 ms |
9820 KB |
Partially correct |
16 |
Partially correct |
73 ms |
9732 KB |
Partially correct |
17 |
Partially correct |
72 ms |
10208 KB |
Partially correct |
18 |
Partially correct |
79 ms |
9772 KB |
Partially correct |
19 |
Partially correct |
92 ms |
9724 KB |
Partially correct |
20 |
Partially correct |
76 ms |
9828 KB |
Partially correct |
21 |
Partially correct |
70 ms |
9828 KB |
Partially correct |
22 |
Partially correct |
76 ms |
9812 KB |
Partially correct |
23 |
Partially correct |
67 ms |
9836 KB |
Partially correct |
24 |
Partially correct |
67 ms |
9812 KB |
Partially correct |
25 |
Partially correct |
90 ms |
9872 KB |
Partially correct |
26 |
Partially correct |
75 ms |
9884 KB |
Partially correct |
27 |
Partially correct |
79 ms |
9668 KB |
Partially correct |
28 |
Partially correct |
74 ms |
9700 KB |
Partially correct |
29 |
Partially correct |
81 ms |
9904 KB |
Partially correct |
30 |
Partially correct |
82 ms |
9768 KB |
Partially correct |
31 |
Partially correct |
76 ms |
9836 KB |
Partially correct |
32 |
Partially correct |
69 ms |
9864 KB |
Partially correct |
33 |
Partially correct |
75 ms |
9840 KB |
Partially correct |