# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1063170 | Unforgettablepl | Broken Device (JOI17_broken_device) | C++17 | 1 ms | 1052 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[]){
vector<bool> bad(N);
for(int i=0;i<K;i++)bad[P[i]]=true;
int bit = 0;
for(int i=0;i<N;i++) {
if(bad[i] or bit==60){Set(i,0);continue;}
if(X&(1ll<<bit) and bad[i+1])continue;
Set(i,1);
Set(i+1,min(1ll,X&(1ll<<bit)));
i++;bit++;
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
long long Bruno(int N, int A[]) {
int bit = 0;
long long X = 0;
for(int i=0;i<N;i++) {
if(A[i]==0 or bit==60)continue;
if(A[i+1])X|=(1ll<<bit);
i++;bit++;
}
return X;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |