# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
340978 | rqi | Broken Device (JOI17_broken_device) | C++14 | 36 ms | 3384 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;
typedef long long ll;
typedef vector<int> vi;
vi res(150, 0);
bool bad[150];
void Anna( int N, ll _X, int K, int P[] ){
bitset<60> X = bitset<60>(_X);
for(int i = 0; i < K; i++){
bad[P[i]] = 1;
}
bool frontbad = 0;
for(int i = 0; i < 60; i++){
if(bad[i]) frontbad = 1;
}
if(!frontbad){
for(int i = 0; i < 60; i++){
res[i] = X[i];
}
}
else{
for(int i = 0; i < 60; i++){
res[90+i] = X[i];
}
}
for(int i = 0; i < N; i++){
Set(i, res[i]);
cout << res[i];
}
cout << "\n";
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
long long Bruno( int N, int A[] ){
bool frontbad = 1;
for(int i = 0; i < 60; i++){
if(A[i] == 1) frontbad = 0;
}
bitset<60> X;
if(!frontbad){
for(int i = 0; i < 60; i++){
X[i] = A[i];
}
}
else{
for(int i = 0; i < 60; i++){
X[i] = A[90+i];
}
}
cout << ll(X.to_ulong()) << "\n";
return ll(X.to_ulong());
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |