Submission #704324

#TimeUsernameProblemLanguageResultExecution timeMemory
704324bin9638Parrots (IOI11_parrots)C++17
Compilation error
0 ms0 KiB
#ifndef SKY #include "encoder.h" #include "encoderlib.h" #endif // SKY #include <bits/stdc++.h> using namespace std; #ifdef SKY vector<int> tokens; void send(int x) { tokens.push_back(x); } #endif // SKY void encode(int N, int M[]) { for(int i=0;i<N;i++) send((i<<8)+M[i]); } #ifdef SKY int main(void) { freopen("ENCODE.inp","r",stdin); freopen("ENCODE.out","w",stdout); srand(time(0)); int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; encode(n, a); cout << n << endl; cout << tokens.size() << endl; for (int x : tokens) cout << x << " " ; cout << endl; return 0; } #endif // SKY
#ifndef SKY #include "encoder.h" #include "encoderlib.h" #endif // SKY #include <bits/stdc++.h> using namespace std; #ifdef SKY vector<int> tokens; void output(int b) { cout<<b<<" "; } #endif // SKY void decode(int n, int l,int X[]) { int kq[n]; for(int i=0; i<l; i++) kq[X[i]>>8]=(X[i]&((1<<8)-1)); for(int i=0;i<n;i++) output(kq[i]); } #ifdef SKY int main(void) { freopen("DECODE.inp","r",stdin); freopen("DECODE.out","w",stdout); int n,l; cin>>n>>l; int a[l]; for(int i=0;i<l;i++) cin>>a[i]; decode(n,l,a); return 0; } #endif // SKY

Compilation message (stderr)

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:19:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   19 |   for(int i=0; i<l; i++)
      |   ^~~
decoder.cpp:21:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   21 |     for(int i=0;i<n;i++)
      |     ^~~
decoder.cpp:22:9: error: 'output' was not declared in this scope
   22 |         output(kq[i]);
      |         ^~~~~~