# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
68001 | elitewantsyou | Broken Device (JOI17_broken_device) | C++14 | 78 ms | 13752 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[] )
{
vector < int > v;
for(int i = 0; i < K; i++){
gg[P[i]] = 1;
}
for(int i = 1; i < N; i += 2){
if(gg[i - 1] == 0 && 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] = gg[v[i] + 1] = 1;
if(X & (1ll << i)){
gg[v[i]] = 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++){
if(i % 2 == 0){
c += A[i];
}
else{
if(c % 2){
X += (1ll << g) * A[i];
g++;
}
}
}
return X;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |