# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
100032 | oolimry | Broken Device (JOI17_broken_device) | C++14 | 10 ms | 1004 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[] ){
set<int> bad;
for(int i = 0;i < K;i++){
bad.insert(P[i]);
}
int bin[60];
for(int i = 0;i < 60;i++){
long long f = 1ll << i;
if(f&X){
bin[i] = 1;
}
else{
bin[i] = 0;
}
}
int c = 0;
for( int i = 0; i < N; i++ ){
if(bad.find(i) != bad.end()) Set(i,0);
else if(bad.find(i+1) != bad.end()) Set(i,0);
else{
if(c == 60){
Set(i,0);
}
Set(i,1);
Set(i+1,bin[c]);
c++;
i++;
}
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
long long Bruno( int N, int A[] ){
long long ans = 0ll;
int bin[60];
int c = 0;
for(int i = 0;i < N;i++){
if(A[i] == 0) continue;
else{
bin[c] = A[i+1];
c++;
i++;
}
}
for(int i = 59;i >= 0;i--){
ans *= 2ll;
ans += (long long) bin[i];
}
//cout << ans;
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |