# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
100031 | 2019-03-09T06:52:20 Z | oolimry | Broken Device (JOI17_broken_device) | C++14 | 0 ms | 0 KB |
#include "Annalib.h" void Anna( int N, long long X, int K, int P[] ){ set<int> bad; for(int i = 0;i < K;i++){ bad.insert(P[i]); } int bin[60]; for(int i = 0;i < 60;i++){ long long f = 1ll << i; if(f&X){ bin[i] = 1; } else{ bin[i] = 0; } } int c = 0; for( int i = 0; i < N; i++ ){ if(bad.find(i) != bad.end()) Set(i,0); else if(bad.find(i+1) != bad.end()) Set(i,0); else{ if(c == 60){ Set(i,0); } Set(i,1); Set(i+1,bin[c]); c++; i++; } } }