# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
999069 | AdamGS | Broken Device (JOI17_broken_device) | C++17 | 8 ms | 1884 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;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
void Anna(int n, ll x, int k, int P[]) {
mt19937 rng(2137);
rep(i, 60) if(rng()%2) x^=1ll<<(ll)i;
vector<int>czy(n), T(n);
rep(i, k) czy[P[i]]=1;
ll akt=0;
rep(i, 60) {
ll a=0;
if(x&(1ll<<(ll)i)) a=1;
while(akt%2!=a || czy[akt]) ++akt;
T[akt]=1;
++akt;
}
rep(i, n) Set(i, T[i]);
}
#include "Brunolib.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
ll Bruno(int n, int A[]) {
ll x=0, p=0;
rep(i, n) if(A[i]) {
if(i%2==1) x|=1ll<<(ll)p;
++p;
}
mt19937 rng(2137);
rep(i, 60) if(rng()%2) x^=1ll<<(ll)i;
return x;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |