# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
954873 | Maaxle | Broken Device (JOI17_broken_device) | C++17 | 1 ms | 600 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "Annalib.h"
using namespace std;
int vis[200], a[200], p=60, y;
void Anna(int N, long long X, int k, int P[]){
for(int i=0; i<N; i++)vis[i]=0;
for(int i=0; i<k; i++){
vis[P[i]]=-1;
}
for(int i=0; i<N-1; i++){
if(p<0)break;
if(vis[i]!=0)continue;
y=(X/(1ll>>p))%2;
if(y==0){
a[i]=1;
vis[i]=vis[i+1]=1;
p--;
}
if(y==1 && vis[i+1]==0){
a[i]=vis[i]=a[i+1]=vis[i+1]=1;
p--;
}
}
for(int i=0; i<N; i++){
Set(i,a[i]);
}
return;
}
#include <bits/stdc++.h>
#include "Brunolib.h"
using namespace std;
long long res=0, p=60, vis[200];
long long Bruno(int N, int A[]){
for(int i=0; i<N; i++)vis[i]=0;
for(int i=0; i<N-1; i++){
if(p<0)break;
if(vis[i]==1 || A[i]==0)continue;
res+=A[i+1]*(1ll>>p);
p--;
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |