Submission #1077132

#TimeUsernameProblemLanguageResultExecution timeMemory
1077132isaachewBroken Device (JOI17_broken_device)C++17
85 / 100
26 ms2652 KiB
#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)

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