Submission #691249

#TimeUsernameProblemLanguageResultExecution timeMemory
691249tengiz05Broken Device (JOI17_broken_device)C++17
41 / 100
48 ms2400 KiB
#include "Annalib.h" using i64 = long long; void Anna(int n, i64 X, int K, int P[] ){ bool bad[n] {}; for (int i = 0; i < K; i++) { bad[P[i]] = true; } int cur = 0; for (int i = 0; i < n; i += 2) { if (!bad[i] && !bad[i + 1]) { Set(i, 1); Set(i + 1, X >> cur & 1); cur++; } else { Set(i, 0); Set(i + 1, 0); } } }
#include "Brunolib.h" #include <iostream> using i64 = long long; long long Bruno( int n, int A[] ){ i64 res = 0; int cur = 0; for (int i = 0; i < n; i += 2) { if (A[i]) { res |= (1LL << cur) * A[i + 1]; cur++; } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...