#include "Anna.h"
#include <vector>
using namespace std;
void Anna(int n, vector<char> s) {
int k = 0;
bool skip = false;
for (int i = 0; i < n; i++) {
if (skip) skip = false;
else if (s[i] == 'X') Send(1), skip = true;
else Send(0);
if (s[i] == 'Z') k = i;
}
for (int t = 0; t <= 16; t++) Send(k & 1 << t ? 1 : 0);
}
#include "Bruno.h"
#include <vector>
using namespace std;
void Bruno(int n, int l, vector<int> b) {
int lt = n, rt = 0;
vector<int> a;
for (int i = 0; i < (int)b.size() - 17; i++) {
if (b[i]) a.push_back(1), a.push_back(0);
else a.push_back(0);
}
while ((int)a.size() > n) a.pop_back();
for (int i = (int)b.size() - 17; i < (int)b.size(); i++) a.push_back(b[i]);
for (int t = 0; t <= 16; t++) if (a[n + t]) rt |= 1 << t;
for (int i = n - 1; i >= 0; i--) if (a[i] || !i) {
for (int j = i + 1; j < lt; j++) if (a[j]) Remove(j);
for (int j = i + 1; j < lt; j++) if (!a[j] && j != rt) Remove(j);
if (i != rt) Remove(i);
lt = i;
}
Remove(rt);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
516 KB |
Output is correct |
2 |
Correct |
0 ms |
516 KB |
Output is correct |
3 |
Correct |
0 ms |
516 KB |
Output is correct |
4 |
Correct |
0 ms |
516 KB |
Output is correct |
5 |
Correct |
0 ms |
508 KB |
Output is correct |
6 |
Correct |
1 ms |
648 KB |
Output is correct |
7 |
Correct |
0 ms |
516 KB |
Output is correct |
8 |
Correct |
0 ms |
516 KB |
Output is correct |
9 |
Correct |
1 ms |
516 KB |
Output is correct |
10 |
Correct |
0 ms |
508 KB |
Output is correct |
11 |
Correct |
0 ms |
516 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
47 ms |
7676 KB |
Partially correct |
2 |
Partially correct |
48 ms |
7528 KB |
Partially correct |
3 |
Partially correct |
47 ms |
7596 KB |
Partially correct |
4 |
Partially correct |
46 ms |
7628 KB |
Partially correct |
5 |
Partially correct |
47 ms |
7492 KB |
Partially correct |
6 |
Partially correct |
47 ms |
7616 KB |
Partially correct |
7 |
Partially correct |
46 ms |
7572 KB |
Partially correct |
8 |
Partially correct |
48 ms |
7480 KB |
Partially correct |
9 |
Partially correct |
46 ms |
7592 KB |
Partially correct |
10 |
Partially correct |
47 ms |
7628 KB |
Partially correct |
11 |
Partially correct |
48 ms |
7628 KB |
Partially correct |
12 |
Partially correct |
48 ms |
7628 KB |
Partially correct |
13 |
Correct |
49 ms |
7092 KB |
Output is correct |
14 |
Partially correct |
54 ms |
7828 KB |
Partially correct |
15 |
Correct |
50 ms |
7460 KB |
Output is correct |
16 |
Correct |
51 ms |
7476 KB |
Output is correct |
17 |
Correct |
50 ms |
7104 KB |
Output is correct |
18 |
Partially correct |
56 ms |
7780 KB |
Partially correct |
19 |
Partially correct |
54 ms |
7804 KB |
Partially correct |
20 |
Partially correct |
46 ms |
7692 KB |
Partially correct |
21 |
Partially correct |
46 ms |
7448 KB |
Partially correct |
22 |
Partially correct |
55 ms |
7876 KB |
Partially correct |
23 |
Partially correct |
47 ms |
7576 KB |
Partially correct |
24 |
Partially correct |
47 ms |
7600 KB |
Partially correct |
25 |
Partially correct |
54 ms |
7788 KB |
Partially correct |
26 |
Partially correct |
54 ms |
7948 KB |
Partially correct |
27 |
Partially correct |
59 ms |
7984 KB |
Partially correct |
28 |
Partially correct |
59 ms |
7860 KB |
Partially correct |
29 |
Partially correct |
57 ms |
7832 KB |
Partially correct |
30 |
Partially correct |
55 ms |
7764 KB |
Partially correct |
31 |
Partially correct |
54 ms |
7904 KB |
Partially correct |
32 |
Partially correct |
47 ms |
7584 KB |
Partially correct |
33 |
Partially correct |
47 ms |
7712 KB |
Partially correct |