Submission #131568

#TimeUsernameProblemLanguageResultExecution timeMemory
131568Osama_AlkhodairyBroken Device (JOI17_broken_device)C++17
0 / 100
5 ms1008 KiB
#include <bits/stdc++.h> #include "Annalib.h" using namespace std; void Anna( int N, long long X, int K, int P[] ){ vector <int> p; for(int i = 0 ; i < K ; i++){ p.push_back(P[i]); } int ind = 0; for(int i = 59 ; i >= 0 ; i--){ if(count(p.begin(), p.end(), ind + 1)) Set(ind++, 0); while(count(p.begin(), p.end(), ind)) Set(ind++, 0); Set(ind, 1); ind++; Set(ind, (X >> i) & 1); ind++; } while(ind < N) Set(ind++, 0); }
#include <bits/stdc++.h> #include "Brunolib.h" using namespace std; #define ll long long long long Bruno( int N, int A[] ){ ll ret = 0; for(int i = 0 ; i < N ; i += 2){ if(A[i] == 0 && A[i + 1] == 0) continue; ret = ret * 2 + A[i + 1]; } return ret; }
#Verdict Execution timeMemoryGrader output
Fetching results...