#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
namespace anna {
static const int B = 20;
static const int BAD = (1 << B) - 1;
}
void Anna(int n, vector<char> s) {
using namespace anna;
for (int i = 0; i < n; ++i) {
Send(s[i] == 'Y');
}
int x = BAD, z = BAD;
for (int i = 0; i < n; ++i) {
if (s[i] == 'Z') {
z = i;
}
}
for (int i = 0; i < n; ++i) {
if (s[i] == 'X') {
x = i;
}
}
if (x > z || x == BAD || z == BAD) {
x = BAD, z = BAD;
}
for (int i = 0; i < B; ++i) {
Send((x >> i) & 1);
}
for (int i = 0; i < B; ++i) {
Send((z >> i) & 1);
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
namespace bruno {
static const int B = 20;
static const int BAD = (1 << B) - 1;
}
void Bruno(int n, int l, vector<int> a) {
using namespace bruno;
int x = 0, z = 0;
for (int i = 0; i < B; ++i) {
x |= a[n + i] << i;
z |= a[n + B + i] << i;
}
#ifdef LC
cout << "receive " << l << ": " << x << " " << z << endl;
for (int i = 0; i < n; ++i) {
cout << a[i];
}
cout << endl;
#endif
if (x == BAD || z == BAD) {
for (int i = 0; i < n; ++i) {
Remove(i);
}
return;
}
for (int i = 0; i < n; ++i) {
if (a[i] || i == x || i == z) {
continue;
}
Remove(i);
}
for (int i = 0; i < n; ++i) {
if (a[i]) {
Remove(i);
}
}
Remove(x);
Remove(z);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
484 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
77 ms |
7688 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |