제출 #1007796

#제출 시각아이디문제언어결과실행 시간메모리
1007796Faggi앵무새 (IOI11_parrots)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std;void encode(int N, int M[]){ int i; for(i=0; i<N; i++) { send((M[i]<<5)|(i+1));} }void decode(int N, int L, int X[]){ int i, b,val; vector<int>v(N,1); for(i=0; i<L; i++) { b = X[i]; if(b<=N) v[b-1]=0; } for(auto k:v) { output(k); } }

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

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:2:84: error: 'send' was not declared in this scope
    2 | using namespace std;void encode(int N, int M[]){  int i;  for(i=0; i<N; i++)  {    send((M[i]<<5)|(i+1));}  }void decode(int N, int L, int X[]){  int i, b,val;  vector<int>v(N,1);  for(i=0; i<L; i++) {    b = X[i];    if(b<=N)    v[b-1]=0;  }  for(auto k:v)  {  output(k); }  }
      |                                                                                    ^~~~
encoder.cpp: In function 'void decode(int, int, int*)':
encoder.cpp:2:263: error: 'output' was not declared in this scope
    2 | using namespace std;void encode(int N, int M[]){  int i;  for(i=0; i<N; i++)  {    send((M[i]<<5)|(i+1));}  }void decode(int N, int L, int X[]){  int i, b,val;  vector<int>v(N,1);  for(i=0; i<L; i++) {    b = X[i];    if(b<=N)    v[b-1]=0;  }  for(auto k:v)  {  output(k); }  }
      |                                                                                                                                                                                                                                                                       ^~~~~~
encoder.cpp:2:156: warning: unused variable 'val' [-Wunused-variable]
    2 | using namespace std;void encode(int N, int M[]){  int i;  for(i=0; i<N; i++)  {    send((M[i]<<5)|(i+1));}  }void decode(int N, int L, int X[]){  int i, b,val;  vector<int>v(N,1);  for(i=0; i<L; i++) {    b = X[i];    if(b<=N)    v[b-1]=0;  }  for(auto k:v)  {  output(k); }  }
      |                                                                                                                                                            ^~~

/usr/bin/ld: /tmp/ccHUyHIX.o: in function `main':
grader_decoder.cpp:(.text.startup+0x1ef): undefined reference to `decode(int, int, int*)'
collect2: error: ld returned 1 exit status