#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll C[155];
void MySet(ll n, ll a, ll b, ll c){
Set(n, a);
Set(n + 1, b);
Set(n + 2, c);
}
void Anna(int N, long long X, int K, int P[]){
fill(C, C + 155, 0);
for(ll i = 0; i < K; i++){
C[P[i]] = 1;
}
vector<ll> V;
while(V.size() <= 154){
V.push_back(X % 2);
X /= 2;
}
for(ll i = 0, j = 0; i < 150; i += 3){
if(C[i] + C[i + 1] + C[i + 2] == 0){
if(V[j] == 0 && V[j + 1] == 0) MySet(i, 1, 0, 0);
if(V[j] == 0 && V[j + 1] == 1) MySet(i, 1, 0, 1);
if(V[j] == 1 && V[j + 1] == 0) MySet(i, 0, 1, 1);
if(V[j] == 1 && V[j + 1] == 1) MySet(i, 1, 1, 1);
j += 2;
} else if(C[i] + C[i + 1] + C[i + 2] == 1) {
if(V[j] == 0){
if(!C[j]){
MySet(i, 0, 1, 0);
j++;
} else if(V[j + 1] == 0){
MySet(i, 1, 0, 0);
j += 2;
} else {
MySet(i, 1, 0, 1);
j += 2;
}
} else if(C[i + 2] == 1) {
MySet(i, 1, 1, 0);
j++;
} else {
MySet(i, 0, 0, 1);
j++;
}
} else {
MySet(i, 0, 0, 0);
}
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll B[8] = {0, 1, 0, 1, 0, 2, 1, 3};
ll C[8] = {0, 1, 1, 2, 2, 2, 1, 2};
long long Bruno( int N, int A[] ){
ll ans = 0, s = 0;
for(int i = 0; i < N; i += 3){
ll v = A[i] * 4 + A[i + 1] * 2 + A[i + 2];
ans |= (B[v] << s);
s += C[v];
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
41 ms |
2532 KB |
Output isn't correct - L* = 0 |
2 |
Partially correct |
34 ms |
2500 KB |
Output isn't correct - L* = 0 |
3 |
Partially correct |
43 ms |
2584 KB |
Output isn't correct - L* = 0 |
4 |
Partially correct |
41 ms |
2480 KB |
Output isn't correct - L* = 0 |
5 |
Partially correct |
38 ms |
2488 KB |
Output isn't correct - L* = 0 |
6 |
Partially correct |
49 ms |
2584 KB |
Output isn't correct - L* = 0 |
7 |
Partially correct |
51 ms |
2432 KB |
Output isn't correct - L* = 0 |
8 |
Partially correct |
32 ms |
2544 KB |
Output isn't correct - L* = 0 |
9 |
Partially correct |
61 ms |
2452 KB |
Output isn't correct - L* = 0 |
10 |
Partially correct |
31 ms |
2536 KB |
Output isn't correct - L* = 0 |
11 |
Partially correct |
37 ms |
2520 KB |
Output isn't correct - L* = 0 |
12 |
Partially correct |
34 ms |
2416 KB |
Output isn't correct - L* = 0 |
13 |
Partially correct |
34 ms |
2508 KB |
Output isn't correct - L* = 0 |
14 |
Partially correct |
33 ms |
2508 KB |
Output isn't correct - L* = 0 |
15 |
Partially correct |
34 ms |
2492 KB |
Output isn't correct - L* = 0 |
16 |
Partially correct |
39 ms |
2528 KB |
Output isn't correct - L* = 0 |
17 |
Partially correct |
39 ms |
2456 KB |
Output isn't correct - L* = 0 |
18 |
Partially correct |
34 ms |
2436 KB |
Output isn't correct - L* = 0 |
19 |
Partially correct |
33 ms |
2468 KB |
Output isn't correct - L* = 0 |
20 |
Partially correct |
36 ms |
2504 KB |
Output isn't correct - L* = 0 |
21 |
Partially correct |
33 ms |
2416 KB |
Output isn't correct - L* = 0 |
22 |
Partially correct |
48 ms |
2468 KB |
Output isn't correct - L* = 0 |
23 |
Partially correct |
34 ms |
2464 KB |
Output isn't correct - L* = 0 |
24 |
Partially correct |
34 ms |
2516 KB |
Output isn't correct - L* = 0 |
25 |
Partially correct |
34 ms |
2428 KB |
Output isn't correct - L* = 0 |
26 |
Partially correct |
34 ms |
2512 KB |
Output isn't correct - L* = 0 |
27 |
Partially correct |
33 ms |
2460 KB |
Output isn't correct - L* = 0 |
28 |
Partially correct |
46 ms |
2488 KB |
Output isn't correct - L* = 0 |
29 |
Partially correct |
31 ms |
2532 KB |
Output isn't correct - L* = 0 |
30 |
Partially correct |
33 ms |
2448 KB |
Output isn't correct - L* = 0 |
31 |
Partially correct |
34 ms |
2504 KB |
Output isn't correct - L* = 0 |
32 |
Partially correct |
40 ms |
2584 KB |
Output isn't correct - L* = 0 |
33 |
Partially correct |
49 ms |
2440 KB |
Output isn't correct - L* = 0 |
34 |
Partially correct |
40 ms |
2508 KB |
Output isn't correct - L* = 0 |
35 |
Partially correct |
44 ms |
2400 KB |
Output isn't correct - L* = 0 |
36 |
Partially correct |
34 ms |
2524 KB |
Output isn't correct - L* = 0 |
37 |
Partially correct |
47 ms |
2556 KB |
Output isn't correct - L* = 0 |
38 |
Partially correct |
36 ms |
2396 KB |
Output isn't correct - L* = 0 |
39 |
Partially correct |
44 ms |
2476 KB |
Output isn't correct - L* = 0 |
40 |
Partially correct |
38 ms |
2504 KB |
Output isn't correct - L* = 0 |