# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
530480 | byunjaewoo | Broken Device (JOI17_broken_device) | C++17 | 36 ms | 2428 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;
bool chk[155];
void Anna( int N, long long X, int K, int P[] ){
for(int i=0; i<K; i++) chk[P[i]]=true;
vector<int> V;
while(X) {
V.push_back(X%2);
X/=2;
}
for(int i=0, p=0; i<150; i+=2) {
if(chk[i] || chk[i+1] || p>=V.size()) {
Set(i, 0); Set(i+1, 0); continue;
}
if(V[p]==0) {
Set(i, 1); Set(i+1, 1);
}
else {
Set(i, 1); Set(i+1, 0);
}
}
}
#include <bits/stdc++.h>
using namespace std;
#include "Brunolib.h"
long long Bruno( int N, int A[] ){
long long x=0;
for(int i=N-1; i>=0; i-=2) {
if(!A[i] && !A[i-1]) continue;
x*=2; x+=(A[i]^A[i-1]);
}
return x;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |