답안 #1007609

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1007609 2024-06-25T09:20:18 Z nomuluun 앵무새 (IOI11_parrots) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
void encode(int N, int M[]){
    for(int i=0; i<n; i++){
        if(M[i]==1)send(i);
    }
}
#include<bits/stdc++.h>
using namespace std;
void decode(int N, int L, int X[]){
    bool b[N+5];
    for(int i=0; i<L; i++){
        b[X[i]]=1;
    }
    for(int i=0; i<N; i++){
        if(b[i]==1)output(1);
        else output(0);
    }
}

Compilation message

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:4:20: error: 'n' was not declared in this scope
    4 |     for(int i=0; i<n; i++){
      |                    ^
encoder.cpp:5:20: error: 'send' was not declared in this scope
    5 |         if(M[i]==1)send(i);
      |                    ^~~~

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:9:20: error: 'output' was not declared in this scope
    9 |         if(b[i]==1)output(1);
      |                    ^~~~~~
decoder.cpp:10:14: error: 'output' was not declared in this scope
   10 |         else output(0);
      |              ^~~~~~