Submission #999080

#TimeUsernameProblemLanguageResultExecution timeMemory
999080AdamGSBroken Device (JOI17_broken_device)C++17
61 / 100
32 ms2676 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()&1) 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<n && (akt%2!=a || czy[akt])) ++akt; if(akt==n) break; 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()&1) x^=1ll<<(ll)i; return x; }
#Verdict Execution timeMemoryGrader output
Fetching results...