# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
313380 | 2020-10-15T22:49:06 Z | ly20 | Broken Device (JOI17_broken_device) | C++17 | 0 ms | 0 KB |
#include "Annalib.h" void Anna( int N, long long X, int K, int P[] ){ bool rs[200], marc[200]; int n = N, k = K; for(int i = 0; i < n; i++) { rs[i] = 0; } for(int i = 0; i < k; i++) { marc[P[i]] = 1; } int pot = 59; for(int i = 0; i < n - 1; i++) { if(pot < 0) break; if(marc[i] = 0 && marc[i + 1] == 0) { rs[i] = 1; if((1LL << pot) & X) rs[i + 1] = 1; else rs[i + 1] = 0; i++; pot--; } } for( int i = 0; i < N; i++ ){ Set( i, rs[i] ); } }