Submission #999069

#TimeUsernameProblemLanguageResultExecution timeMemory
999069AdamGSBroken Device (JOI17_broken_device)C++17
0 / 100
8 ms1884 KiB
#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 timeMemoryGrader output
Fetching results...