# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
954862 | 2024-03-28T18:13:07 Z | leo_2727 | Broken Device (JOI17_broken_device) | C++17 | 0 ms | 0 KB |
#include <bits/stdc++.h> #include <Annalib.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; void Anna( int N, ll X, int K, int P[] ){ vi ar(N, 0); ll curr=0; for(int i=0;i<K;i++) ar[P[i]]=-1; int i; for(i=0;i+2<N;i++){ if(ar[i]!=0 && ar[i+1]!=0 && ar[i+2]!=0){ Set( i 0 ); break; } Set( i, 1 ); ll b1=X & ((ll)1<<curr); curr++; ll b2=X & ((ll)1<<curr); curr++; (b1>0) ? Set( i+1, 1 ) : Set( 1+1, 0 ); (b2>0) ? Set( i+2, 1 ) : Set( 1+2, 0 ); i+=2; if(curr>62) break; } for(;i<N;i++) Set( i, 0 ); }