# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1016229 | mindiyak | 앵무새 (IOI11_parrots) | C++14 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <cmath>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<int, int> pl;
typedef pair<ld, ld> pd;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<ld> vd;
typedef vector<long> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i, a, b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto &a : x)
#define uid(a, b) uniform_int_distribution<int>(a, b)(rng)
#define len(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define F first
#define nl endl
#define S second
#define lb lower_bound
#define ub upper_bound
#define aint(x) x.begin(), x.end()
#define raint(x) x.rbegin(), x.rend()
#define ins insert
const int MOD = 1000000007;
void encode(int N, int M[])
{
FOR(i,0,N){
int num = i << 3;
int val = M[i];
int arr[3];
FOR(i,0,3){
arr[i] = (val%8);
val = val >> 3;
}
FOR(i,0,3){
FOR(j,0,1<<i){
send(num+arr[i]);
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <cmath>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<int, int> pl;
typedef pair<ld, ld> pd;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<ld> vd;
typedef vector<long> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i, a, b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto &a : x)
#define uid(a, b) uniform_int_distribution<int>(a, b)(rng)
#define len(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define F first
#define nl endl
#define S second
#define lb lower_bound
#define ub upper_bound
#define aint(x) x.begin(), x.end()
#define raint(x) x.rbegin(), x.rend()
#define ins insert
const int MOD = 1000000007;
void decode(int N, int L, int X[])
{
vvi arr(N,vi(8,0));
vi ans(N,0);
FOR(i,0,L){
arr[X[i]>>3][((X[i]<<5)>>5)] ++;
}
FOR(i,0,N){
int val = 0;
for(int j=2;j>-1;j--){
FOR(k,0,8){
if(arr[k]>= (1<<j)){
arr[k] -= (1<<j);
val += k<<(3*j);
break;
}
}
}
ans[i] = val;
}
FOR(i,0,N)output(ans[i]);
}
컴파일 시 표준 에러 (stderr) 메시지
decoder.cpp: In function 'void decode(int, int, int*)': decoder.cpp:53:18: error: no match for 'operator>=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} and 'int') 53 | if(arr[k]>= (1<<j)){ In file included from /usr/include/c++/10/regex:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110, from decoder.cpp:3: /usr/include/c++/10/bits/regex.h:1097:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator>=(const std::__cxx11::sub_match<_BiIter>&, const std::__cxx11::sub_match<_BiIter>&)' 1097 | operator>=(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/10/bits/regex.h:1097:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/regex:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110, from decoder.cpp:3: /usr/include/c++/10/bits/regex.h:1180:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>=(std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const std::__cxx11::sub_match<_BiIter>&)' 1180 | operator>=(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/regex.h:1180:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/regex:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110, from decoder.cpp:3: /usr/include/c++/10/bits/regex.h:1273:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>=(const std::__cxx11::sub_match<_BiIter>&, std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1273 | operator>=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/regex.h:1273:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/regex:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110, from decoder.cpp:3: /usr/include/c++/10/bits/regex.h:1347:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>=(const typename std::iterator_traits<_Iter>::value_type*, const std::__cxx11::sub_match<_BiIter>&)' 1347 | operator>=(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/regex.h:1347:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/regex:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110, from decoder.cpp:3: /usr/include/c++/10/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>=(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator>=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/regex.h:1441:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/regex:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110, from decoder.cpp:3: /usr/include/c++/10/bits/regex.h:1518:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>=(const typename std::iterator_traits<_Iter>::value_type&, const std::__cxx11::sub_match<_BiIter>&)' 1518 | operator>=(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/regex.h:1518:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/regex:62, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110, from decoder.cpp:3: /usr/include/c++/10/bits/regex.h:1618:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>=(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1618 | operator>=(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/regex.h:1618:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/bits/stl_algobase.h:64, from /usr/include/c++/10/bits/char_traits.h:39, from /usr/include/c++/10/ios:40, from /usr/include/c++/10/istream:38, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from decoder.cpp:3: /usr/include/c++/10/bits/stl_pair.h:514:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>=(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)' 514 | operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/10/bits/stl_pair.h:514:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::pair<_T1, _T2>' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/bits/stl_algobase.h:67, from /usr/include/c++/10/bits/char_traits.h:39, from /usr/include/c++/10/ios:40, from /usr/include/c++/10/istream:38, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from decoder.cpp:3: /usr/include/c++/10/bits/stl_iterator.h:390:5: note: candidate: 'template<class _Iterator> bool std::operator>=(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)' 390 | operator>=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/10/bits/stl_iterator.h:390:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::reverse_iterator<_Iterator>' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/bits/stl_algobase.h:67, from /usr/include/c++/10/bits/char_traits.h:39, from /usr/include/c++/10/ios:40, from /usr/include/c++/10/istream:38, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from decoder.cpp:3: /usr/include/c++/10/bits/stl_iterator.h:428:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator>=(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)' 428 | operator>=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/10/bits/stl_iterator.h:428:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::reverse_iterator<_Iterator>' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/bits/stl_algobase.h:67, from /usr/include/c++/10/bits/char_traits.h:39, from /usr/include/c++/10/ios:40, from /usr/include/c++/10/istream:38, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from decoder.cpp:3: /usr/include/c++/10/bits/stl_iterator.h:1478:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator>=(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)' 1478 | operator>=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/10/bits/stl_iterator.h:1478:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::move_iterator<_IteratorL>' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/bits/stl_algobase.h:67, from /usr/include/c++/10/bits/char_traits.h:39, from /usr/include/c++/10/ios:40, from /usr/include/c++/10/istream:38, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from decoder.cpp:3: /usr/include/c++/10/bits/stl_iterator.h:1525:5: note: candidate: 'template<class _Iterator> bool std::operator>=(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)' 1525 | operator>=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/10/bits/stl_iterator.h:1525:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::move_iterator<_IteratorL>' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/string:55, from /usr/include/c++/10/bits/locale_classes.h:40, from /usr/include/c++/10/bits/ios_base.h:41, from /usr/include/c++/10/ios:42, from /usr/include/c++/10/istream:38, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from decoder.cpp:3: /usr/include/c++/10/bits/basic_string.h:6381:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)' 6381 | operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/basic_string.h:6381:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/string:55, from /usr/include/c++/10/bits/locale_classes.h:40, from /usr/include/c++/10/bits/ios_base.h:41, from /usr/include/c++/10/ios:42, from /usr/include/c++/10/istream:38, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from decoder.cpp:3: /usr/include/c++/10/bits/basic_string.h:6394:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)' 6394 | operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/basic_string.h:6394:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/string:55, from /usr/include/c++/10/bits/locale_classes.h:40, from /usr/include/c++/10/bits/ios_base.h:41, from /usr/include/c++/10/ios:42, from /usr/include/c++/10/istream:38, from /usr/include/c++/10/sstream:38, from /usr/include/c++/10/complex:45, from /usr/include/c++/10/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54, from decoder.cpp:3: /usr/include/c++/10/bits/basic_string.h:6406:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>=(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)' 6406 | operator>=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/10/bits/basic_string.h:6406:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: mismatched types 'const _CharT*' and 'std::vector<int>' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/deque:67, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:68, from decoder.cpp:3: /usr/include/c++/10/bits/stl_deque.h:2304:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator>=(const std::deque<_Tp, _Alloc>&, const std::deque<_Tp, _Alloc>&)' 2304 | operator>=(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y) | ^~~~~~~~ /usr/include/c++/10/bits/stl_deque.h:2304:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::deque<_Tp, _Alloc>' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/tuple:39, from /usr/include/c++/10/functional:54, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:71, from decoder.cpp:3: /usr/include/c++/10/array:305:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> bool std::operator>=(const std::array<_Tp, _Nm>&, const std::array<_Tp, _Nm>&)' 305 | operator>=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two) | ^~~~~~~~ /usr/include/c++/10/array:305:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::array<_Tp, _Nm>' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/functional:54, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:71, from decoder.cpp:3: /usr/include/c++/10/tuple:1466:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator>=(const std::tuple<_Tps ...>&, const std::tuple<_Elements ...>&)' 1466 | operator>=(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/10/tuple:1466:5: note: template argument deduction/substitution failed: decoder.cpp:53:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} is not derived from 'const std::tuple<_Tps ...>' 53 | if(arr[k]>= (1<<j)){ | ^ In file included from /usr/include/c++/10/bits/locale_conv.h:41, from /usr/include/c++/10/locale:43, from /usr/include/c++/10/iomanip:43, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:72, from decoder.cpp:3: /usr/include/c++/10/bits/unique_ptr.h:872:5: note: candidate: 'template<class _Tp, class _Dp, class _Up, class _Ep> bool std::operator>=(const std::unique_ptr<_Tp, _Dp>&, const std::unique_ptr<_Up, _Ep>&)' 872 | operator>=(const unique_ptr<_Tp, _Dp>& __x, | ^~~~~~~~ /usr/include/c++/10/bits/unique_ptr.h:872:5: note: template argument deduction/substitut