# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
100871 | Pro_ktmr | Broken Device (JOI17_broken_device) | C++14 | 2066 ms | 384 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;
int now = 0;
int cnt = 0;
for(int i=0; i+1<N; i++){
if(canUse[i] && canUse[i+1]){
Set(i, 1);
Set(i+1, (X>>now)%2);
cnt += 2;
i++;
now++;
}
else if(canUse[i] && (X>>now)%2 == 0){
Set(i, 1);
Set(i+1, 0);
cnt+= 2;
i++;
now++;
}
else{
Set(i, 0);
cnt += 1;
if(i == N-2){
Set(N-1, 0);
cnt += 1;
}
}
}
while(cnt < N){
}
}
#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[]){
long long ans;
int now = 0;
for(int i=0; i+1<N; i++){
if(A[i] == 1){
ans += A[i+1]<<now;
i++;
now++;
}
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |