Submission #1063168

#TimeUsernameProblemLanguageResultExecution timeMemory
1063168UnforgettableplBroken Device (JOI17_broken_device)C++17
Compilation error
0 ms0 KiB
#include "Annalib.h" #include <bits/stdc++.h> using namespace std; void Anna(int N, long long X, int K, int P[]){ vector<bool> bad(N); for(int i=0;i<K;i++)bad[P[i]]=true; int bit = 0; for(int i=0;i<N;i++) { if(bad[i] or bit==60){Set(i,0);continue;} if(X&(1ll<<bit) and bad[i+1])continue; Set(i,1); Set(i+1,min(1ll,X&(1ll<<bit))); i++;bit++; } }
#include "Brunolib.h" #include <bits/stdc++.h> using namespace std; long long Bruno(int N, int A[]) { vector<bool> bad(N); for(int i=0;i<K;i++)bad[P[i]]=true; int bit = 0; long long X = 0; for(int i=0;i<N;i++) { if(A[i]==0 or bit==60)continue; if(A[i+1])X|=(1ll<<bit); i++;bit++; } }

Compilation message (stderr)

Bruno.cpp: In function 'long long int Bruno(int, int*)':
Bruno.cpp:7:19: error: 'K' was not declared in this scope
    7 |     for(int i=0;i<K;i++)bad[P[i]]=true;
      |                   ^
Bruno.cpp:7:29: error: 'P' was not declared in this scope
    7 |     for(int i=0;i<K;i++)bad[P[i]]=true;
      |                             ^
Bruno.cpp:15:1: warning: no return statement in function returning non-void [-Wreturn-type]
   15 | }
      | ^