# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
118310 | MAMBA | 앵무새 (IOI11_parrots) | C++17 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "encoder.h"
#include <bits/stdc++.h>
#include "encoderlib.h"
using namespace std;
#define rep(i, j, k) for (int i = j; i < (int)k; i++)
typedef long long ll;
constexpr int N = 150 * 1000 + 10;
const int LEN = (1 << 9);
typedef array<int, LEN> sagy;
sagy operator+(sagy l, sagy r) {
sagy res;
bool cary = false;
rep(i, 0, LEN) {
ll tmp = 1ll * l[i] + r[i] + (cary ? 1 : 0);
res[i] = tmp & ((1l << 32) - 1);
cary = tmp >> 32;
}
assert(!cary);
return res;
}
bool operator<(sagy l, sagy r) {
for (int i = LEN - 1; ~i; i--) {
int tmp = l[i] ^ r[i];
if (tmp) {
for (int j = 31;; j--) {
if ((tmp >> j) & 1) return (r >> j) & 1;
}
}
}
return false;
}
const int L = 257;
const int R = L + 64 * 5;
sagy c[L][R];
inline void init() {
rep(i, 0, R) {
c[0][i][0] = true;
if (i < L) c[i][i][0] = true;
rep(j, 1, min(i, L)) c[j][i] = c[j - 1][i - 1] + c[j][i - 1];
}
}
int cnt[L];
void encode(int N, int M[]) {
init();
return;
sagy code;
rep(i, 0, N) rep(j, 0, 8) code[(i << 3) + j] = (M[i] >> j) & 1;
sagy ta_hala;
int have = 5 * N;
for (int i = 255; ~i; i--) {
while (true) {
sagy ta_alan = ta_hala;
have--;
cnt[i]++;
ta_alan = ta_alan + c[i][have + i];
if (code < ta_alan) {
have++;
cnt[i]--;
break;
}
ta_hala = ta_alan;
}
}
rep(i, 0, 256) rep(j, 0, cnt[i]) send(i);
}
#include "decoder.h"
#include <bits/stdc++.h>
#include "decoderlib.h"
using namespace std;
#define rep(i, j, k) for (int i = j; i < (int)k; i++)
typedef long long ll;
constexpr int N = 150 * 1000 + 10;
const int LEN = (1 << 9);
typedef array<int , LEN> sagy;
sagy operator+(sagy l, sagy r) {
sagy res;
bool cary = false;
rep(i, 0, LEN) {
ll tmp = 1ll * l[i] + r[i] + (cary ? 1: 0);
res[i] = tmp & ((1l << 32) - 1);
cary = tmp >> 32;
}
assert(!cary);
return res;
}
bool operator<(sagy l, sagy r) {
for (int i = LEN - 1; ~i; i--) {
int tmp = l[i] ^ r[i];
if (tmp) {
for (int j = 31; ; j--) {
if ((tmp >> j) & 1)
return (r >> j) & 1;
}
}
}
return false;
}
const int L = 257;
const int R = L + 64 * 5;
sagy c[L][R];
inline void init() {
rep(i, 0, R) {
c[0][i][0] = true;
if (i < L) c[i][i][0] = true;
rep(j, 1, min(i, L)) c[j][i] = c[j - 1][i - 1] + c[j][i - 1];
}
}
int cnt[L];
void decode(int N, int L, int X[]) {
return;
init();
rep(i, 0, L) cnt[X[i]]++;
sagy code;
int have = 5 * N;
for (int i = 255; ~i; i--) {
while (cnt[i] > 1) {
code = code + c[i][have + i];
have--;
cnt[i]--;
}
have--;
}
code = code + c[0][0];
rep(i, 0, N) {
int res = 0;
rep(j, 0, 8) if (code[(i << 3) + j]) res += (1 << j);
output(res);
}
}
컴파일 시 표준 에러 (stderr) 메시지
encoder.cpp: In function 'bool operator<(sagy, sagy)': encoder.cpp:34:39: error: no match for 'operator>>' (operand types are 'sagy {aka std::array<int, 512>}' and 'int') if ((tmp >> j) & 1) return (r >> j) & 1; ~~^~~~ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:45:0, from encoder.cpp:2: /usr/include/c++/7/cstddef:134:5: note: candidate: template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(std::byte, _IntegerType) operator>>(byte __b, _IntegerType __shift) noexcept ^~~~~~~~ /usr/include/c++/7/cstddef:134:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: cannot convert 'r' (type 'sagy {aka std::array<int, 512>}') to type 'std::byte' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/c++/7/string:53:0, from /usr/include/c++/7/bits/locale_classes.h:40, from /usr/include/c++/7/bits/ios_base.h:41, from /usr/include/c++/7/ios:42, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from encoder.cpp:2: /usr/include/c++/7/bits/basic_string.tcc:1465:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) operator>>(basic_istream<_CharT, _Traits>& __in, ^~~~~~~~ /usr/include/c++/7/bits/basic_string.tcc:1465:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/c++/7/istream:991:0, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from encoder.cpp:2: /usr/include/c++/7/bits/istream.tcc:963:5: note: candidate: template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*) operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) ^~~~~~~~ /usr/include/c++/7/bits/istream.tcc:963:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/c++/7/istream:991:0, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from encoder.cpp:2: /usr/include/c++/7/bits/istream.tcc:931:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&) operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) ^~~~~~~~ /usr/include/c++/7/bits/istream.tcc:931:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/c++/7/sstream:38:0, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from encoder.cpp:2: /usr/include/c++/7/istream:756:5: note: candidate: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&) operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) ^~~~~~~~ /usr/include/c++/7/istream:756:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<char, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/c++/7/sstream:38:0, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from encoder.cpp:2: /usr/include/c++/7/istream:761:5: note: candidate: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&) operator>>(basic_istream<char, _Traits>& __in, signed char& __c) ^~~~~~~~ /usr/include/c++/7/istream:761:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<char, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/c++/7/sstream:38:0, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from encoder.cpp:2: /usr/include/c++/7/istream:803:5: note: candidate: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*) operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) ^~~~~~~~ /usr/include/c++/7/istream:803:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<char, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/c++/7/sstream:38:0, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from encoder.cpp:2: /usr/include/c++/7/istream:808:5: note: candidate: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*) operator>>(basic_istream<char, _Traits>& __in, signed char* __s) ^~~~~~~~ /usr/include/c++/7/istream:808:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<char, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/c++/7/sstream:38:0, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from encoder.cpp:2: /usr/include/c++/7/istream:980:5: note: candidate: template<class _Istream, class _Tp> typename std::enable_if<std::__and_<std::__not_<std::is_lvalue_reference<_Tp> >, std::__is_convertible_to_basic_istream<_Istream>, std::__is_extractable<typename std::__is_convertible_to_basic_istream<_Tp>::__istream_type, _Tp&&, void> >::value, typename std::__is_convertible_to_basic_istream<_Tp>::__istream_type>::type std::operator>>(_Istream&&, _Tp&&) operator>>(_Istream&& __is, _Tp&& __x) ^~~~~~~~ /usr/include/c++/7/istream:980:5: note: template argument deduction/substitution failed: /usr/include/c++/7/istream: In substitution of 'template<class _Istream, class _Tp> typename std::enable_if<std::__and_<std::__not_<std::is_lvalue_reference<_Tp> >, std::__is_convertible_to_basic_istream<_Istream>, std::__is_extractable<typename std::__is_convertible_to_basic_istream<_Tp>::__istream_type, _Tp&&, void> >::value, typename std::__is_convertible_to_basic_istream<_Tp>::__istream_type>::type std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::array<int, 512>&; _Tp = int&]': encoder.cpp:34:42: required from here /usr/include/c++/7/istream:980:5: error: no type named 'type' in 'struct std::enable_if<false, void>' In file included from /usr/include/c++/7/ccomplex:39:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from encoder.cpp:2: /usr/include/c++/7/complex:493:5: note: candidate: template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::complex<_Tp>&) operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) ^~~~~~~~ /usr/include/c++/7/complex:493:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:66:0, from encoder.cpp:2: /usr/include/c++/7/bitset:1462:5: note: candidate: template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::bitset<_Nb>&) operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) ^~~~~~~~ /usr/include/c++/7/bitset:1462:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:72:0, from encoder.cpp:2: /usr/include/c++/7/iomanip:71:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Resetiosflags) operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) ^~~~~~~~ /usr/include/c++/7/iomanip:71:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:72:0, from encoder.cpp:2: /usr/include/c++/7/iomanip:101:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setiosflags) operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) ^~~~~~~~ /usr/include/c++/7/iomanip:101:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:72:0, from encoder.cpp:2: /usr/include/c++/7/iomanip:132:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setbase) operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f) ^~~~~~~~ /usr/include/c++/7/iomanip:132:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:72:0, from encoder.cpp:2: /usr/include/c++/7/iomanip:170:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setfill<_CharT>) operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f) ^~~~~~~~ /usr/include/c++/7/iomanip:170:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:72:0, from encoder.cpp:2: /usr/include/c++/7/iomanip:200:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setprecision) operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f) ^~~~~~~~ /usr/include/c++/7/iomanip:200:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:72:0, from encoder.cpp:2: /usr/include/c++/7/iomanip:230:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setw) operator>>(basic_istream<_CharT, _Traits>& __is, _Setw __f) ^~~~~~~~ /usr/include/c++/7/iomanip:230:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:72:0, from encoder.cpp:2: /usr/include/c++/7/iomanip:264:5: note: candidate: template<class _CharT, class _Traits, class _MoneyT> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Get_money<_MoneyT>) operator>>(basic_istream<_CharT, _Traits>& __is, _Get_money<_MoneyT> __f) ^~~~~~~~ /usr/include/c++/7/iomanip:264:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:72:0, from encoder.cpp:2: /usr/include/c++/7/iomanip:418:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Get_time<_CharT>) operator>>(basic_istream<_CharT, _Traits>& __is, _Get_time<_CharT> __f) ^~~~~~~~ /usr/include/c++/7/iomanip:418:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/c++/7/valarray:592:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95, from encoder.cpp:2: /usr/include/c++/7/bits/valarray_after.h:411:5: note: candidate: template<class _Dom1, class _Dom2> std::_Expr<std::_BinClos<std::__shift_right, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__shift_right, typename _Dom1::value_type>::result_type> std::operator>>(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(>>, __shift_right) ^ /usr/include/c++/7/bits/valarray_after.h:411:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/c++/7/valarray:592:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95, from encoder.cpp:2: /usr/include/c++/7/bits/valarray_after.h:411:5: note: candidate: template<class _Dom> std::_Expr<std::_BinClos<std::__shift_right, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__shift_right, typename _Dom1::value_type>::result_type> std::operator>>(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&) _DEFINE_EXPR_BINARY_OPERATOR(>>, __shift_right) ^ /usr/include/c++/7/bits/valarray_after.h:411:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: 'sagy {aka std::array<int, 512>}' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' if ((tmp >> j) & 1) return (r >> j) & 1; ^ In file included from /usr/include/c++/7/valarray:592:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95, from encoder.cpp:2: /usr/include/c++/7/bits/valarray_after.h:411:5: note: candidate: template<class _Dom> std::_Expr<std::_BinClos<std::__shift_right, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__shift_right, typename _Dom1::value_type>::result_type> std::operator>>(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(>>, __shift_right) ^ /usr/include/c++/7/bits/valarray_after.h:411:5: note: template argument deduction/substitution failed: encoder.cpp:34:42: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' if ((tmp >> j) & 1) return decoder.cpp: In function 'bool operator<(sagy, sagy)': decoder.cpp:36:23: error: no match for 'operator>>' (operand types are 'sagy {aka std::array<int, 512>}' and 'int') return (r >> j) & 1; ~~^~~~ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:45:0, from decoder.cpp:2: /usr/include/c++/7/cstddef:134:5: note: candidate: template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(std::byte, _IntegerType) operator>>(byte __b, _IntegerType __shift) noexcept ^~~~~~~~ /usr/include/c++/7/cstddef:134:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: cannot convert 'r' (type 'sagy {aka std::array<int, 512>}') to type 'std::byte' return (r >> j) & 1; ^ In file included from /usr/include/c++/7/string:53:0, from /usr/include/c++/7/bits/locale_classes.h:40, from /usr/include/c++/7/bits/ios_base.h:41, from /usr/include/c++/7/ios:42, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from decoder.cpp:2: /usr/include/c++/7/bits/basic_string.tcc:1465:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) operator>>(basic_istream<_CharT, _Traits>& __in, ^~~~~~~~ /usr/include/c++/7/bits/basic_string.tcc:1465:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/c++/7/istream:991:0, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from decoder.cpp:2: /usr/include/c++/7/bits/istream.tcc:963:5: note: candidate: template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*) operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) ^~~~~~~~ /usr/include/c++/7/bits/istream.tcc:963:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/c++/7/istream:991:0, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from decoder.cpp:2: /usr/include/c++/7/bits/istream.tcc:931:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&) operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) ^~~~~~~~ /usr/include/c++/7/bits/istream.tcc:931:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/c++/7/sstream:38:0, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from decoder.cpp:2: /usr/include/c++/7/istream:756:5: note: candidate: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&) operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) ^~~~~~~~ /usr/include/c++/7/istream:756:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<char, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/c++/7/sstream:38:0, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from decoder.cpp:2: /usr/include/c++/7/istream:761:5: note: candidate: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&) operator>>(basic_istream<char, _Traits>& __in, signed char& __c) ^~~~~~~~ /usr/include/c++/7/istream:761:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<char, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/c++/7/sstream:38:0, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from decoder.cpp:2: /usr/include/c++/7/istream:803:5: note: candidate: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*) operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) ^~~~~~~~ /usr/include/c++/7/istream:803:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<char, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/c++/7/sstream:38:0, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from decoder.cpp:2: /usr/include/c++/7/istream:808:5: note: candidate: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*) operator>>(basic_istream<char, _Traits>& __in, signed char* __s) ^~~~~~~~ /usr/include/c++/7/istream:808:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<char, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/c++/7/sstream:38:0, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from decoder.cpp:2: /usr/include/c++/7/istream:980:5: note: candidate: template<class _Istream, class _Tp> typename std::enable_if<std::__and_<std::__not_<std::is_lvalue_reference<_Tp> >, std::__is_convertible_to_basic_istream<_Istream>, std::__is_extractable<typename std::__is_convertible_to_basic_istream<_Tp>::__istream_type, _Tp&&, void> >::value, typename std::__is_convertible_to_basic_istream<_Tp>::__istream_type>::type std::operator>>(_Istream&&, _Tp&&) operator>>(_Istream&& __is, _Tp&& __x) ^~~~~~~~ /usr/include/c++/7/istream:980:5: note: template argument deduction/substitution failed: /usr/include/c++/7/istream: In substitution of 'template<class _Istream, class _Tp> typename std::enable_if<std::__and_<std::__not_<std::is_lvalue_reference<_Tp> >, std::__is_convertible_to_basic_istream<_Istream>, std::__is_extractable<typename std::__is_convertible_to_basic_istream<_Tp>::__istream_type, _Tp&&, void> >::value, typename std::__is_convertible_to_basic_istream<_Tp>::__istream_type>::type std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::array<int, 512>&; _Tp = int&]': decoder.cpp:36:26: required from here /usr/include/c++/7/istream:980:5: error: no type named 'type' in 'struct std::enable_if<false, void>' In file included from /usr/include/c++/7/ccomplex:39:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from decoder.cpp:2: /usr/include/c++/7/complex:493:5: note: candidate: template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::complex<_Tp>&) operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) ^~~~~~~~ /usr/include/c++/7/complex:493:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:66:0, from decoder.cpp:2: /usr/include/c++/7/bitset:1462:5: note: candidate: template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::bitset<_Nb>&) operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) ^~~~~~~~ /usr/include/c++/7/bitset:1462:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:72:0, from decoder.cpp:2: /usr/include/c++/7/iomanip:71:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Resetiosflags) operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) ^~~~~~~~ /usr/include/c++/7/iomanip:71:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:72:0, from decoder.cpp:2: /usr/include/c++/7/iomanip:101:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setiosflags) operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) ^~~~~~~~ /usr/include/c++/7/iomanip:101:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:72:0, from decoder.cpp:2: /usr/include/c++/7/iomanip:132:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setbase) operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f) ^~~~~~~~ /usr/include/c++/7/iomanip:132:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:72:0, from decoder.cpp:2: /usr/include/c++/7/iomanip:170:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setfill<_CharT>) operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f) ^~~~~~~~ /usr/include/c++/7/iomanip:170:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:72:0, from decoder.cpp:2: /usr/include/c++/7/iomanip:200:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setprecision) operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f) ^~~~~~~~ /usr/include/c++/7/iomanip:200:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:72:0, from decoder.cpp:2: /usr/include/c++/7/iomanip:230:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setw) operator>>(basic_istream<_CharT, _Traits>& __is, _Setw __f) ^~~~~~~~ /usr/include/c++/7/iomanip:230:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:72:0, from decoder.cpp:2: /usr/include/c++/7/iomanip:264:5: note: candidate: template<class _CharT, class _Traits, class _MoneyT> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Get_money<_MoneyT>) operator>>(basic_istream<_CharT, _Traits>& __is, _Get_money<_MoneyT> __f) ^~~~~~~~ /usr/include/c++/7/iomanip:264:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:72:0, from decoder.cpp:2: /usr/include/c++/7/iomanip:418:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Get_time<_CharT>) operator>>(basic_istream<_CharT, _Traits>& __is, _Get_time<_CharT> __f) ^~~~~~~~ /usr/include/c++/7/iomanip:418:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'std::basic_istream<_CharT, _Traits>' return (r >> j) & 1; ^ In file included from /usr/include/c++/7/valarray:592:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95, from decoder.cpp:2: /usr/include/c++/7/bits/valarray_after.h:411:5: note: candidate: template<class _Dom1, class _Dom2> std::_Expr<std::_BinClos<std::__shift_right, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__shift_right, typename _Dom1::value_type>::result_type> std::operator>>(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(>>, __shift_right) ^ /usr/include/c++/7/bits/valarray_after.h:411:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' return (r >> j) & 1; ^ In file included from /usr/include/c++/7/valarray:592:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95, from decoder.cpp:2: /usr/include/c++/7/bits/valarray_after.h:411:5: note: candidate: template<class _Dom> std::_Expr<std::_BinClos<std::__shift_right, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__shift_right, typename _Dom1::value_type>::result_type> std::operator>>(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&) _DEFINE_EXPR_BINARY_OPERATOR(>>, __shift_right) ^ /usr/include/c++/7/bits/valarray_after.h:411:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: 'sagy {aka std::array<int, 512>}' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' return (r >> j) & 1; ^ In file included from /usr/include/c++/7/valarray:592:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95, from decoder.cpp:2: /usr/include/c++/7/bits/valarray_after.h:411:5: note: candidate: template<class _Dom> std::_Expr<std::_BinClos<std::__shift_right, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__shift_right, typename _Dom1::value_type>::result_type> std::operator>>(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(>>, __shift_right) ^ /usr/include/c++/7/bits/valarray_after.h:411:5: note: template argument deduction/substitution failed: decoder.cpp:36:26: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' return (r >> j) & 1; ^ In file included from /usr/include/c++/7/valarray:592:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:95, from decoder.cpp:2: /usr/include/c++/7/bits/valarray_after.h:411:5: note: candidate: template<class _Dom> std::_Expr<std::_BinClos<std::__shift_right, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__shift_right, typename _Dom1::value_type>::result_type> std::operator>>(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _Dom::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(>>, __shift_right)