# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
100077 | helloworldworld | Broken Device (JOI17_broken_device) | C++14 | 2069 ms | 904 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 "Annalib.h"
void Anna( int n, long long x, int k, int p[] ){
int num[65];
int c=0;
int s,e;
while(x!=0){
num[c]=x%2;
x/=2;
c++;
}
int cur=0;
for(int i=0;i<k&&cur<c;i++){
if(i==0) s=0;
else s=p[i-1]+1;
e=p[i];
Set(e,0);
if(e-s<1) continue;
if(e-s==1){
if(num[cur]==1){
Set(s,1);
s++;
}
else{
Set(s,0);
s++;
}
}
else{
while(e-s>=num[cur]+1&&cur<c){
if(num[cur]==0){
Set(s,1);
Set(s+1,1);
s+=2;
cur++;
}
}
if(e-s==1)
Set(s,0);
}
}
int now;
return;
}
#include "Brunolib.h"
long long Bruno( int n, int a[] ){
long long ans=0;
long long p=1;
for(int i=0;i<n;i++){
if(a[i]==1){
if(i<n-1){
if(a[i+1]==1){
ans+=0;
p*=2;
i++;
}
else{
ans+=p;
p*=2;
}
}
else{
ans+=p;
p*=2;
}
}
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |