#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
void Anna(int n, std::vector<char> s) {
for (int i = 0; i < n; ++i) {
Send(s[i] == 'Y');
}
for (int i = 0; i < n; ++i) {
Send(s[i] == 'Z');
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
void Bruno(int N, int L, std::vector<int> A) {
vector<char> s(N, 'X');
for (int i = 0; i < N; ++i) {
if (A[i]) {
s[i] = 'Y';
}
}
for (int i = N; i < 2 * N; ++i) {
if (A[i]) {
s[i - N] = 'Z';
}
}
vector<int> stk;
int xy = 0;
for (int i = 0; i < N; ++i) {
if (s[i] == 'Y') {
if (!stk.empty() && s[stk.back()] == 'X') {
stk.push_back(i);
xy += 1;
} else {
Remove(i);
}
} else if (s[i] == 'X') {
if (stk.empty() || s[stk.back()] != 'X') {
stk.push_back(i);
} else {
Remove(i);
}
} else {
while (stk.size() > 1) {
Remove(stk.back());
stk.pop_back();
}
Remove(i);
xy = 0;
}
}
for (int x : stk) {
Remove(x);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
520 KB |
Output is correct |
2 |
Correct |
1 ms |
520 KB |
Output is correct |
3 |
Correct |
2 ms |
524 KB |
Output is correct |
4 |
Correct |
2 ms |
520 KB |
Output is correct |
5 |
Correct |
1 ms |
512 KB |
Output is correct |
6 |
Correct |
1 ms |
556 KB |
Output is correct |
7 |
Correct |
0 ms |
520 KB |
Output is correct |
8 |
Correct |
1 ms |
596 KB |
Output is correct |
9 |
Correct |
1 ms |
520 KB |
Output is correct |
10 |
Correct |
1 ms |
600 KB |
Output is correct |
11 |
Correct |
1 ms |
520 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
74 ms |
9172 KB |
Partially correct |
2 |
Partially correct |
67 ms |
9580 KB |
Partially correct |
3 |
Partially correct |
68 ms |
9520 KB |
Partially correct |
4 |
Partially correct |
65 ms |
9556 KB |
Partially correct |
5 |
Partially correct |
75 ms |
9556 KB |
Partially correct |
6 |
Partially correct |
82 ms |
9568 KB |
Partially correct |
7 |
Partially correct |
68 ms |
9560 KB |
Partially correct |
8 |
Partially correct |
70 ms |
9504 KB |
Partially correct |
9 |
Partially correct |
72 ms |
9472 KB |
Partially correct |
10 |
Partially correct |
74 ms |
9528 KB |
Partially correct |
11 |
Partially correct |
73 ms |
9468 KB |
Partially correct |
12 |
Partially correct |
81 ms |
9616 KB |
Partially correct |
13 |
Partially correct |
78 ms |
10000 KB |
Partially correct |
14 |
Partially correct |
91 ms |
9576 KB |
Partially correct |
15 |
Partially correct |
112 ms |
9480 KB |
Partially correct |
16 |
Partially correct |
74 ms |
9480 KB |
Partially correct |
17 |
Partially correct |
97 ms |
9548 KB |
Partially correct |
18 |
Partially correct |
89 ms |
9524 KB |
Partially correct |
19 |
Partially correct |
74 ms |
9584 KB |
Partially correct |
20 |
Partially correct |
81 ms |
9504 KB |
Partially correct |
21 |
Partially correct |
77 ms |
9512 KB |
Partially correct |
22 |
Partially correct |
81 ms |
9508 KB |
Partially correct |
23 |
Partially correct |
70 ms |
9532 KB |
Partially correct |
24 |
Partially correct |
82 ms |
9416 KB |
Partially correct |
25 |
Partially correct |
79 ms |
9720 KB |
Partially correct |
26 |
Partially correct |
88 ms |
9552 KB |
Partially correct |
27 |
Partially correct |
96 ms |
9496 KB |
Partially correct |
28 |
Partially correct |
78 ms |
9548 KB |
Partially correct |
29 |
Partially correct |
73 ms |
9544 KB |
Partially correct |
30 |
Partially correct |
93 ms |
9548 KB |
Partially correct |
31 |
Partially correct |
91 ms |
9556 KB |
Partially correct |
32 |
Partially correct |
82 ms |
9496 KB |
Partially correct |
33 |
Partially correct |
81 ms |
9580 KB |
Partially correct |