#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 += 5) {
int x = 0;
for (int j = i; j < min(n, i + 5); ++j) {
x = x * 3 + (s[j] == 'X' ? 0 : s[j] == 'Y' ? 1 : 2);
}
for (int _ = 0; (i + 5 >= n ? x : _ < 8); ++_) {
Send(x % 2);
x /= 2;
}
}
}
#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');
int si = 0;
for (int i = 0; i < L; i += 8, si += 5) {
int x = 0;
for (int j = i; j < min(L, i + 8); ++j) {
x += (A[j]) << (j - i);
}
for (int sj = min(N, si + 5) - 1; sj >= si; --sj) {
s[sj] = x % 3 == 0 ? 'X' : x % 3 == 1 ? 'Y' : 'Z';
x /= 3;
}
}
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 |
508 KB |
Output is correct |
2 |
Correct |
0 ms |
508 KB |
Output is correct |
3 |
Correct |
0 ms |
512 KB |
Output is correct |
4 |
Correct |
0 ms |
508 KB |
Output is correct |
5 |
Correct |
0 ms |
516 KB |
Output is correct |
6 |
Correct |
0 ms |
508 KB |
Output is correct |
7 |
Correct |
1 ms |
508 KB |
Output is correct |
8 |
Correct |
1 ms |
516 KB |
Output is correct |
9 |
Correct |
0 ms |
508 KB |
Output is correct |
10 |
Correct |
0 ms |
516 KB |
Output is correct |
11 |
Correct |
1 ms |
516 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
66 ms |
8680 KB |
Partially correct |
2 |
Partially correct |
62 ms |
8696 KB |
Partially correct |
3 |
Partially correct |
65 ms |
8716 KB |
Partially correct |
4 |
Partially correct |
61 ms |
8640 KB |
Partially correct |
5 |
Partially correct |
73 ms |
8664 KB |
Partially correct |
6 |
Partially correct |
79 ms |
8580 KB |
Partially correct |
7 |
Partially correct |
60 ms |
8656 KB |
Partially correct |
8 |
Partially correct |
60 ms |
8668 KB |
Partially correct |
9 |
Partially correct |
64 ms |
8664 KB |
Partially correct |
10 |
Partially correct |
63 ms |
8692 KB |
Partially correct |
11 |
Partially correct |
61 ms |
8628 KB |
Partially correct |
12 |
Partially correct |
71 ms |
8672 KB |
Partially correct |
13 |
Partially correct |
84 ms |
9048 KB |
Partially correct |
14 |
Partially correct |
71 ms |
8672 KB |
Partially correct |
15 |
Partially correct |
76 ms |
8664 KB |
Partially correct |
16 |
Partially correct |
81 ms |
8652 KB |
Partially correct |
17 |
Partially correct |
81 ms |
8684 KB |
Partially correct |
18 |
Partially correct |
69 ms |
8716 KB |
Partially correct |
19 |
Partially correct |
70 ms |
8680 KB |
Partially correct |
20 |
Partially correct |
73 ms |
8668 KB |
Partially correct |
21 |
Partially correct |
65 ms |
8688 KB |
Partially correct |
22 |
Partially correct |
69 ms |
8580 KB |
Partially correct |
23 |
Partially correct |
60 ms |
8668 KB |
Partially correct |
24 |
Partially correct |
68 ms |
8708 KB |
Partially correct |
25 |
Partially correct |
68 ms |
8668 KB |
Partially correct |
26 |
Partially correct |
70 ms |
8668 KB |
Partially correct |
27 |
Partially correct |
72 ms |
8660 KB |
Partially correct |
28 |
Partially correct |
81 ms |
8724 KB |
Partially correct |
29 |
Partially correct |
70 ms |
8700 KB |
Partially correct |
30 |
Partially correct |
70 ms |
8680 KB |
Partially correct |
31 |
Partially correct |
81 ms |
8664 KB |
Partially correct |
32 |
Partially correct |
69 ms |
8580 KB |
Partially correct |
33 |
Partially correct |
61 ms |
8700 KB |
Partially correct |