#include <bits/stdc++.h>
#include "Annalib.h"
using namespace std;
void Anna( int N, long long x, int K, int P[]){
int i;
bool b[155];
int a[155]={67, 70, 94, 21, 88, 97, 77, 78, 89, 138, 111, 13, 75, 123, 145, 26, 62, 91, 105, 115, 76, 114, 144, 16, 106, 74, 108, 102, 86, 46, 28, 98, 5, 149, 126, 38, 130, 90, 27, 14, 119, 128, 139, 20, 53, 85, 117, 109, 39, 100, 24, 49, 0, 65, 143, 36, 61, 134, 73, 99, 4, 69, 82, 33, 136, 137, 147, 66, 6, 25, 19, 127, 133, 56, 40, 116, 23, 83, 68, 84, 71, 48, 54, 51, 30, 52, 31, 7, 12, 107, 55, 35, 22, 103, 8, 140, 121, 135, 141, 131, 57, 15, 101, 81, 118, 18, 129, 93, 11, 45, 9, 125, 148, 146, 63, 64, 72, 41, 50, 29, 80, 120, 79, 110, 47, 87, 60, 95, 1, 142, 42, 44, 58, 10, 132, 37, 113, 122, 43, 17, 2, 124, 104, 59, 92, 32, 3, 112, 34, 96};
for(i=0;i<N;i++) b[i]=false;
for(i=0;i<K;i++){
b[P[i]]=true;}
for(i=0;i<N;i+=3){
if((b[a[i]] && b[a[i+1]]) || (b[a[i+2]] && b[a[i+1]]) || (b[a[i]] && b[a[i+2]])) {Set(a[i],0); Set(a[i+1],0); Set(a[i+2],0); continue;}
if(b[a[i]] || b[a[i+1]] || b[a[i+2]]){
Set(a[i],0);
if(x%3==0) {Set(a[i+1],0); Set(a[i+2],1);}
if(x%3==1) {Set(a[i+1],1); Set(a[i+2],0);}
if(x%3==2) {Set(a[i+1],1); Set(a[i+2],1);}
x/=3;
}
else{
Set(a[i],1);
Set(a[i+1],x%2);
x/=2;
Set(a[i+2],x%2);
x/=2;
}
}
}
#include <bits/stdc++.h>
#include "Brunolib.h"
using namespace std;
long long Bruno( int N, int A[]){
long long ans,st,i;
int a[155]={67, 70, 94, 21, 88, 97, 77, 78, 89, 138, 111, 13, 75, 123, 145, 26, 62, 91, 105, 115, 76, 114, 144, 16, 106, 74, 108, 102, 86, 46, 28, 98, 5, 149, 126, 38, 130, 90, 27, 14, 119, 128, 139, 20, 53, 85, 117, 109, 39, 100, 24, 49, 0, 65, 143, 36, 61, 134, 73, 99, 4, 69, 82, 33, 136, 137, 147, 66, 6, 25, 19, 127, 133, 56, 40, 116, 23, 83, 68, 84, 71, 48, 54, 51, 30, 52, 31, 7, 12, 107, 55, 35, 22, 103, 8, 140, 121, 135, 141, 131, 57, 15, 101, 81, 118, 18, 129, 93, 11, 45, 9, 125, 148, 146, 63, 64, 72, 41, 50, 29, 80, 120, 79, 110, 47, 87, 60, 95, 1, 142, 42, 44, 58, 10, 132, 37, 113, 122, 43, 17, 2, 124, 104, 59, 92, 32, 3, 112, 34, 96};
ans=0;
st=1;
for(i=0;i<N;i+=3){
if(A[a[i]]==0 && A[a[i+1]]==0 && A[a[i+2]]==0) continue;
if(A[a[i]]==1){
ans+=st*A[a[i+2]];
st*=2;
ans+=st*A[a[i+1]];
st*=2;
}
else{
if(A[a[i+1]]==1 && A[a[i+2]]==0) ans+=st;
if(A[a[i+1]]==1 && A[a[i+2]]==1) ans+=2*st;
st*=3;
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
34 ms |
3056 KB |
Output isn't correct - L* = 0 |
2 |
Incorrect |
33 ms |
3312 KB |
Output isn't correct - L* = 0 |
3 |
Incorrect |
33 ms |
3056 KB |
Output isn't correct - L* = 0 |
4 |
Incorrect |
34 ms |
3056 KB |
Output isn't correct - L* = 0 |
5 |
Incorrect |
35 ms |
3312 KB |
Output isn't correct - L* = 0 |
6 |
Incorrect |
34 ms |
3264 KB |
Output isn't correct - L* = 0 |
7 |
Incorrect |
34 ms |
3312 KB |
Output isn't correct - L* = 0 |
8 |
Incorrect |
34 ms |
3056 KB |
Output isn't correct - L* = 0 |
9 |
Incorrect |
55 ms |
3312 KB |
Output isn't correct - L* = 0 |
10 |
Incorrect |
34 ms |
3312 KB |
Output isn't correct - L* = 0 |
11 |
Incorrect |
36 ms |
3064 KB |
Output isn't correct - L* = 0 |
12 |
Incorrect |
35 ms |
3312 KB |
Output isn't correct - L* = 0 |
13 |
Incorrect |
33 ms |
3056 KB |
Output isn't correct - L* = 0 |
14 |
Incorrect |
33 ms |
3056 KB |
Output isn't correct - L* = 0 |
15 |
Incorrect |
35 ms |
3056 KB |
Output isn't correct - L* = 0 |
16 |
Incorrect |
34 ms |
3056 KB |
Output isn't correct - L* = 0 |
17 |
Incorrect |
34 ms |
3056 KB |
Output isn't correct - L* = 0 |
18 |
Incorrect |
34 ms |
3056 KB |
Output isn't correct - L* = 0 |
19 |
Incorrect |
33 ms |
3312 KB |
Output isn't correct - L* = 0 |
20 |
Incorrect |
34 ms |
3056 KB |
Output isn't correct - L* = 0 |
21 |
Incorrect |
34 ms |
3312 KB |
Output isn't correct - L* = 0 |
22 |
Incorrect |
35 ms |
3312 KB |
Output isn't correct - L* = 0 |
23 |
Incorrect |
34 ms |
3312 KB |
Output isn't correct - L* = 0 |
24 |
Incorrect |
33 ms |
3312 KB |
Output isn't correct - L* = 0 |
25 |
Incorrect |
34 ms |
3312 KB |
Output isn't correct - L* = 0 |
26 |
Incorrect |
34 ms |
3312 KB |
Output isn't correct - L* = 0 |
27 |
Incorrect |
33 ms |
3312 KB |
Output isn't correct - L* = 0 |
28 |
Incorrect |
33 ms |
3264 KB |
Output isn't correct - L* = 0 |
29 |
Incorrect |
34 ms |
3312 KB |
Output isn't correct - L* = 0 |
30 |
Incorrect |
35 ms |
3056 KB |
Output isn't correct - L* = 0 |
31 |
Incorrect |
35 ms |
3312 KB |
Output isn't correct - L* = 0 |
32 |
Incorrect |
34 ms |
3056 KB |
Output isn't correct - L* = 0 |
33 |
Incorrect |
35 ms |
3312 KB |
Output isn't correct - L* = 0 |
34 |
Incorrect |
33 ms |
3312 KB |
Output isn't correct - L* = 0 |
35 |
Incorrect |
36 ms |
3312 KB |
Output isn't correct - L* = 0 |
36 |
Incorrect |
35 ms |
3152 KB |
Output isn't correct - L* = 0 |
37 |
Incorrect |
35 ms |
3416 KB |
Output isn't correct - L* = 0 |
38 |
Incorrect |
34 ms |
3568 KB |
Output isn't correct - L* = 0 |
39 |
Incorrect |
33 ms |
3056 KB |
Output isn't correct - L* = 0 |
40 |
Incorrect |
35 ms |
3312 KB |
Output isn't correct - L* = 0 |