Submission #199139

#TimeUsernameProblemLanguageResultExecution timeMemory
199139godwindParrots (IOI11_parrots)C++14
Compilation error
0 ms0 KiB
void pre() { base[0] = 1; for (int i = 1; i < 9; ++i) { base[i] = base[i - 1] * 10; } } int len(int x) { if (x == 0) return 1; int l = 0; while (x) { x /= 10; ++l; } return l; } void encode(int n, int M[]) { pre(); for (int i = 0; i < n; ++i) { int x = i * base[3] + M[i]; send(x); } }
int ans[1000]; // void output(int x) { // cout << x << endl; // } void decode(int n, int L, int X[]) { for (int i = 0; i < L; ++i) { int x = X[i] % 1000; X[i] /= 1000; int id = X[i]; ans[id] = x; } for (int i = 0; i < n; ++i) { output(ans[i]); } }

Compilation message (stderr)

encoder.cpp: In function 'void pre()':
encoder.cpp:3:2: error: 'base' was not declared in this scope
  base[0] = 1;
  ^~~~
encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:21:15: error: 'base' was not declared in this scope
   int x = i * base[3] + M[i];
               ^~~~
encoder.cpp:22:3: error: 'send' was not declared in this scope
   send(x);
   ^~~~
encoder.cpp:22:3: note: suggested alternative: 'len'
   send(x);
   ^~~~
   len

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:16:3: error: 'output' was not declared in this scope
   output(ans[i]);
   ^~~~~~