# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1077132 | isaachew | Broken Device (JOI17_broken_device) | C++17 | 26 ms | 2652 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"
/*
Use difference in 1 bits: 47 points
Base3: K<=75-38=37
*/
void Anna( int N, long long X, int K, int P[] ){
int places[150];
for(int i=0;i<150;i++)places[i]=0;
for(int i=0;i<K;i++){
places[P[i]]=1;
}
int cur=63;
for( int i = 0; i < N; i+=2){
if(places[i]||places[i+1]){
Set(i,0);
Set(i+1,0);
}else{
Set(i,(X%3+1)&1);
Set(i+1,(X%3+1)>1);
X/=3;
}
}
}
#include "Brunolib.h"
long long Bruno( int N, int A[] ){
long long num=0;
for( int i = N-2; i>=0; i-=2){
if(A[i]||A[i+1]){
num*=3;
num+=(A[i]+A[i+1]*2)-1;
}else{
}
}
return num;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |