# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
881581 | ThegeekKnight16 | Broken Device (JOI17_broken_device) | C++17 | 31 ms | 2644 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 <bits/stdc++.h>
#include "Annalib.h"
using namespace std;
void Anna( int N, long long X, int K, int P[] )
{
vector<int> bom(N+3, 1); bom[N] = bom[N+1] = bom[N+2] = 0;
for (int k = 0; k < K; k++) bom[P[k]] = 0;
for (int i = 0; i < N; i++)
{
if (!bom[i] || !bom[i+1] || !bom[i+2] || !bom[i+3]) {Set(i, 0); continue;}
Set(i, 1);
Set(i+1, (X&1LL)); X >>= 1LL; ++i;
Set(i+1, (X&1LL)); X >>= 1LL; ++i;
Set(i+1, (X&1LL)); X >>= 1LL; ++i;
}
}
#include <bits/stdc++.h>
#include "Brunolib.h"
using namespace std;
long long Bruno( int N, int A[] )
{
long long X = 0; long long k = 0;
for (int i = 0; i < N-1; i++)
{
if (!A[i]) continue;
X |= ((long long)A[i+1] << k++); ++i;
X |= ((long long)A[i+1] << k++); ++i;
X |= ((long long)A[i+1] << k++); ++i;
// cerr << "i: " << i << ", X: " << X << '\n';
}
return X;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |