# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
313385 | bigg | Broken Device (JOI17_broken_device) | C++14 | 50 ms | 3328 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>
#include "Annalib.h"
using namespace std;
typedef long long ll;
void Anna( int N, long long X, int K, int P[] ){
int marc[200], isbit[200];
memset(marc, 0, sizeof(marc));
memset(isbit, 0, sizeof(isbit));
int itlista = 0;
for(int i = 0; i < K; i++) marc[P[i]] = 1;
for(ll itreal = 0; itreal <= 60; itreal++){
while((marc[itlista] || marc[itlista + 1]) && itlista < N - 2) itlista++;
isbit[itlista] = 1;
itlista++;
if(itlista > N - 1) break;
isbit[itlista] = ((1LL<<itreal) & X) ? 1 : 0;
//printf("%d\n", itlista );
itlista++;
if(itlista > N-1) break;
}
for(int i = 0; i < N; i++) Set(i, isbit[i]);
}
#include "Brunolib.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
long long Bruno( int N, int A[] ){
ll itreal = 0;
ll resp = 0;
for(int ilista = 0; ilista < N - 1&& itreal <= 60; ilista++ ){
if(!A[ilista]) continue;
ilista++;
//printf("%d %d\n",ilista, A[ilista] );
resp |= ((long long) A[ilista] << itreal);
itreal++;
}
return resp;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |