# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
71444 | RezwanArefin01 | Broken Device (JOI17_broken_device) | C++17 | 73 ms | 13008 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> can(150, 1);
for(int i = 0; i < K; i++)
can[P[i]] = 0;
for(int i = 149; i >= 0; i -= 2) {
int a = i - 1, b = i;
if(can[a] && can[b] && X) {
int D = 1 + (X % 3); X /= 3;
Set(b, D & 1); D >>= 1;
Set(a, D & 1);
} else {
Set(a, 0); Set(b, 0);
}
}
}
#include <bits/stdc++.h>
#include "Brunolib.h"
using namespace std;
long long Bruno( int N, int A[] ){
long long X = 0;
for(int i = 0; i < 150; i += 2) {
int y = 2 * A[i] + A[i + 1];
if(y) X = 3 * X + y - 1;
} return X;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |