# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
310985 | peuch | Broken Device (JOI17_broken_device) | C++17 | 2 ms | 1032 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 "Annalib.h"
#include<bits/stdc++.h>
using namespace std;
void Anna(int N, long long X, int K, int P[]){
int marc[N + 10];
memset(marc, 0, sizeof(marc));
for(int i = 0; i < K; i++)
marc[P[i]] = 1;
int it1 = 60, it2 = N - 1;
for(; it1 >= 0; it1--){
while((marc[it2] || (marc[it2 - 1] && (1LL << ((long long)it1)))) && it2 > 1) {
Set(it2, 0);
it2--;
}
Set(it2, 1);
it2--;
if((1LL << ((long long)it1)) & X) Set(it2, 1);
else Set(it2, 0);
it2--;
}
while(it2 >= 0){
Set(it2, 0);
it2--;
}
return;
}
#include "Brunolib.h"
#include<bits/stdc++.h>
using namespace std;
long long Bruno(int N, int A[]){
int it1 = 60, it2 = N - 1;
long long ret = 0;
for(; it2 > 0; it2--){
if(A[it2]){
it2--;
ret |= ((long long) A[it2]) << (long long)it1;
it1--;
}
if(it1 < 0) break;
}
return ret;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |