제출 #1142347

#제출 시각아이디문제언어결과실행 시간메모리
1142347aarb_.tomatexdParrots (IOI11_parrots)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "encoder.h" #include "encoderlib.h" void encode(int N, vector<int>M){ int bin = 0; int ex = 1; for(int i=0;i<N;i++){ if(m[i] == 0){ ex*= 2; }else{ bin += ex; ex *= 2; } } send(bin); }
#include <bits/stdc++.h> #include "decoder.h" #include "decoderlib.h" using namespace std; #define ll long long void decode(int N, int L, vector<int>X){ int i, b; //L = 1;, n = 8, for(int i=0;i<L;i++){ int a = X[i]; int xd = 128; while(a > 0){ if(a >= xd){ a -= xd; xd /= 2; output(1); }else{ xd /= 2; output(0); } } } }

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

# 1번째 컴파일 단계

encoder.cpp:5:20: error: 'vector' has not been declared
    5 | void encode(int N, vector<int>M){
      |                    ^~~~~~
encoder.cpp:5:26: error: expected ',' or '...' before '<' token
    5 | void encode(int N, vector<int>M){
      |                          ^
encoder.cpp: In function 'void encode(int, int)':
encoder.cpp:9:12: error: 'm' was not declared in this scope
    9 |         if(m[i] == 0){
      |            ^