#include "Anna.h"
#include <bits/stdc++.h>
void Anna(int n, std::vector <char> a) {
int found = -1;
for (int i = 0; i < n; i += 1) {
int bit = 0;
if (found == -1 and a[i] == 'X') {
bit = 1;
found = i;
}
if (found != -1 and a[i] == 'Z' and (i + 1 == n or a[i + 1] != 'Z') and (i != found + 1)) {
bit = 1;
}
Send(bit);
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
void Bruno(int n, int l, std::vector <int> a) {
std::vector <int> posOne;
for (int i = 0; i < n; i += 1) if (a[i])
posOne.push_back(i);
if (posOne.size() < 2) {
for (int i = 0; i < n; i += 1)
Remove(i);
return;
}
int x = posOne[0];
for (int i = 0; i < x; i += 1) {
Remove(i);
}
for (int i = 0; i + 1 < (int) posOne.size(); i += 1) {
for (int j = posOne[i + 1] - 1; j > posOne[i]; j -= 1)
Remove(j);
Remove(posOne[i + 1]);
}
for (int j = posOne.back() + 1; j < n; j += 1) {
Remove(j);
}
Remove(x);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
780 KB |
Output is correct |
2 |
Correct |
0 ms |
792 KB |
Output is correct |
3 |
Correct |
0 ms |
1040 KB |
Output is correct |
4 |
Correct |
0 ms |
792 KB |
Output is correct |
5 |
Correct |
0 ms |
796 KB |
Output is correct |
6 |
Correct |
0 ms |
780 KB |
Output is correct |
7 |
Correct |
1 ms |
792 KB |
Output is correct |
8 |
Correct |
0 ms |
780 KB |
Output is correct |
9 |
Correct |
0 ms |
792 KB |
Output is correct |
10 |
Correct |
0 ms |
792 KB |
Output is correct |
11 |
Correct |
0 ms |
1032 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
40 ms |
7868 KB |
Partially correct |
2 |
Partially correct |
40 ms |
7936 KB |
Partially correct |
3 |
Incorrect |
39 ms |
7792 KB |
Wrong Answer [6] |
4 |
Halted |
0 ms |
0 KB |
- |