# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
68004 | elitewantsyou | Broken Device (JOI17_broken_device) | C++14 | 69 ms | 3976 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;
int gg[1111];
void Anna( int N, long long X, int K, int P[] )
{
assert(N == 150);
vector < int > v;
for(int i = 0; i < K; i++){
gg[P[i]] = 1;
}
for(int i = 0; i < N; i += 2){
if(gg[i] == 0 && gg[i + 1] == 0){
v.push_back(i);
}
}
for(int i = 0; i < N; i++){
gg[i] = 0;
}
for(int i = 0; i < v.size(); i++){
gg[v[i]] = 1;
if(X & (1ll << i)){
gg[v[i] + 1] = 1;
}
}
for(int i = 0; i < N; i++){
Set(i, gg[i]);
}
}
#include "Brunolib.h"
long long Bruno( int N, int A[] )
{
long long X = 0;
int c = 0, g = 0;
for(int i = 0; i < N; i += 2){
if(A[i]){
X += (1ll << g) * A[i + 1];
g++;
}
}
return X;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |