Submission #718381

#TimeUsernameProblemLanguageResultExecution timeMemory
718381ThegeekKnight16Broken Device (JOI17_broken_device)C++17
8 / 100
38 ms2636 KiB
#include <bits/stdc++.h> #include "Annalib.h" using namespace std; void Anna( int N, long long X, int K, int P[] ) { // cerr << N << '\n'; vector<bool> Marc(N); for (int i = 0; i < K; i++) Marc[P[i]] = 1; int atual = 60; for(int i = 0; i < N; i += 2) { if (Marc[i] || Marc[i+1] || atual < 0) { // cerr << "Seta " << i << " e " << i+1 << " para 0" << '\n'; Set(i, 0); Set(i+1, 0); } else { int aux = ((bool)(X & (1LL << atual))); // cerr << "Seta " << i << " para 1 e " << i+1 << " para " << aux << '\n'; Set(i, 1); Set(i+1, aux); --atual; } } }
#include <bits/stdc++.h> #include "Brunolib.h" using namespace std; long long Bruno( int N, int A[] ) { long long resp = 0; for (int i = 0; i < N; i += 2) { if (A[i]) { // cerr << "Adiciona " << A[i+1] << '\n'; resp <<= 1LL; resp |= A[i+1]; } } return resp; }
#Verdict Execution timeMemoryGrader output
Fetching results...