#include "Annalib.h"
const int A[8] = {6, 7, 4, 3, 1, 2, 5, 0};
const int B[8] = {3, 2, 1, 0, 1, 0, 0, 0};
const int C[8] = {2, 2, 2, 2, 1, 1, 1, 0};
int chk[155];
void Anna (int N, long long X, int K, int P[]) {
for(int i=0;i<N;i++) {
chk[i] = 0;
}
for(int i=0;i<K;i++) {
chk[P[i]] = 1;
}
for(int i=0;i<50;i++) {
int T = chk[3*i] * 1 + chk[3*i+1] * 2 + chk[3*i+2] * 4;
for(int j=0;j<8;j++) {
if((T & A[j]) || X % (1<<C[j]) != B[j]) continue;
for(int k=0;k<3;k++) {
Set(3*i+k, !!(A[j]&(1<<k)));
}
X /= (1<<C[j]);
break;
}
}
}
#include "Brunolib.h"
const int A[8] = {6, 7, 4, 3, 1, 2, 5, 0};
const int B[8] = {3, 2, 1, 0, 1, 0, 0, 0};
const int C[8] = {2, 2, 2, 2, 1, 1, 1, 0};
long long Bruno (int N, int P[]) {
long long ret = 0, bit = 1;
for(int i=0;i<50;i++) {
int T = P[3*i] * 1 + P[3*i+1] * 2 + P[3*i+2] * 4;
for(int j=0;j<8;j++) {
if(T != A[j]) continue;
ret += bit * B[j];
bit *= (1<<C[j]);
break;
}
}
return ret;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
51 ms |
2808 KB |
Output is correct - L* = 40 |
2 |
Correct |
56 ms |
3192 KB |
Output is correct - L* = 40 |
3 |
Correct |
55 ms |
3344 KB |
Output is correct - L* = 40 |
4 |
Correct |
59 ms |
3352 KB |
Output is correct - L* = 40 |
5 |
Correct |
60 ms |
3456 KB |
Output is correct - L* = 40 |
6 |
Correct |
55 ms |
3488 KB |
Output is correct - L* = 40 |
7 |
Correct |
50 ms |
3488 KB |
Output is correct - L* = 40 |
8 |
Correct |
69 ms |
3488 KB |
Output is correct - L* = 40 |
9 |
Correct |
68 ms |
3528 KB |
Output is correct - L* = 40 |
10 |
Correct |
54 ms |
3528 KB |
Output is correct - L* = 40 |
11 |
Correct |
54 ms |
3528 KB |
Output is correct - L* = 40 |
12 |
Correct |
56 ms |
3528 KB |
Output is correct - L* = 40 |
13 |
Correct |
54 ms |
3528 KB |
Output is correct - L* = 40 |
14 |
Correct |
60 ms |
3744 KB |
Output is correct - L* = 40 |
15 |
Correct |
56 ms |
3744 KB |
Output is correct - L* = 40 |
16 |
Correct |
54 ms |
3744 KB |
Output is correct - L* = 40 |
17 |
Correct |
63 ms |
3744 KB |
Output is correct - L* = 40 |
18 |
Correct |
65 ms |
3744 KB |
Output is correct - L* = 40 |
19 |
Correct |
73 ms |
3744 KB |
Output is correct - L* = 40 |
20 |
Correct |
62 ms |
3744 KB |
Output is correct - L* = 40 |
21 |
Correct |
57 ms |
3744 KB |
Output is correct - L* = 40 |
22 |
Correct |
50 ms |
3744 KB |
Output is correct - L* = 40 |
23 |
Correct |
62 ms |
3744 KB |
Output is correct - L* = 40 |
24 |
Correct |
50 ms |
3744 KB |
Output is correct - L* = 40 |
25 |
Correct |
62 ms |
3744 KB |
Output is correct - L* = 40 |
26 |
Correct |
53 ms |
3744 KB |
Output is correct - L* = 40 |
27 |
Correct |
95 ms |
3744 KB |
Output is correct - L* = 40 |
28 |
Correct |
68 ms |
3744 KB |
Output is correct - L* = 40 |
29 |
Correct |
57 ms |
3744 KB |
Output is correct - L* = 40 |
30 |
Correct |
77 ms |
3744 KB |
Output is correct - L* = 40 |
31 |
Correct |
73 ms |
3744 KB |
Output is correct - L* = 40 |
32 |
Correct |
76 ms |
3744 KB |
Output is correct - L* = 40 |
33 |
Correct |
69 ms |
3744 KB |
Output is correct - L* = 40 |
34 |
Correct |
50 ms |
3744 KB |
Output is correct - L* = 40 |
35 |
Correct |
69 ms |
3744 KB |
Output is correct - L* = 40 |
36 |
Correct |
51 ms |
3744 KB |
Output is correct - L* = 40 |
37 |
Correct |
60 ms |
3744 KB |
Output is correct - L* = 40 |
38 |
Correct |
55 ms |
3744 KB |
Output is correct - L* = 40 |
39 |
Correct |
66 ms |
3744 KB |
Output is correct - L* = 40 |
40 |
Correct |
58 ms |
3744 KB |
Output is correct - L* = 40 |