#include <bits/stdc++.h>
using namespace std;
#include "Annalib.h"
void Anna (int N, long long X, int K, int P[]) {
bool fuc[N+5], init;
int pre[N+5], b;
string rep[4] = {"01", "10", "001", "011"};
memset(fuc, 1, sizeof fuc);
for (int i = 0; i < K; i++) fuc[P[i]] = 0;
for (int s = 0; s < 4; s++) {
init = 0;
b = 0;
for (int i = 0; i < N; i++) {
if (!fuc[i]) pre[i] = 0;
else if (!init && i % 4 == s) pre[i] = 1, init = 1;
else if (!init) pre[i] = 0;
else if (b == 60) pre[i] = 0;
else if (((1ll << b) & X) == 0 && rep[s][i % (int)rep[s].length()] == '1') pre[i] = 0;
else if (((1ll << b) & X) > 0 && rep[s][i % (int)rep[s].length()] == '0') pre[i] = 0;
else pre[i] = 1, b++;
}
if (b == 60) {
for (int i = 0; i < N; i++) Set(i, pre[i]);
return;
}
}
}
#include <bits/stdc++.h>
using namespace std;
#include "Brunolib.h"
long long Bruno (int N, int A[]) {
string rep[4] = {"01", "10", "001", "011"};
long long V = 0;
int s = -1;
int b = 0;
for (int i = 0; i < N; i++) {
if (A[i] == 1) {
if (s == -1) s = i % 4;
else if (rep[s][i % (int)rep[s].length()] == '1') V += (1ll << b), b++;
else b++;
}
}
return V;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
992 KB |
Wrong Answer [4] |
2 |
Incorrect |
9 ms |
996 KB |
Wrong Answer [4] |
3 |
Incorrect |
10 ms |
972 KB |
Wrong Answer [4] |
4 |
Incorrect |
9 ms |
932 KB |
Wrong Answer [4] |
5 |
Incorrect |
8 ms |
772 KB |
Wrong Answer [4] |
6 |
Incorrect |
8 ms |
516 KB |
Wrong Answer [4] |
7 |
Incorrect |
9 ms |
1008 KB |
Wrong Answer [4] |
8 |
Incorrect |
9 ms |
840 KB |
Wrong Answer [4] |
9 |
Incorrect |
9 ms |
984 KB |
Wrong Answer [4] |
10 |
Incorrect |
10 ms |
956 KB |
Wrong Answer [4] |
11 |
Incorrect |
9 ms |
1008 KB |
Wrong Answer [4] |
12 |
Incorrect |
10 ms |
952 KB |
Wrong Answer [4] |
13 |
Incorrect |
9 ms |
848 KB |
Wrong Answer [4] |
14 |
Incorrect |
9 ms |
900 KB |
Wrong Answer [4] |
15 |
Incorrect |
9 ms |
980 KB |
Wrong Answer [4] |
16 |
Incorrect |
10 ms |
1148 KB |
Wrong Answer [4] |
17 |
Incorrect |
10 ms |
900 KB |
Wrong Answer [4] |
18 |
Incorrect |
10 ms |
916 KB |
Wrong Answer [4] |
19 |
Incorrect |
9 ms |
956 KB |
Wrong Answer [4] |
20 |
Incorrect |
9 ms |
900 KB |
Wrong Answer [4] |
21 |
Incorrect |
9 ms |
900 KB |
Wrong Answer [4] |
22 |
Incorrect |
9 ms |
1016 KB |
Wrong Answer [4] |
23 |
Incorrect |
8 ms |
1020 KB |
Wrong Answer [4] |
24 |
Incorrect |
9 ms |
964 KB |
Wrong Answer [4] |
25 |
Incorrect |
10 ms |
980 KB |
Wrong Answer [4] |
26 |
Incorrect |
9 ms |
960 KB |
Wrong Answer [4] |
27 |
Incorrect |
9 ms |
996 KB |
Wrong Answer [4] |
28 |
Incorrect |
9 ms |
984 KB |
Wrong Answer [4] |
29 |
Incorrect |
8 ms |
1032 KB |
Wrong Answer [4] |
30 |
Incorrect |
9 ms |
1000 KB |
Wrong Answer [4] |
31 |
Incorrect |
8 ms |
900 KB |
Wrong Answer [4] |
32 |
Incorrect |
10 ms |
924 KB |
Wrong Answer [4] |
33 |
Incorrect |
9 ms |
780 KB |
Wrong Answer [4] |
34 |
Incorrect |
9 ms |
944 KB |
Wrong Answer [4] |
35 |
Incorrect |
9 ms |
984 KB |
Wrong Answer [4] |
36 |
Incorrect |
10 ms |
900 KB |
Wrong Answer [4] |
37 |
Incorrect |
9 ms |
1012 KB |
Wrong Answer [4] |
38 |
Incorrect |
9 ms |
1020 KB |
Wrong Answer [4] |
39 |
Incorrect |
10 ms |
1136 KB |
Wrong Answer [4] |
40 |
Incorrect |
9 ms |
1000 KB |
Wrong Answer [4] |