#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;
while(val>0){
v.push_back(val%3);
val/=3;
}
int ptr=0;
for(int x=0;x<n;x+=2){
if(amos[x]||amos[x+1]){
Set(x,0);
Set(x+1,0);
}
else if(ptr==(int)v.size()){
Set(x,0);
Set(x+1,0);
}
else{
if(v[ptr]==0){
Set(x,0);
Set(x+1,1);
}
else if(v[ptr]==1){
Set(x,1);
Set(x+1,0);
}
else{
Set(x,1);
Set(x+1,1);
}
ptr++;
}
}
}
#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;
long long take=1;
for(int x=0;x<n;x+=2){
if(a[x]==0&&a[x+1]==0) continue;
else{
int cur=0;
if(a[x]==1&&a[x+1]==0) cur=1;
if(a[x]==1&&a[x+1]==1) cur=2;
val=val+cur*take;
take*=3;
}
}
return val;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
20 ms |
2776 KB |
Output is partially correct - L* = 37 |
2 |
Partially correct |
20 ms |
2768 KB |
Output is partially correct - L* = 37 |
3 |
Partially correct |
24 ms |
3180 KB |
Output is partially correct - L* = 37 |
4 |
Partially correct |
20 ms |
2772 KB |
Output is partially correct - L* = 37 |
5 |
Partially correct |
27 ms |
2784 KB |
Output is partially correct - L* = 37 |
6 |
Partially correct |
22 ms |
2780 KB |
Output is partially correct - L* = 37 |
7 |
Partially correct |
20 ms |
2860 KB |
Output is partially correct - L* = 37 |
8 |
Partially correct |
22 ms |
2752 KB |
Output is partially correct - L* = 37 |
9 |
Partially correct |
20 ms |
2864 KB |
Output is partially correct - L* = 37 |
10 |
Partially correct |
20 ms |
2840 KB |
Output is partially correct - L* = 37 |
11 |
Partially correct |
23 ms |
2804 KB |
Output is partially correct - L* = 37 |
12 |
Partially correct |
22 ms |
2792 KB |
Output is partially correct - L* = 37 |
13 |
Partially correct |
22 ms |
2772 KB |
Output is partially correct - L* = 37 |
14 |
Partially correct |
22 ms |
2772 KB |
Output is partially correct - L* = 37 |
15 |
Partially correct |
20 ms |
2768 KB |
Output is partially correct - L* = 37 |
16 |
Partially correct |
22 ms |
2784 KB |
Output is partially correct - L* = 37 |
17 |
Partially correct |
20 ms |
2772 KB |
Output is partially correct - L* = 37 |
18 |
Partially correct |
22 ms |
2780 KB |
Output is partially correct - L* = 37 |
19 |
Partially correct |
22 ms |
2784 KB |
Output is partially correct - L* = 37 |
20 |
Partially correct |
20 ms |
2776 KB |
Output is partially correct - L* = 37 |
21 |
Partially correct |
30 ms |
2864 KB |
Output is partially correct - L* = 37 |
22 |
Partially correct |
20 ms |
3028 KB |
Output is partially correct - L* = 37 |
23 |
Partially correct |
20 ms |
2864 KB |
Output is partially correct - L* = 37 |
24 |
Partially correct |
22 ms |
2776 KB |
Output is partially correct - L* = 37 |
25 |
Partially correct |
23 ms |
2784 KB |
Output is partially correct - L* = 37 |
26 |
Partially correct |
20 ms |
2808 KB |
Output is partially correct - L* = 37 |
27 |
Partially correct |
27 ms |
2684 KB |
Output is partially correct - L* = 37 |
28 |
Partially correct |
20 ms |
2780 KB |
Output is partially correct - L* = 37 |
29 |
Partially correct |
20 ms |
2772 KB |
Output is partially correct - L* = 37 |
30 |
Partially correct |
20 ms |
2776 KB |
Output is partially correct - L* = 37 |
31 |
Partially correct |
20 ms |
2772 KB |
Output is partially correct - L* = 37 |
32 |
Partially correct |
20 ms |
2776 KB |
Output is partially correct - L* = 37 |
33 |
Partially correct |
23 ms |
2764 KB |
Output is partially correct - L* = 37 |
34 |
Partially correct |
20 ms |
2772 KB |
Output is partially correct - L* = 37 |
35 |
Partially correct |
22 ms |
2844 KB |
Output is partially correct - L* = 37 |
36 |
Partially correct |
20 ms |
2776 KB |
Output is partially correct - L* = 37 |
37 |
Partially correct |
22 ms |
2772 KB |
Output is partially correct - L* = 37 |
38 |
Partially correct |
27 ms |
2772 KB |
Output is partially correct - L* = 37 |
39 |
Partially correct |
20 ms |
2772 KB |
Output is partially correct - L* = 37 |
40 |
Partially correct |
22 ms |
2784 KB |
Output is partially correct - L* = 37 |