#include "Annalib.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << " " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << " " << j << " " << i << " " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
void Anna(int n, long long val, int k, int p[]){
bool amos[155];
memset(amos,0,sizeof(amos));
for(int x=0;x<k;x++){
amos[p[x]]=true;
}
deque<int>v;
for(int x=0;x<60;x++){
if(val&(1LL<<x)) v.push_back(1);
else v.push_back(0);
}
int ptr=0;
//for(int x=0;x<n;x++){
//if(ptr<(int)v.size()&&x+3<n&&!amos[x]&&!amos[x+1]&&!amos[x+2]&&!amos[x+3]){
//Set(x,1);
//Set(x+1,v[ptr]);
//ptr++;
//Set(x+2,v[ptr]);
//ptr++;
//Set(x+3,v[ptr]);
//ptr++;
//x+=3;
//}
//else Set(x,0);
//}
int st=0;
for(;st<n;st++){
if(ptr==8) break;
if(ptr<(int)8&&st+1<n&&!amos[st]&&!amos[st+1]){
ptr++;
st+=1;
}
}
ptr=0;
//show(st,st);
pii maxi={-1,-1};
for(int x=1;x<n;x++){
if(60%x!=0) continue;
int bit=0;
for(int y=st;y<n;y++){
if(ptr<(int)v.size()&&y+x<n){
bool ok=true;
for(int i=0;i<=x;i++){
if(amos[y+i]) ok=false;
}
if(ok){
bit+=x;
y+=x;
}
}
}
maxi=max(maxi,{bit,x});
}
for(int i=7;i>=0;i--){
if(maxi.second&(1<<i)){
v.push_front(1);
}
else v.push_front(0);
}
int x=0;
vector<int>done;
for(;x<n;x++){
if(ptr==8) break;
if(ptr<(int)8&&x+1<n&&!amos[x]&&!amos[x+1]){
Set(x,1);
Set(x+1,v[ptr]);
//show(set,x+1);
ptr++;
x+=1;
}
else Set(x,0);
}
//cout << maxi.second << " maxi.second" << endl;
//show(x,x);
for(;x<n;x++){
if(ptr<(int)v.size()&&x+maxi.second<n){
//show(trigger,2);
bool ok=true;
for(int i=0;i<=maxi.second;i++){
if(amos[x+i]) ok=false;
}
if(ok){
//show(trigger,1);
Set(x,1);
for(int i=0;i<maxi.second;i++){
Set(x+i+1,v[ptr]);
ptr++;
}
x+=maxi.second;
}
else Set(x,0);
}
else Set(x,0);
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << " " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << " " << j << " " << i << " " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
long long Bruno(int n, int a[]){
long long val=0;
int cur=0;
//for(int x=0;x<n;x++) cout << a[x] << " ";
//cout << endl;
//for(int x=0;x<n;x++){
//if(a[x]==1){
//if(a[x+1]==1){
//val+=1LL<<cur;
//}
//cur++;
//if(a[x+2]==1){
//val+=1LL<<cur;
//}
//cur++;
//if(a[x+3]==1){
//val+=1LL<<cur;
//}
//cur++;
//x+=3;
//}
//}
int x=0;
int base=0;
//int cnt=0;
for(;x<n;x++){
if(cur==8) break;
if(a[x]==1){
if(a[x+1]==1){
base+=1LL<<cur;
}
cur++;
x++;
}
}
//show(base,base);
cur=0;
for(;x<n;x++){
if(a[x]==1){
for(int y=0;y<base;y++){
if(a[x+y+1]==1){
val+=1LL<<cur;
}
cur++;
}
x+=base;
}
}
//for(int x=0;x<n;x++){
//cout << a[x] << " ";
//}
//cout << " a\n";
//cout << "check" << endl;
return val;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
26 ms |
2780 KB |
Output is partially correct - L* = 24 |
2 |
Partially correct |
27 ms |
2752 KB |
Output is partially correct - L* = 22 |
3 |
Partially correct |
27 ms |
3172 KB |
Output is partially correct - L* = 24 |
4 |
Partially correct |
27 ms |
2776 KB |
Output is partially correct - L* = 23 |
5 |
Partially correct |
26 ms |
2776 KB |
Output is partially correct - L* = 24 |
6 |
Partially correct |
33 ms |
2780 KB |
Output is partially correct - L* = 24 |
7 |
Partially correct |
28 ms |
2744 KB |
Output is partially correct - L* = 24 |
8 |
Partially correct |
27 ms |
2776 KB |
Output is partially correct - L* = 21 |
9 |
Partially correct |
28 ms |
2776 KB |
Output is partially correct - L* = 24 |
10 |
Partially correct |
31 ms |
2776 KB |
Output is partially correct - L* = 24 |
11 |
Partially correct |
27 ms |
2776 KB |
Output is partially correct - L* = 26 |
12 |
Partially correct |
28 ms |
2752 KB |
Output is partially correct - L* = 24 |
13 |
Partially correct |
27 ms |
2772 KB |
Output is partially correct - L* = 23 |
14 |
Partially correct |
27 ms |
2748 KB |
Output is partially correct - L* = 23 |
15 |
Partially correct |
27 ms |
2748 KB |
Output is partially correct - L* = 24 |
16 |
Partially correct |
26 ms |
2748 KB |
Output is partially correct - L* = 25 |
17 |
Partially correct |
26 ms |
2748 KB |
Output is partially correct - L* = 21 |
18 |
Partially correct |
29 ms |
2736 KB |
Output is partially correct - L* = 24 |
19 |
Partially correct |
27 ms |
2752 KB |
Output is partially correct - L* = 23 |
20 |
Partially correct |
27 ms |
2624 KB |
Output is partially correct - L* = 24 |
21 |
Partially correct |
27 ms |
2780 KB |
Output is partially correct - L* = 24 |
22 |
Partially correct |
28 ms |
2772 KB |
Output is partially correct - L* = 23 |
23 |
Partially correct |
33 ms |
2736 KB |
Output is partially correct - L* = 23 |
24 |
Partially correct |
27 ms |
2736 KB |
Output is partially correct - L* = 23 |
25 |
Partially correct |
28 ms |
2776 KB |
Output is partially correct - L* = 24 |
26 |
Partially correct |
28 ms |
2952 KB |
Output is partially correct - L* = 24 |
27 |
Partially correct |
27 ms |
2764 KB |
Output is partially correct - L* = 23 |
28 |
Partially correct |
26 ms |
2772 KB |
Output is partially correct - L* = 23 |
29 |
Partially correct |
27 ms |
2852 KB |
Output is partially correct - L* = 25 |
30 |
Partially correct |
27 ms |
2776 KB |
Output is partially correct - L* = 24 |
31 |
Partially correct |
27 ms |
2768 KB |
Output is partially correct - L* = 21 |
32 |
Partially correct |
30 ms |
3316 KB |
Output is partially correct - L* = 24 |
33 |
Partially correct |
26 ms |
2700 KB |
Output is partially correct - L* = 23 |
34 |
Partially correct |
26 ms |
2768 KB |
Output is partially correct - L* = 22 |
35 |
Partially correct |
26 ms |
2748 KB |
Output is partially correct - L* = 24 |
36 |
Partially correct |
27 ms |
2840 KB |
Output is partially correct - L* = 23 |
37 |
Partially correct |
28 ms |
2700 KB |
Output is partially correct - L* = 23 |
38 |
Partially correct |
27 ms |
2696 KB |
Output is partially correct - L* = 23 |
39 |
Partially correct |
27 ms |
2736 KB |
Output is partially correct - L* = 25 |
40 |
Partially correct |
28 ms |
2840 KB |
Output is partially correct - L* = 24 |