teams.cpp: In constructor 'data_structure::data_structure(std::vector<int>)':
teams.cpp:23:15: warning: conversion from 'std::vector<int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
23 | N = arr.size();
| ~~~~~~~~^~
teams.cpp: In member function 'int data_structure::count_range(int, int, int)':
teams.cpp:60:54: warning: conversion from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type' {aka 'long int'} to 'int' may change value [-Wconversion]
60 | int ptr = lower_bound(sarr.begin(), sarr.end(), x) - sarr.begin();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
teams.cpp: In function 'void init(int, int*, int*)':
teams.cpp:91:30: 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')
91 | sumcnt[j + 1] = sumcnt[j] + (B[j] < i ? 1 : 0));
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
from /usr/include/c++/9/vector:60,
from teams.cpp:2:
/usr/include/c++/9/bits/stl_iterator.h:423:5: note: candidate: 'template<class _Iterator> std::reverse_iterator<_Iterator> std::operator+(typename std::reverse_iterator<_Iterator>::difference_type, const std::reverse_iterator<_Iterator>&)'
423 | operator+(typename reverse_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/9/bits/stl_iterator.h:423:5: note: template argument deduction/substitution failed:
teams.cpp:91:49: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
91 | sumcnt[j + 1] = sumcnt[j] + (B[j] < i ? 1 : 0));
| ^
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
from /usr/include/c++/9/vector:60,
from teams.cpp:2:
/usr/include/c++/9/bits/stl_iterator.h:1219:5: note: candidate: 'template<class _Iterator> std::move_iterator<_IteratorL> std::operator+(typename std::move_iterator<_IteratorL>::difference_type, const std::move_iterator<_IteratorL>&)'
1219 | operator+(typename move_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/9/bits/stl_iterator.h:1219:5: note: template argument deduction/substitution failed:
teams.cpp:91:49: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
91 | sumcnt[j + 1] = sumcnt[j] + (B[j] < i ? 1 : 0));
| ^
In file included from /usr/include/c++/9/vector:68,
from teams.cpp:2:
/usr/include/c++/9/bits/stl_bvector.h:303:3: note: candidate: 'std::_Bit_iterator std::operator+(std::ptrdiff_t, const std::_Bit_iterator&)'
303 | operator+(ptrdiff_t __n, const _Bit_iterator& __x)
| ^~~~~~~~
/usr/include/c++/9/bits/stl_bvector.h:303:23: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'std::ptrdiff_t' {aka 'long int'}
303 | operator+(ptrdiff_t __n, const _Bit_iterator& __x)
| ~~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_bvector.h:393:3: note: candidate: 'std::_Bit_const_iterator std::operator+(std::ptrdiff_t, const std::_Bit_const_iterator&)'
393 | operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
| ^~~~~~~~
/usr/include/c++/9/bits/stl_bvector.h:393:23: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'std::ptrdiff_t' {aka 'long int'}
393 | operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
| ~~~~~~~~~~^~~
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from teams.cpp:3:
/usr/include/c++/9/bits/basic_string.h:6020:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
6020 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:6020:5: note: template argument deduction/substitution failed:
teams.cpp:91:49: 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>'
91 | sumcnt[j + 1] = sumcnt[j] + (B[j] < i ? 1 : 0));
| ^
In file included from /usr/include/c++/9/string:56,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from teams.cpp:3:
/usr/include/c++/9/bits/basic_string.tcc:1158:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
1158 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.tcc:1158:5: note: template argument deduction/substitution failed:
teams.cpp:91:49: note: mismatched types 'const _CharT*' and 'std::vector<int>'
91 | sumcnt[j + 1] = sumcnt[j] + (B[j] < i ? 1 : 0));
| ^
In file included from /usr/include/c++/9/string:56,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from teams.cpp:3:
/usr/include/c++/9/bits/basic_string.tcc:1174:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(_CharT, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
1174 | operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.tcc:1174:5: note: template argument deduction/substitution failed:
teams.cpp:91:49: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'int'
91 | sumcnt[j + 1] = sumcnt[j] + (B[j] < i ? 1 : 0));
| ^
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from teams.cpp:3:
/usr/include/c++/9/bits/basic_string.h:6057:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)'
6057 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:6057:5: note: template argument deduction/substitution failed:
teams.cpp:91:49: 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>'
91 | sumcnt[j + 1] = sumcnt[j] + (B[j] < i ? 1 : 0));
| ^
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from teams.cpp:3:
/usr/include/c++/9/bits/basic_string.h:6073:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, _CharT)'
6073 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:6073:5: note: template argument deduction/substitution failed:
teams.cpp:91:49: 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>'
91 | sumcnt[j + 1] = sumcnt[j] + (B[j] < i ? 1 : 0));
| ^
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from teams.cpp:3:
/usr/include/c++/9/bits/basic_string.h:6085:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
6085 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:6085:5: note: template argument deduction/substitution failed:
teams.cpp:91:49: 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::basic_string<_CharT, _Traits, _Alloc>'
91 | sumcnt[j + 1] = sumcnt[j] + (B[j] < i ? 1 : 0));
| ^
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from teams.cpp:3:
/usr/include/c++/9/bits/basic_string.h:6091:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&)'
6091 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:6091:5: note: template argument deduction/substitution failed:
teams.cpp:91:49: 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>'
91 | sumcnt[j + 1] = sumcnt[j] + (B[j] < i ? 1 : 0));
| ^
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from teams.cpp:3:
/usr/include/c++/9/bits/basic_string.h:6097:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&)'
6097 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:6097:5: note: template argument deduction/substitution failed:
teams.cpp:91:49: 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::basic_string<_CharT, _Traits, _Alloc>'
91 | sumcnt[j + 1] = sumcnt[j] + (B[j] < i ? 1 : 0));
| ^
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from teams.cpp:3:
/usr/include/c++/9/bits/basic_string.h:6109:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const _CharT*, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&)'
6109 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:6109:5: note: template argument deduction/substitution failed:
teams.cpp:91:49: note: mismatched types 'const _CharT*' and 'std::vector<int>'
91 | sumcnt[j + 1] = sumcnt[j] + (B[j] < i ? 1 : 0));
| ^
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from teams.cpp:3:
/usr/include/c++/9/bits/basic_string.h:6115:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(_CharT, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&)'
6115 | operator+(_CharT __lhs,
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:6115:5: note: template argument deduction/substitution failed:
teams.cpp:91:49: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'int'
91 | sumcnt[j + 1] = sumcnt[j] + (B[j] < i ? 1 : 0));
| ^
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from teams.cpp:3:
/usr/include/c++/9/bits/basic_string.h:6121:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _CharT*)'
6121 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:6121:5: note: template argument deduction/substitution failed:
teams.cpp:91:49: 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::basic_string<_CharT, _Traits, _Alloc>'
91 | sumcnt[j + 1] = sumcnt[j] + (B[j] < i ? 1 : 0));
| ^
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from teams.cpp:3:
/usr/include/c++/9/bits/basic_string.h:6127:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, _CharT)'
6127 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:6127:5: note: template argument deduction/substitution failed:
teams.cpp:91:49: 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::basic_string<_CharT, _Traits, _Alloc>'
91 | sumcnt[j + 1] = sumcnt[j] + (B[j] < i ? 1 : 0));
| ^
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
from /usr/include/c++/9/vector:60,
from teams.cpp:2:
/usr/include/c++/9/bits/stl_iterator.h:996:5: note: candidate: 'template<class _Iterator, class _Container> __gnu_cxx::__normal_iterator<_Iterator, _Container> __gnu_cxx::operator+(typename __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)'
996 | operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
| ^~~~~~~~
/usr/include/c++/9/bits/stl_iterator.h:996:5: note: template argument deduction/substitution failed:
teams.cpp:91:49: note: mismatched types 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' and 'int'
91 | sumcnt[j + 1] = sumcnt[j] + (B[j] < i ? 1 : 0));
| ^
teams.cpp: In function 'int can(int, int*)':
teams.cpp:115:17: warning: conversion from 'std::vector<int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
115 | int S = SK.size();
| ~~~~~~~^~
teams.cpp:118:74: warning: conversion from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type' {aka 'long int'} to 'int' may change value [-Wconversion]
118 | int pl = lower_bound(A.begin(), A.end(), (i == 0 ? 0 : SK[i - 1] + 1)) - A.begin();
| ~~~~~~~~~~