Submission #100081

#TimeUsernameProblemLanguageResultExecution timeMemory
100081helloworldworldBroken Device (JOI17_broken_device)C++14
0 / 100
30 ms904 KiB
#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>=2-num[cur]&&cur<c){ if(num[cur]==0){ Set(s,1); Set(s+1,1); s+=2; cur++; } else if(num[cur]==1){ Set(s,1); s++; 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)

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:48:9: warning: unused variable 'now' [-Wunused-variable]
     int now;
         ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...