# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
718381 | ThegeekKnight16 | Broken Device (JOI17_broken_device) | C++17 | 38 ms | 2636 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[] )
{
// cerr << N << '\n';
vector<bool> Marc(N);
for (int i = 0; i < K; i++) Marc[P[i]] = 1;
int atual = 60;
for(int i = 0; i < N; i += 2)
{
if (Marc[i] || Marc[i+1] || atual < 0)
{
// cerr << "Seta " << i << " e " << i+1 << " para 0" << '\n';
Set(i, 0);
Set(i+1, 0);
}
else
{
int aux = ((bool)(X & (1LL << atual)));
// cerr << "Seta " << i << " para 1 e " << i+1 << " para " << aux << '\n';
Set(i, 1);
Set(i+1, aux);
--atual;
}
}
}
#include <bits/stdc++.h>
#include "Brunolib.h"
using namespace std;
long long Bruno( int N, int A[] )
{
long long resp = 0;
for (int i = 0; i < N; i += 2)
{
if (A[i])
{
// cerr << "Adiciona " << A[i+1] << '\n';
resp <<= 1LL;
resp |= A[i+1];
}
}
return resp;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |