#include "Anna.h"
#include <algorithm>
#include <vector>
using namespace std;
void Anna(int N, vector<char> S) {
int id = 1;
for (int i = 0; i < N; ++i) {
if (id && S[i] == 'X') id = 0;
if (!id && S[i] == 'Z') id = 1;
Send(id);
}
}
#include "Bruno.h"
#include <algorithm>
#include <vector>
using namespace std;
void Bruno(int N, int L, vector<int> A) {
int ptr = 0, l, m;
while (ptr != L && A[ptr] == 1) Remove(ptr), ++ptr;
while (ptr != L) {
l = ptr;
while (ptr != L && A[ptr] == 0) ++ptr;
m = ptr;
while (ptr != L && A[ptr] == 1) ++ptr;
for (int i = m - 1; i > l; --i) Remove(i);
for (int i = m; i < ptr; ++i) Remove(i);
Remove(l);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
492 KB |
Output is correct |
2 |
Correct |
1 ms |
488 KB |
Output is correct |
3 |
Incorrect |
0 ms |
488 KB |
Wrong Answer [6] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
63 ms |
7636 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |