Main.cc: In function ‘long long int rkb(long long int)’: Main.cc:14:30: error: no matching function for call to ‘lower_bound(unsigned int*, long long int*&, long long int&)’ return lower_bound(s+1,tmp,x)-s; ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, 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 Main.cc:1: /usr/include/c++/7/bits/stl_algobase.h:984:5: note: candidate: template _ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&) lower_bound(_ForwardIterator __first, _ForwardIterator __last, ^~~~~~~~~~~ /usr/include/c++/7/bits/stl_algobase.h:984:5: note: template argument deduction/substitution failed: Main.cc:14:30: note: deduced conflicting types for parameter ‘_ForwardIterator’ (‘unsigned int*’ and ‘long long int*’) return lower_bound(s+1,tmp,x)-s; ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from Main.cc:1: /usr/include/c++/7/bits/stl_algo.h:2023:5: note: candidate: template _FIter std::lower_bound(_FIter, _FIter, const _Tp&, _Compare) lower_bound(_ForwardIterator __first, _ForwardIterator __last, ^~~~~~~~~~~ /usr/include/c++/7/bits/stl_algo.h:2023:5: note: template argument deduction/substitution failed: Main.cc:14:30: note: deduced conflicting types for parameter ‘_FIter’ (‘unsigned int*’ and ‘long long int*’) return lower_bound(s+1,tmp,x)-s; ^ Main.cc: In function ‘void bd(long long int, long long int, long long int)’: Main.cc:65:11: warning: suggest parentheses around ‘+’ inside ‘>>’ [-Wparentheses] int mid=l+r>>1; ~^~ Main.cc: In function ‘void chkmodc(long long int, long long int, long long int, long long int, long long int, long long int)’: Main.cc:81:11: warning: suggest parentheses around ‘+’ inside ‘>>’ [-Wparentheses] int mid=l+r>>1; ~^~ Main.cc: In function ‘void chkmodd(long long int, long long int, long long int, long long int, long long int, long long int)’: Main.cc:95:11: warning: suggest parentheses around ‘+’ inside ‘>>’ [-Wparentheses] int mid=l+r>>1; ~^~ Main.cc: In function ‘void chkmodcrv(long long int, long long int, long long int, long long int, long long int, long long int)’: Main.cc:150:11: warning: suggest parentheses around ‘+’ inside ‘>>’ [-Wparentheses] int mid=l+r>>1; ~^~ Main.cc: In function ‘void chkmoddrv(long long int, long long int, long long int, long long int, long long int, long long int)’: Main.cc:168:11: warning: suggest parentheses around ‘+’ inside ‘>>’ [-Wparentheses] int mid=l+r>>1; ~^~ Main.cc: In function ‘long long int gt(long long int, long long int, long long int, long long int, long long int)’: Main.cc:182:11: warning: suggest parentheses around ‘+’ inside ‘>>’ [-Wparentheses] int mid=l+r>>1; ~^~ Main.cc: In function ‘int main()’: Main.cc:213:30: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 2 has type ‘unsigned int*’ [-Wformat=] #define rd(x) scanf("%lld",&x) ~~^~ signed main() { ~~~~~~~~~~~~~~~~ freopen("inter.in","r",stdin); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // freopen("inter.out","w",stdout); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ios::sync_with_stdio(0); ~~~~~~~~~~~~~~~~~~~~~~~~~ int t; ~~~~~~~ rd(t); ~~~~~~~ while(t--){ ~~~~~~~~~~~~ rd(n); ~~~~~~~ for(int i=1;i<=n;i++)rd(a[i]),rd(b[i]),rd(c[i]),rd(d[i]), ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Main.cc:222:24: note: in expansion of macro ‘rd’ for(int i=1;i<=n;i++)rd(a[i]),rd(b[i]),rd(c[i]),rd(d[i]), ^~ Main.cc:213:30: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 2 has type ‘unsigned int*’ [-Wformat=] #define rd(x) scanf("%lld",&x) ~~^~ signed main() { ~~~~~~~~~~~~~~~~ freopen("inter.in","r",stdin); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // freopen("inter.out","w",stdout); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ios::sync_with_stdio(0); ~~~~~~~~~~~~~~~~~~~~~~~~~ int t; ~~~~~~~ rd(t); ~~~~~~~ while(t--){ ~~~~~~~~~~~~ rd(n); ~~~~~~~ for(int i=1;i<=n;i++)rd(a[i]),rd(b[i]),rd(c[i]),rd(d[i]), ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Main.cc:222:33: note: in expansion of macro ‘rd’ for(int i=1;i<=n;i++)rd(a[i]),rd(b[i]),rd(c[i]),rd(d[i]), ^~ Main.cc:213:30: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 2 has type ‘unsigned int*’ [-Wformat=] #define rd(x) scanf("%lld",&x) ~~^~ signed main() { ~~~~~~~~~~~~~~~~ freopen("inter.in","r",stdin); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // freopen("inter.out","w",stdout); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ios::sync_with_stdio(0); ~~~~~~~~~~~~~~~~~~~~~~~~~ int t; ~~~~~~~ rd(t); ~~~~~~~ while(t--){ ~~~~~~~~~~~~ rd(n); ~~~~~~~ for(int i=1;i<=n;i++)rd(a[i]),rd(b[i]),rd(c[i]),rd(d[i]), ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Main.cc:222:42: note: in expansion of macro ‘rd’ for(int i=1;i<=n;i++)rd(a[i]),rd(b[i]),rd(c[i]),rd(d[i]), ^~ Main.cc:213:30: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 2 has type ‘unsigned int*’ [-Wformat=] #define rd(x) scanf("%lld",&x) ~~^~ signed main() { ~~~~~~~~~~~~~~~~ freopen("inter.in","r",stdin); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // freopen("inter.out","w",stdout); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ios::sync_with_stdio(0); ~~~~~~~~~~~~~~~~~~~~~~~~~ int t; ~~~~~~~ rd(t); ~~~~~~~ while(t--){ ~~~~~~~~~~~~ rd(n); ~~~~~~~ for(int i=1;i<=n;i++)rd(a[i]),rd(b[i]),rd(c[i]),rd(d[i]), ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Main.cc:222:51: note: in expansion of macro ‘rd’ for(int i=1;i<=n;i++)rd(a[i]),rd(b[i]),rd(c[i]),rd(d[i]), ^~ Main.cc:226:39: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘unsigned int’ [-Wformat=] printf("%lld\n",a[1]+b[1]+c[1]+d[1]); ~~~~~~~~~~~~~~~~~~~^ Main.cc:230:23: error: cannot convert ‘unsigned int*’ to ‘long long int*’ in assignment tmp=unique(s+1,s+n+1); ^ Main.cc:231:25: error: comparison between distinct pointer types ‘long long int*’ and ‘unsigned int*’ lacks a cast [-fpermissive] for(auto i=tmp;i!=s+n+10;i++) ^~ Main.cc:239:29: error: no matching function for call to ‘max(long long int&, unsigned int&)’ sc[i]=max(sc[i+1],c[p[i]]), ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, 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 Main.cc:1: /usr/include/c++/7/bits/stl_algobase.h:219:5: note: candidate: template const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^~~ /usr/include/c++/7/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed: Main.cc:239:29: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘unsigned int’) sc[i]=max(sc[i+1],c[p[i]]), ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, 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 Main.cc:1: /usr/include/c++/7/bits/stl_algobase.h:265:5: note: candidate: template const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed: Main.cc:239:29: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘unsigned int’) sc[i]=max(sc[i+1],c[p[i]]), ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from Main.cc:1: /usr/include/c++/7/bits/stl_algo.h:3462:5: note: candidate: template _Tp std::max(std::initializer_list<_Tp>) max(initializer_list<_Tp> __l) ^~~ /usr/include/c++/7/bits/stl_algo.h:3462:5: note: template argument deduction/substitution failed: Main.cc:239:29: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’ sc[i]=max(sc[i+1],c[p[i]]), ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from Main.cc:1: /usr/include/c++/7/bits/stl_algo.h:3468:5: note: candidate: template _Tp std::max(std::initializer_list<_Tp>, _Compare) max(initializer_list<_Tp> __l, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algo.h:3468:5: note: template argument deduction/substitution failed: Main.cc:239:29: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’ sc[i]=max(sc[i+1],c[p[i]]), ^ Main.cc:240:29: error: no matching function for call to ‘max(long long int&, unsigned int&)’ sd[i]=max(sd[i+1],d[p[i]]), ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, 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 Main.cc:1: /usr/include/c++/7/bits/stl_algobase.h:219:5: note: candidate: template const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^~~ /usr/include/c++/7/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed: Main.cc:240:29: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘unsigned int’) sd[i]=max(sd[i+1],d[p[i]]), ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, 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 Main.cc:1: /usr/include/c++/7/bits/stl_algobase.h:265:5: note: candidate: template const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed: Main.cc:240:29: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘unsigned int’) sd[i]=max(sd[i+1],d[p[i]]), ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from Main.cc:1: /usr/include/c++/7/bits/stl_algo.h:3462:5: note: candidate: template _Tp std::max(std::initializer_list<_Tp>) max(initializer_list<_Tp> __l) ^~~ /usr/include/c++/7/bits/stl_algo.h:3462:5: note: template argument deduction/substitution failed: Main.cc:240:29: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’ sd[i]=max(sd[i+1],d[p[i]]), ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from Main.cc:1: /usr/include/c++/7/bits/stl_algo.h:3468:5: note: candidate: template _Tp std::max(std::initializer_list<_Tp>, _Compare) max(initializer_list<_Tp> __l, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algo.h:3468:5: note: template argument deduction/substitution failed: Main.cc:240:29: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’ sd[i]=max(sd[i+1],d[p[i]]), ^ Main.cc:241:29: error: no matching function for call to ‘max(long long int&, unsigned int&)’ sa[i]=max(sa[i+1],a[p[i]]), ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, 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 Main.cc:1: /usr/include/c++/7/bits/stl_algobase.h:219:5: note: candidate: template const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^~~ /usr/include/c++/7/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed: Main.cc:241:29: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘unsigned int’) sa[i]=max(sa[i+1],a[p[i]]), ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, 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 Main.cc:1: /usr/include/c++/7/bits/stl_algobase.h:265:5: note: candidate: template const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed: Main.cc:241:29: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘unsigned int’) sa[i]=max(sa[i+1],a[p[i]]), ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from Main.cc:1: /usr/include/c++/7/bits/stl_algo.h:3462:5: note: candidate: template _Tp std::max(std::initializer_list<_Tp>) max(initializer_list<_Tp> __l) ^~~ /usr/include/c++/7/bits/stl_algo.h:3462:5: note: template argument deduction/substitution failed: Main.cc:241:29: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’ sa[i]=max(sa[i+1],a[p[i]]), ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from Main.cc:1: /usr/include/c++/7/bits/stl_algo.h:3468:5: note: candidate: template _Tp std::max(std::initializer_list<_Tp>, _Compare) max(initializer_list<_Tp> __l, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algo.h:3468:5: note: template argument deduction/substitution failed: Main.cc:241:29: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’ sa[i]=max(sa[i+1],a[p[i]]), ^ Main.cc:242:29: error: no matching function for call to ‘max(long long int&, unsigned int&)’ sb[i]=max(sb[i+1],b[p[i]]); ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, 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 Main.cc:1: /usr/include/c++/7/bits/stl_algobase.h:219:5: note: candidate: template const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^~~ /usr/include/c++/7/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed: Main.cc:242:29: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘unsigned int’) sb[i]=max(sb[i+1],b[p[i]]); ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, 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 Main.cc:1: /usr/include/c++/7/bits/stl_algobase.h:265:5: note: candidate: template const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed: Main.cc:242:29: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘unsigned int’) sb[i]=max(sb[i+1],b[p[i]]); ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from Main.cc:1: /usr/include/c++/7/bits/stl_algo.h:3462:5: note: candidate: template _Tp std::max(std::initializer_list<_Tp>) max(initializer_list<_Tp> __l) ^~~ /usr/include/c++/7/bits/stl_algo.h:3462:5: note: template argument deduction/substitution failed: Main.cc:242:29: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’ sb[i]=max(sb[i+1],b[p[i]]); ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from Main.cc:1: /usr/include/c++/7/bits/stl_algo.h:3468:5: note: candidate: template _Tp std::max(std::initializer_list<_Tp>, _Compare) max(initializer_list<_Tp> __l, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algo.h:3468:5: note: template argument deduction/substitution failed: Main.cc:242:29: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’ sb[i]=max(sb[i+1],b[p[i]]); ^ Main.cc:245:21: error: no matching function for call to ‘min(long long int&, unsigned int&)’ mn=min(mn,b[p[i]]); ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, 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 Main.cc:1: /usr/include/c++/7/bits/stl_algobase.h:195:5: note: candidate: template const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^~~ /usr/include/c++/7/bits/stl_algobase.h:195:5: note: template argument deduction/substitution failed: Main.cc:245:21: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘unsigned int’) mn=min(mn,b[p[i]]); ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, 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 Main.cc:1: /usr/include/c++/7/bits/stl_algobase.h:243:5: note: candidate: template const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algobase.h:243:5: note: template argument deduction/substitution failed: Main.cc:245:21: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘unsigned int’) mn=min(mn,b[p[i]]); ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from Main.cc:1: /usr/include/c++/7/bits/stl_algo.h:3450:5: note: candidate: template _Tp std::min(std::initializer_list<_Tp>) min(initializer_list<_Tp> __l) ^~~ /usr/include/c++/7/bits/stl_algo.h:3450:5: note: template argument deduction/substitution failed: Main.cc:245:21: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’ mn=min(mn,b[p[i]]); ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from Main.cc:1: /usr/include/c++/7/bits/stl_algo.h:3456:5: note: candidate: template _Tp std::min(std::initializer_list<_Tp>, _Compare) min(initializer_list<_Tp> __l, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algo.h:3456:5: note: template argument deduction/substitution failed: Main.cc:245:21: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’ mn=min(mn,b[p[i]]); ^ Main.cc:246:21: error: no matching function for call to ‘max(long long int&, unsigned int&)’ mx=max(mx,b[p[i]]); ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, 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 Main.cc:1: /usr/include/c++/7/bits/stl_algobase.h:219:5: note: candidate: template const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^~~ /usr/include/c++/7/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed: Main.cc:246:21: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘unsigned int’) mx=max(mx,b[p[i]]); ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, 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 Main.cc:1: /usr/include/c++/7/bits/stl_algobase.h:265:5: note: candidate: template const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed: Main.cc:246:21: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘unsigned int’) mx=max(mx,b[p[i]]); ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from Main.cc:1: /usr/include/c++/7/bits/stl_algo.h:3462:5: note: candidate: template _Tp std::max(std::initializer_list<_Tp>) max(initializer_list<_Tp> __l) ^~~ /usr/include/c++/7/bits/stl_algo.h:3462:5: note: template argument deduction/substitution failed: Main.cc:246:21: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’ mx=max(mx,b[p[i]]); ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from Main.cc:1: /usr/include/c++/7/bits/stl_algo.h:3468:5: note: candidate: template _Tp std::max(std::initializer_list<_Tp>, _Compare) max(initializer_list<_Tp> __l, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algo.h:3468:5: note: template argument deduction/substitution failed: Main.cc:246:21: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’ mx=max(mx,b[p[i]]); ^ Main.cc:260:23: error: no matching function for call to ‘max(long long int&, unsigned int&)’ mxa=max(mxa,a[p[i]]); ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, 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 Main.cc:1: /usr/include/c++/7/bits/stl_algobase.h:219:5: note: candidate: template const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^~~ /usr/include/c++/7/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed: Main.cc:260:23: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘unsigned int’) mxa=max(mxa,a[p[i]]); ^ In file included from /usr/include/c++/7/bits/char_traits.h:39:0, from /usr/include/c++/7/ios:40, 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 Main.cc:1: /usr/include/c++/7/bits/stl_algobase.h:265:5: note: candidate: template const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed: Main.cc:260:23: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘unsigned int’) mxa=max(mxa,a[p[i]]); ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from Main.cc:1: /usr/include/c++/7/bits/stl_algo.h:3462:5: note: candidate: template _Tp std::max(std::initializer_list<_Tp>) max(initializer_list<_Tp> __l) ^~~ /usr/include/c++/7/bits/stl_algo.h:3462:5: note: template argument deduction/substitution failed: Main.cc:260:23: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’ mxa=max(mxa,a[p[i]]); ^ In file included from /usr/include/c++/7/algorithm:62:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from Main.cc:1: /usr/include/c++/7/bits/stl_algo.h:3468:5: note: candidate: template _Tp std::max(std::initializer_list<_Tp>, _Compare) max(initializer_list<_Tp> __l, _Compare __comp) ^~~ /usr/include/c++/7/bits/stl_algo.h:3468:5: note: template argument deduction/substitution failed: