#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
void Anna(int n, std::vector<char> s) {
int x = find(s.begin(), s.end(), 'X') - s.begin();
int z = n - (find(s.rbegin(), s.rend(), 'Z') - s.rbegin()) - 1;
if (x > z) {
for (int i = 0; i < n; ++i) {
Send(0);
}
} else {
for (int i = 0; i < n; ++i) {
Send(i >= x && i <= z && (i == x || i == z || s[i] == 'Z'));
}
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
void Bruno(int N, int L, std::vector<int> A) {
if (A == vector(N, 0)) {
for (int i = 0; i < N; ++i) {
Remove(i);
}
return;
}
int fi = find(A.begin(), A.end(), 1) - A.begin();
for (int i = 0; i < fi; ++i) {
Remove(i);
}
vector<int> stk{fi};
for (int i = fi + 1; i < N; ++i) {
if (A[i]) {
while (stk.size() > 1) {
Remove(stk.back());
stk.pop_back();
}
Remove(i);
} else {
stk.push_back(i);
}
}
for (int x : stk) {
Remove(x);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
516 KB |
Output is correct |
2 |
Correct |
0 ms |
508 KB |
Output is correct |
3 |
Correct |
1 ms |
516 KB |
Output is correct |
4 |
Correct |
0 ms |
504 KB |
Output is correct |
5 |
Correct |
1 ms |
516 KB |
Output is correct |
6 |
Correct |
1 ms |
516 KB |
Output is correct |
7 |
Correct |
1 ms |
516 KB |
Output is correct |
8 |
Correct |
0 ms |
508 KB |
Output is correct |
9 |
Correct |
0 ms |
504 KB |
Output is correct |
10 |
Correct |
1 ms |
516 KB |
Output is correct |
11 |
Correct |
0 ms |
508 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
52 ms |
7640 KB |
Partially correct |
2 |
Partially correct |
52 ms |
7668 KB |
Partially correct |
3 |
Partially correct |
64 ms |
7644 KB |
Partially correct |
4 |
Partially correct |
54 ms |
7680 KB |
Partially correct |
5 |
Partially correct |
54 ms |
7668 KB |
Partially correct |
6 |
Partially correct |
54 ms |
7600 KB |
Partially correct |
7 |
Partially correct |
54 ms |
7684 KB |
Partially correct |
8 |
Partially correct |
52 ms |
7556 KB |
Partially correct |
9 |
Partially correct |
51 ms |
7660 KB |
Partially correct |
10 |
Partially correct |
62 ms |
7648 KB |
Partially correct |
11 |
Partially correct |
63 ms |
7796 KB |
Partially correct |
12 |
Partially correct |
53 ms |
7676 KB |
Partially correct |
13 |
Partially correct |
66 ms |
7804 KB |
Partially correct |
14 |
Partially correct |
60 ms |
7664 KB |
Partially correct |
15 |
Partially correct |
54 ms |
7600 KB |
Partially correct |
16 |
Partially correct |
59 ms |
7696 KB |
Partially correct |
17 |
Partially correct |
61 ms |
7664 KB |
Partially correct |
18 |
Partially correct |
57 ms |
7688 KB |
Partially correct |
19 |
Partially correct |
60 ms |
7644 KB |
Partially correct |
20 |
Partially correct |
52 ms |
7752 KB |
Partially correct |
21 |
Partially correct |
49 ms |
7640 KB |
Partially correct |
22 |
Partially correct |
59 ms |
7804 KB |
Partially correct |
23 |
Partially correct |
57 ms |
7656 KB |
Partially correct |
24 |
Partially correct |
52 ms |
7808 KB |
Partially correct |
25 |
Partially correct |
66 ms |
7900 KB |
Partially correct |
26 |
Partially correct |
56 ms |
7672 KB |
Partially correct |
27 |
Partially correct |
65 ms |
7684 KB |
Partially correct |
28 |
Partially correct |
61 ms |
7860 KB |
Partially correct |
29 |
Partially correct |
66 ms |
7716 KB |
Partially correct |
30 |
Partially correct |
60 ms |
7692 KB |
Partially correct |
31 |
Partially correct |
71 ms |
7740 KB |
Partially correct |
32 |
Partially correct |
54 ms |
7616 KB |
Partially correct |
33 |
Partially correct |
52 ms |
7680 KB |
Partially correct |