# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
100876 | Pro_ktmr | Broken Device (JOI17_broken_device) | C++14 | 63 ms | 3312 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"
using namespace std;
#define LL long long
#define MP make_pair
#include"Annalib.h"
//void Set(int pos, int bit)
//N=150
void Anna(int N, long long X, int K, int P[]){
bool canUse[150];
for(int i=0; i<N; i++) canUse[i] = true;
for(int i=0; i<K; i++) canUse[P[i]] = false;
LL now = 0;
for(int i=0; i<N; i++){
if(i+1 < N && now < 60 && canUse[i] && canUse[i+1]){
Set(i, 1);
Set(i+1, (X>>now)%2);
i++;
now++;
}
else if(i+1 < N && now < 60 && canUse[i] && (X>>now)%2 == 0){
Set(i, 1);
Set(i+1, 0);
i++;
now++;
}
else{
Set(i, 0);
}
}
}
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define MP make_pair
#include"Brunolib.h"
long long Bruno(int N, int A[]){
LL ans = 0;
LL now = 0;
for(int i=0; i+1<N; i++){
if(A[i] == 1){
ans += ((LL)(A[i+1])<<now);
i++;
now++;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |