# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
123033 | tjd229 | Broken Device (JOI17_broken_device) | C++14 | 50 ms | 3312 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 mem[150] = { 0 };
for (int i = 0; i < K; ++i) mem[P[i]] = 1;
int pos = 0;
while (X && pos+1<N) {
if (mem[pos] + mem[pos + 1]) ++pos;
else {
mem[pos++] = 2;
mem[pos++] = (X & 1) + 1;
X >>= 1;
}
}
for (int i = 0; i < N; ++i) Set(i,mem[i]? mem[i]-1:0);
}
#include "Brunolib.h"
long long Bruno( int N, int A[] ){
long long X = 0;
int recon[60] = { 0 };
int pos = 0;
for (int i = 0; i < N;++i) {
if (A[i]) {
recon[pos++]=A[++i];
}
}
while (pos--) {
X <<= 1;
X += recon[pos];
}
return X;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |