#include "Annalib.h"
typedef long long llg;
const int borne = 155;
int lenSeq, nbCas;
bool bloque[borne];
int ret[borne];
int k[borne] {0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0};
long long nombre;
void solve()
{
ret[0] = 1;
int lst = 0;
int i = 1;
for (int b = 59; b >= 0; --b) {
int c = 0;
if (nombre & (1LL << (long long)(b))) c = 1;
while (k[i - lst] != c || bloque[i]) ++i;
if (i+1 >= lenSeq) return;
ret[i] = 1;
lst = i;
i++;
}
}
void Anna( int N, long long X, int K, int P[] ){
lenSeq = N;
nombre = X;
for (int i = 0; i < N; ++i) { bloque[i] = false; ret[i] = 0; }
for (int i = 0; i < K; ++i) bloque[P[i]] = true;
solve();
for (int i = 0; i < N; ++i) Set(i, ret[i]);
return;
}
#include "Brunolib.h"
int k2[155] { 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0 };
long long Bruno( int N, int A[] ){
long long X = 0;
int lst = 0, i = 1;
for (int b = 59; b >= 0; --b) {
while (A[i] == 0) ++i;
if (k2[i - lst] == 1) X += 1LL << (long long)(b);
lst = i;
++i;
}
return X;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
36 ms |
3056 KB |
Output isn't correct - L* = 0 |
2 |
Incorrect |
38 ms |
3056 KB |
Output isn't correct - L* = 0 |
3 |
Incorrect |
37 ms |
3056 KB |
Output isn't correct - L* = 0 |
4 |
Incorrect |
37 ms |
3072 KB |
Output isn't correct - L* = 0 |
5 |
Incorrect |
41 ms |
3056 KB |
Output isn't correct - L* = 0 |
6 |
Incorrect |
52 ms |
3056 KB |
Output isn't correct - L* = 0 |
7 |
Incorrect |
36 ms |
3056 KB |
Output isn't correct - L* = 0 |
8 |
Incorrect |
62 ms |
2968 KB |
Output isn't correct - L* = 0 |
9 |
Incorrect |
63 ms |
3464 KB |
Output isn't correct - L* = 0 |
10 |
Incorrect |
60 ms |
2992 KB |
Output isn't correct - L* = 0 |
11 |
Incorrect |
43 ms |
2816 KB |
Output isn't correct - L* = 0 |
12 |
Incorrect |
60 ms |
2800 KB |
Output isn't correct - L* = 0 |
13 |
Incorrect |
51 ms |
3072 KB |
Output isn't correct - L* = 0 |
14 |
Incorrect |
41 ms |
3072 KB |
Output isn't correct - L* = 0 |
15 |
Incorrect |
40 ms |
2816 KB |
Output isn't correct - L* = 0 |
16 |
Incorrect |
53 ms |
3016 KB |
Output isn't correct - L* = 0 |
17 |
Incorrect |
54 ms |
3056 KB |
Output isn't correct - L* = 0 |
18 |
Incorrect |
44 ms |
3056 KB |
Output isn't correct - L* = 0 |
19 |
Incorrect |
38 ms |
3072 KB |
Output isn't correct - L* = 0 |
20 |
Incorrect |
44 ms |
3016 KB |
Output isn't correct - L* = 0 |
21 |
Incorrect |
48 ms |
2800 KB |
Output isn't correct - L* = 0 |
22 |
Incorrect |
53 ms |
3056 KB |
Output isn't correct - L* = 0 |
23 |
Incorrect |
54 ms |
3072 KB |
Output isn't correct - L* = 0 |
24 |
Incorrect |
48 ms |
3224 KB |
Output isn't correct - L* = 0 |
25 |
Incorrect |
53 ms |
2800 KB |
Output isn't correct - L* = 0 |
26 |
Incorrect |
62 ms |
2816 KB |
Output isn't correct - L* = 0 |
27 |
Incorrect |
44 ms |
3056 KB |
Output isn't correct - L* = 0 |
28 |
Incorrect |
59 ms |
2888 KB |
Output isn't correct - L* = 0 |
29 |
Incorrect |
61 ms |
3088 KB |
Output isn't correct - L* = 0 |
30 |
Incorrect |
60 ms |
2816 KB |
Output isn't correct - L* = 0 |
31 |
Incorrect |
41 ms |
3072 KB |
Output isn't correct - L* = 0 |
32 |
Incorrect |
44 ms |
3056 KB |
Output isn't correct - L* = 0 |
33 |
Incorrect |
54 ms |
2816 KB |
Output isn't correct - L* = 0 |
34 |
Incorrect |
43 ms |
2816 KB |
Output isn't correct - L* = 0 |
35 |
Incorrect |
44 ms |
3072 KB |
Output isn't correct - L* = 0 |
36 |
Incorrect |
41 ms |
3072 KB |
Output isn't correct - L* = 0 |
37 |
Incorrect |
50 ms |
2800 KB |
Output isn't correct - L* = 0 |
38 |
Incorrect |
43 ms |
2816 KB |
Output isn't correct - L* = 0 |
39 |
Incorrect |
50 ms |
3000 KB |
Output isn't correct - L* = 0 |
40 |
Incorrect |
51 ms |
3000 KB |
Output isn't correct - L* = 0 |