#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;
}
vector<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+2<n&&!amos[x]&&!amos[x+1]&&!amos[x+2]){
Set(x,1);
Set(x+1,v[ptr]);
ptr++;
Set(x+2,v[ptr]);
ptr++;
x+=2;
}
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++;
x+=2;
}
}
//cout << "check" << endl;
return val;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
23 ms |
2772 KB |
Output is partially correct - L* = 20 |
2 |
Partially correct |
23 ms |
2688 KB |
Output is partially correct - L* = 20 |
3 |
Partially correct |
22 ms |
2768 KB |
Output is partially correct - L* = 21 |
4 |
Partially correct |
20 ms |
2716 KB |
Output is partially correct - L* = 20 |
5 |
Partially correct |
23 ms |
2776 KB |
Output is partially correct - L* = 20 |
6 |
Partially correct |
22 ms |
2772 KB |
Output is partially correct - L* = 20 |
7 |
Partially correct |
23 ms |
2784 KB |
Output is partially correct - L* = 20 |
8 |
Partially correct |
22 ms |
3044 KB |
Output is partially correct - L* = 20 |
9 |
Partially correct |
22 ms |
2772 KB |
Output is partially correct - L* = 20 |
10 |
Partially correct |
28 ms |
2776 KB |
Output is partially correct - L* = 21 |
11 |
Partially correct |
27 ms |
2796 KB |
Output is partially correct - L* = 20 |
12 |
Partially correct |
22 ms |
2752 KB |
Output is partially correct - L* = 21 |
13 |
Partially correct |
26 ms |
2940 KB |
Output is partially correct - L* = 20 |
14 |
Partially correct |
26 ms |
2692 KB |
Output is partially correct - L* = 20 |
15 |
Partially correct |
23 ms |
2772 KB |
Output is partially correct - L* = 20 |
16 |
Partially correct |
22 ms |
2776 KB |
Output is partially correct - L* = 21 |
17 |
Partially correct |
22 ms |
2836 KB |
Output is partially correct - L* = 20 |
18 |
Partially correct |
23 ms |
2716 KB |
Output is partially correct - L* = 20 |
19 |
Partially correct |
22 ms |
2776 KB |
Output is partially correct - L* = 22 |
20 |
Partially correct |
20 ms |
2776 KB |
Output is partially correct - L* = 21 |
21 |
Partially correct |
22 ms |
2756 KB |
Output is partially correct - L* = 20 |
22 |
Partially correct |
22 ms |
2772 KB |
Output is partially correct - L* = 20 |
23 |
Partially correct |
20 ms |
2856 KB |
Output is partially correct - L* = 20 |
24 |
Partially correct |
20 ms |
2728 KB |
Output is partially correct - L* = 21 |
25 |
Partially correct |
23 ms |
2776 KB |
Output is partially correct - L* = 21 |
26 |
Partially correct |
25 ms |
2788 KB |
Output is partially correct - L* = 20 |
27 |
Partially correct |
22 ms |
2720 KB |
Output is partially correct - L* = 20 |
28 |
Partially correct |
20 ms |
2756 KB |
Output is partially correct - L* = 21 |
29 |
Partially correct |
22 ms |
2780 KB |
Output is partially correct - L* = 20 |
30 |
Partially correct |
22 ms |
2768 KB |
Output is partially correct - L* = 20 |
31 |
Partially correct |
20 ms |
2764 KB |
Output is partially correct - L* = 20 |
32 |
Partially correct |
20 ms |
2784 KB |
Output is partially correct - L* = 20 |
33 |
Partially correct |
23 ms |
2772 KB |
Output is partially correct - L* = 20 |
34 |
Partially correct |
23 ms |
2772 KB |
Output is partially correct - L* = 20 |
35 |
Partially correct |
20 ms |
2776 KB |
Output is partially correct - L* = 20 |
36 |
Partially correct |
22 ms |
2780 KB |
Output is partially correct - L* = 21 |
37 |
Partially correct |
35 ms |
2752 KB |
Output is partially correct - L* = 20 |
38 |
Partially correct |
22 ms |
2780 KB |
Output is partially correct - L* = 20 |
39 |
Partially correct |
28 ms |
2744 KB |
Output is partially correct - L* = 21 |
40 |
Partially correct |
20 ms |
2776 KB |
Output is partially correct - L* = 21 |