Submission #310985

#TimeUsernameProblemLanguageResultExecution timeMemory
310985peuchBroken Device (JOI17_broken_device)C++17
0 / 100
2 ms1032 KiB
#include "Annalib.h" #include<bits/stdc++.h> using namespace std; void Anna(int N, long long X, int K, int P[]){ int marc[N + 10]; memset(marc, 0, sizeof(marc)); for(int i = 0; i < K; i++) marc[P[i]] = 1; int it1 = 60, it2 = N - 1; for(; it1 >= 0; it1--){ while((marc[it2] || (marc[it2 - 1] && (1LL << ((long long)it1)))) && it2 > 1) { Set(it2, 0); it2--; } Set(it2, 1); it2--; if((1LL << ((long long)it1)) & X) Set(it2, 1); else Set(it2, 0); it2--; } while(it2 >= 0){ Set(it2, 0); it2--; } return; }
#include "Brunolib.h" #include<bits/stdc++.h> using namespace std; long long Bruno(int N, int A[]){ int it1 = 60, it2 = N - 1; long long ret = 0; for(; it2 > 0; it2--){ if(A[it2]){ it2--; ret |= ((long long) A[it2]) << (long long)it1; it1--; } if(it1 < 0) break; } return ret; }

Compilation message (stderr)

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:16:46: warning: '<<' in boolean context, did you mean '<' ? [-Wint-in-bool-context]
   16 |   while((marc[it2] || (marc[it2 - 1] && (1LL << ((long long)it1)))) && it2 > 1) {
      |                                         ~~~~~^~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...