제출 #246106

#제출 시각아이디문제언어결과실행 시간메모리
246106luisoncpp앵무새 (IOI11_parrots)C++17
컴파일 에러
0 ms0 KiB
#include <algorithm> #include <iostream> #include <vector> #include <cstdint> #include <cstdlib> #include <cassert> #include <queue> #include <unordered_map> template<typename T> using Vec = std::vector<T>; void encode(int N, int* message) { int out = 0; for (int i = 0; i < N; ++i) { if (message[i] == 1) { out |= (1<<i); } } send(out); }
#include <algorithm> #include <iostream> #include <vector> #include <cstdint> #include <cstdlib> #include <cassert> #include <queue> #include <unordered_map> template<typename T> using Vec = std::vector<T>; void decode(int N, int L, int* X) { int x = X[0]; for (int i = 0; i < N; ++i) { if (x & (1<<i)) { output(1); } else { output(0); } } }

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

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:20:2: error: 'send' was not declared in this scope
  send(out);
  ^~~~
encoder.cpp:20:2: note: suggested alternative: 'setns'
  send(out);
  ^~~~
  setns

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:17:4: error: 'output' was not declared in this scope
    output(1);
    ^~~~~~
decoder.cpp:17:4: note: suggested alternative: 'getpt'
    output(1);
    ^~~~~~
    getpt
decoder.cpp:19:4: error: 'output' was not declared in this scope
    output(0);
    ^~~~~~
decoder.cpp:19:4: note: suggested alternative: 'getpt'
    output(0);
    ^~~~~~
    getpt