제출 #225688

#제출 시각아이디문제언어결과실행 시간메모리
225688davitmarg앵무새 (IOI11_parrots)C++17
컴파일 에러
0 ms0 KiB
/*DavitMarg*/ #include <iostream> #include <cstdio> #include <algorithm> #include <cmath> #include <vector> #include <string> #include <cstring> #include <list> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <queue> #include <iomanip> #include <bitset> #include <stack> #include <cassert> #include <iterator> #include <fstream> #define mod 1000000007ll #define LL long long #define LD long double #define MP make_pair #define PB push_back #define all(v) v.begin(), v.end() using namespace std; #ifndef death #include "encoder.h" #include "encoderlib.h" #endif #ifdef death const int N = 100; int X[N], L; void send(int a) { X[L++] = a; cout << "!send " << a << endl; } void output(int a) { cout << "!output " << a << endl; } #endif // death void encode(int n, int x[]) { for (int i = 0; i < n; i++) for (int j = 0; j < 8; j++) if ((1 << j) & x[i]) send(i * 8 + j); } void decode(int n,int l,int x[]) { vector<int> res(n); for (int i = 0; i < l; i++) { int pos = x[i] / 8; int add = x[i] % 8; res[pos] += (1 << add); } for (int i = 0; i < n; i++) output(res[i]); } #ifdef death int main() { int nn, xx[N]; cin >> nn; for (int i = 0; i < nn; i++) cin >> xx[i]; encode(nn, xx); decode(nn, L, X); return 0; } #endif /* */

컴파일 시 표준 에러 (stderr) 메시지

encoder.cpp: In function 'void decode(int, int, int*)':
encoder.cpp:77:3: error: 'output' was not declared in this scope
   output(res[i]);
   ^~~~~~
encoder.cpp:77:3: note: suggested alternative: 'getpt'
   output(res[i]);
   ^~~~~~
   getpt

/tmp/ccQBdKKz.o: In function `main':
grader_decoder.cpp:(.text.startup+0x1f6): undefined reference to `decode(int, int, int*)'
collect2: error: ld returned 1 exit status