# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
90336 | Alexa2001 | Broken Device (JOI17_broken_device) | C++17 | 44 ms | 3064 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"
bool broken[200];
void Anna( int N, long long X, int K, int P[] )
{
int i;
for(i=0; i<N; ++i) broken[i] = 0;
for(i=0; i<K; ++i) broken[P[i]] = 1;
int pos = 59;
for(i=0; i<N; )
if(pos>=0 && i<N-1 && !broken[i] && !broken[i+1])
{
Set(i, 1);
Set(i+1, (X & (1LL<<pos)) ? 1 : 0);
i += 2;
--pos;
}
else Set(i++, 0);
}
#include "Brunolib.h"
long long Bruno( int N, int A[] )
{
int i;
bool ok = 0;
long long ans = 0;
for(i=0; i<N; ++i)
if(!ok)
{
if(A[i]) ok = 1;
}
else ans = ans * 2 + A[i], ok = 0;
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |