# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1213784 | Nelt | Overtaking (IOI23_overtaking) | C++17 | Compilation error | 0 ms | 0 KiB |
#include "overtaking.h"
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define aa auto
#define bb long
#define cc bb bb
#define dd using
#define ee namespace
#define ff std
#define gg __gnu_pbds
#define hh return
#define ii if
#define jj while
#define kk for
#define ll const
#define mm vector
#define nn set
#define oo pair
#define pp array
#define qq make_pair
#define rr insert
#define ss erase
#define tt begin()
#define uu end()
#define vv lower_bound
#define ww upper_bound
#define xx sort
#define yy assert
#define zz push_back
#define AAA 1005
#define BBB 9000000000000000000LL
#define CCC(a,b) ((a)>(b)?(a):(b))
#define DDD(a,b,c) kk(cc a=b;a--;)
#define EEE(a,b,c) kk(cc a=b;a<(c);a++)
#define FFF(a,b) (vv(a.uu,a,b)-a.tt-1)
#define GGG(a) a=a
// Function macro renaming
#define INIT QQ
#define ADD UU
#define GETPOINT TT
#define ARRIVAL_TIME VV
dd ee ff;
dd ee gg;
mt19937_64 HHH(chrono::steady_clock::now().time_since_epoch().count());
cc III[AAA][AAA], JJJ[AAA][AAA], KKK[AAA][AAA], LLL[AAA], MMM[AAA], NNN, OOO, PPP;
oo<cc,cc> QQQ[AAA][AAA];
mm<oo<cc,cc>> RRR[AAA];
nn<pp<cc,3>> SSS;
cc GETPOINT(cc xxx)
{
aa it=SSS.ww({xxx,BBB,BBB});
ii(it!=SSS.tt)
{
--it;
ii((*it)[1]>=xxx) hh (*it)[2];
}
hh -1;
}
void ADD(cc lll,cc rrr,cc xxx)
{
ii(lll>rrr) hh;
aa it;
jj((it=SSS.vv({lll,-BBB,-BBB}))!=SSS.uu && (*it)[1]<=rrr) SSS.ss(it);
ii(it!=SSS.uu && (*it)[0]<=rrr)
{
aa[a,b,c]=*it;
SSS.ss(it);
SSS.rr({rrr+1,b,c});
}
it=SSS.vv({lll,-BBB,-BBB});
ii(it!=SSS.tt)
{
--it;
ii((*it)[1]>=lll)
{
aa[a,b,c]=*it;
SSS.ss(it);
SSS.rr({a,lll-1,c});
ii(b>=rrr) SSS.rr({rrr+1,b,c});
}
}
SSS.rr({lll,rrr,xxx});
}
void INIT(int ZZZ,int _0,mm<cc> _1,mm<int> _2,int _3,int _4,mm<int> _5)
{
PPP=_3; NNN=_0; OOO=_4;
EEE(i,0,NNN) KKK[i][0]=_1[i];
EEE(i,0,NNN) LLL[i]=_2[i];
LLL[NNN]=PPP;
EEE(i,0,OOO) MMM[i]=_5[i];
EEE(i,0,NNN) RRR[0].zz(qq(KKK[i][0],i));
xx(RRR[0].tt,RRR[0].uu);
EEE(i,1,OOO)
{
EEE(x,0,NNN)
{
cc j=RRR[i-1][x].second;
KKK[j][i]=KKK[j][i-1]+LLL[j]*(MMM[i]-MMM[i-1]);
QQQ[i][x]=CCC(x>0?QQQ[i][x-1]:qq(0LL,0LL),qq(KKK[j][i],j));
cc pos=vv(RRR[i-1].tt,RRR[i-1].uu,qq(KKK[j][i-1],-1LL))-RRR[i-1].tt-1;
ii(pos>=0) KKK[j][i]=CCC(KKK[j][i],QQQ[i][pos].first);
}
EEE(j,0,NNN) RRR[i].zz(qq(KKK[j][i],j));
xx(RRR[i].tt,RRR[i].uu);
}
DDD(i,OOO)
{
EEE(j,0,NNN)
{
cc pt=GETPOINT(KKK[j][OOO-1-i]-MMM[OOO-1-i]*PPP);
ii(pt==-1) JJJ[OOO-1-i][j]=KKK[j][OOO-1-i]+(ZZZ-MMM[OOO-1-i])*PPP;
else
{
cc last=KKK[j][OOO-1-i]+(MMM[pt-1]-MMM[OOO-1-i])*PPP;
cc pos=FFF(RRR[pt-1],qq(last,-1LL));
ii(pos>=0) JJJ[OOO-1-i][j]=JJJ[pt][QQQ[pt][pos].second];
else yy(0==1);
}
}
ii(OOO-1-i)
EEE(j,0,NNN)
ADD(KKK[j][OOO-2-i]-MMM[OOO-2-i]*PPP+1,KKK[j][OOO-1-i]-MMM[OOO-1-i]*PPP,OOO-1-i);
}
}
cc ARRIVAL_TIME(cc CURR)
{
cc pt=GETPOINT(CURR);
ii(pt==-1) hh CURR+MMM[OOO-1]*PPP;
cc last=CURR+MMM[pt-1]*PPP;
cc pos=FFF(RRR[pt-1],qq(last,-1LL));
hh JJJ[pt][QQQ[pt][pos].second];
}
Compilation message (stderr)
overtaking.cpp:114:14: error: macro "DDD" requires 3 arguments, but only 2 given 114 | DDD(i,OOO) | ^ overtaking.cpp:34: note: macro "DDD" defined here 34 | #define DDD(a,b,c) kk(cc a=b;a--;) | overtaking.cpp:11:12: error: '__gnu_pbds' is not a namespace-name 11 | #define gg __gnu_pbds | ^~~~~~~~~~ overtaking.cpp:46:7: note: in expansion of macro 'gg' 46 | dd ee gg; | ^~ overtaking.cpp: In function 'void UU(long long int, long long int, long long int)': overtaking.cpp:5:12: error: declaration of 'auto it' has no initializer 5 | #define aa auto | ^~~~ overtaking.cpp:68:5: note: in expansion of macro 'aa' 68 | aa it; | ^~ overtaking.cpp:74:15: error: no matching function for call to 'std::set<std::array<long long int, 3> >::insert(<brace-enclosed initializer list>)' 74 | SSS.rr({rrr+1,b,c}); | ~~~~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/11/set:61, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:87, from overtaking.cpp:2: /usr/include/c++/11/bits/stl_set.h:566:9: note: candidate: 'template<class _InputIterator> void std::set<_Key, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _InputIterator = _InputIterator; _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >]' 566 | insert(_InputIterator __first, _InputIterator __last) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:566:9: note: template argument deduction/substitution failed: overtaking.cpp:74:15: note: candidate expects 2 arguments, 1 provided 74 | SSS.rr({rrr+1,b,c}); | ~~~~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/11/set:61, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:87, from overtaking.cpp:2: /usr/include/c++/11/bits/stl_set.h:509:7: note: candidate: 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const value_type&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other = std::allocator<std::array<long long int, 3> >; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<std::array<long long int, 3> >, std::array<long long int, 3> >::rebind<std::array<long long int, 3> >; typename _Allocator::value_type = std::array<long long int, 3>; std::set<_Key, _Compare, _Alloc>::value_type = std::array<long long int, 3>]' 509 | insert(const value_type& __x) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:509:32: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::array<long long int, 3>&'} 509 | insert(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/stl_set.h:518:7: note: candidate: 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::value_type&&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other = std::allocator<std::array<long long int, 3> >; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<std::array<long long int, 3> >, std::array<long long int, 3> >::rebind<std::array<long long int, 3> >; typename _Allocator::value_type = std::array<long long int, 3>; std::set<_Key, _Compare, _Alloc>::value_type = std::array<long long int, 3>]' 518 | insert(value_type&& __x) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:518:27: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::set<std::array<long long int, 3> >::value_type&&' {aka 'std::array<long long int, 3>&&'} 518 | insert(value_type&& __x) | ~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/stl_set.h:546:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::const_iterator, const value_type&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::value_type = std::array<long long int, 3>]' 546 | insert(const_iterator __position, const value_type& __x) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:546:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/11/bits/stl_set.h:551:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::const_iterator, std::set<_Key, _Compare, _Alloc>::value_type&&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::value_type = std::array<long long int, 3>]' 551 | insert(const_iterator __position, value_type&& __x) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:551:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/11/bits/stl_set.h:578:7: note: candidate: 'void std::set<_Key, _Compare, _Alloc>::insert(std::initializer_list<_Tp>) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >]' 578 | insert(initializer_list<value_type> __l) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:578:43: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::initializer_list<std::array<long long int, 3> >' 578 | insert(initializer_list<value_type> __l) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/stl_set.h:598:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::insert_return_type std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::node_type&&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; std::set<_Key, _Compare, _Alloc>::insert_return_type = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::insert_return_type; std::set<_Key, _Compare, _Alloc>::node_type = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::node_type]' 598 | insert(node_type&& __nh) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:598:26: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::set<std::array<long long int, 3> >::node_type&&' {aka 'std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::node_type&&'} 598 | insert(node_type&& __nh) | ~~~~~~~~~~~~^~~~ /usr/include/c++/11/bits/stl_set.h:603:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::const_iterator, std::set<_Key, _Compare, _Alloc>::node_type&&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::node_type = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::node_type]' 603 | insert(const_iterator __hint, node_type&& __nh) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:603:7: note: candidate expects 2 arguments, 1 provided overtaking.cpp:84:19: error: no matching function for call to 'std::set<std::array<long long int, 3> >::insert(<brace-enclosed initializer list>)' 84 | SSS.rr({a,lll-1,c}); | ~~~~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/11/set:61, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:87, from overtaking.cpp:2: /usr/include/c++/11/bits/stl_set.h:566:9: note: candidate: 'template<class _InputIterator> void std::set<_Key, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _InputIterator = _InputIterator; _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >]' 566 | insert(_InputIterator __first, _InputIterator __last) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:566:9: note: template argument deduction/substitution failed: overtaking.cpp:84:19: note: candidate expects 2 arguments, 1 provided 84 | SSS.rr({a,lll-1,c}); | ~~~~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/11/set:61, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:87, from overtaking.cpp:2: /usr/include/c++/11/bits/stl_set.h:509:7: note: candidate: 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const value_type&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other = std::allocator<std::array<long long int, 3> >; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<std::array<long long int, 3> >, std::array<long long int, 3> >::rebind<std::array<long long int, 3> >; typename _Allocator::value_type = std::array<long long int, 3>; std::set<_Key, _Compare, _Alloc>::value_type = std::array<long long int, 3>]' 509 | insert(const value_type& __x) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:509:32: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::array<long long int, 3>&'} 509 | insert(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/stl_set.h:518:7: note: candidate: 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::value_type&&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other = std::allocator<std::array<long long int, 3> >; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<std::array<long long int, 3> >, std::array<long long int, 3> >::rebind<std::array<long long int, 3> >; typename _Allocator::value_type = std::array<long long int, 3>; std::set<_Key, _Compare, _Alloc>::value_type = std::array<long long int, 3>]' 518 | insert(value_type&& __x) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:518:27: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::set<std::array<long long int, 3> >::value_type&&' {aka 'std::array<long long int, 3>&&'} 518 | insert(value_type&& __x) | ~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/stl_set.h:546:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::const_iterator, const value_type&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::value_type = std::array<long long int, 3>]' 546 | insert(const_iterator __position, const value_type& __x) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:546:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/11/bits/stl_set.h:551:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::const_iterator, std::set<_Key, _Compare, _Alloc>::value_type&&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::value_type = std::array<long long int, 3>]' 551 | insert(const_iterator __position, value_type&& __x) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:551:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/11/bits/stl_set.h:578:7: note: candidate: 'void std::set<_Key, _Compare, _Alloc>::insert(std::initializer_list<_Tp>) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >]' 578 | insert(initializer_list<value_type> __l) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:578:43: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::initializer_list<std::array<long long int, 3> >' 578 | insert(initializer_list<value_type> __l) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/stl_set.h:598:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::insert_return_type std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::node_type&&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; std::set<_Key, _Compare, _Alloc>::insert_return_type = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::insert_return_type; std::set<_Key, _Compare, _Alloc>::node_type = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::node_type]' 598 | insert(node_type&& __nh) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:598:26: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::set<std::array<long long int, 3> >::node_type&&' {aka 'std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::node_type&&'} 598 | insert(node_type&& __nh) | ~~~~~~~~~~~~^~~~ /usr/include/c++/11/bits/stl_set.h:603:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::const_iterator, std::set<_Key, _Compare, _Alloc>::node_type&&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::node_type = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::node_type]' 603 | insert(const_iterator __hint, node_type&& __nh) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:603:7: note: candidate expects 2 arguments, 1 provided overtaking.cpp:85:30: error: no matching function for call to 'std::set<std::array<long long int, 3> >::insert(<brace-enclosed initializer list>)' 85 | ii(b>=rrr) SSS.rr({rrr+1,b,c}); | ~~~~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/11/set:61, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:87, from overtaking.cpp:2: /usr/include/c++/11/bits/stl_set.h:566:9: note: candidate: 'template<class _InputIterator> void std::set<_Key, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _InputIterator = _InputIterator; _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >]' 566 | insert(_InputIterator __first, _InputIterator __last) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:566:9: note: template argument deduction/substitution failed: overtaking.cpp:85:30: note: candidate expects 2 arguments, 1 provided 85 | ii(b>=rrr) SSS.rr({rrr+1,b,c}); | ~~~~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/11/set:61, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:87, from overtaking.cpp:2: /usr/include/c++/11/bits/stl_set.h:509:7: note: candidate: 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const value_type&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other = std::allocator<std::array<long long int, 3> >; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<std::array<long long int, 3> >, std::array<long long int, 3> >::rebind<std::array<long long int, 3> >; typename _Allocator::value_type = std::array<long long int, 3>; std::set<_Key, _Compare, _Alloc>::value_type = std::array<long long int, 3>]' 509 | insert(const value_type& __x) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:509:32: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::array<long long int, 3>&'} 509 | insert(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/stl_set.h:518:7: note: candidate: 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::value_type&&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other = std::allocator<std::array<long long int, 3> >; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<std::array<long long int, 3> >, std::array<long long int, 3> >::rebind<std::array<long long int, 3> >; typename _Allocator::value_type = std::array<long long int, 3>; std::set<_Key, _Compare, _Alloc>::value_type = std::array<long long int, 3>]' 518 | insert(value_type&& __x) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:518:27: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::set<std::array<long long int, 3> >::value_type&&' {aka 'std::array<long long int, 3>&&'} 518 | insert(value_type&& __x) | ~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/stl_set.h:546:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::const_iterator, const value_type&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::value_type = std::array<long long int, 3>]' 546 | insert(const_iterator __position, const value_type& __x) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:546:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/11/bits/stl_set.h:551:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::const_iterator, std::set<_Key, _Compare, _Alloc>::value_type&&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::value_type = std::array<long long int, 3>]' 551 | insert(const_iterator __position, value_type&& __x) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:551:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/11/bits/stl_set.h:578:7: note: candidate: 'void std::set<_Key, _Compare, _Alloc>::insert(std::initializer_list<_Tp>) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >]' 578 | insert(initializer_list<value_type> __l) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:578:43: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::initializer_list<std::array<long long int, 3> >' 578 | insert(initializer_list<value_type> __l) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/stl_set.h:598:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::insert_return_type std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::node_type&&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; std::set<_Key, _Compare, _Alloc>::insert_return_type = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::insert_return_type; std::set<_Key, _Compare, _Alloc>::node_type = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::node_type]' 598 | insert(node_type&& __nh) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:598:26: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::set<std::array<long long int, 3> >::node_type&&' {aka 'std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::node_type&&'} 598 | insert(node_type&& __nh) | ~~~~~~~~~~~~^~~~ /usr/include/c++/11/bits/stl_set.h:603:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::const_iterator, std::set<_Key, _Compare, _Alloc>::node_type&&) [with _Key = std::array<long long int, 3>; _Compare = std::less<std::array<long long int, 3> >; _Alloc = std::allocator<std::array<long long int, 3> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::const_iterator; std::set<_Key, _Compare, _Alloc>::node_type = std::_Rb_tree<std::array<long long int, 3>, std::array<long long int, 3>, std::_Identity<std::array<long long int, 3> >, std::less<std::array<long long int, 3> >, std::allocator<std::array<long long int, 3> > >::node_type]' 603 | insert(const_iterator __hint, node_type&& __nh) | ^~~~~~ /usr/include/c++/11/bits/stl_set.h:603:7: note: candidate expects 2 arguments, 1 provided overtaking.cpp: In function 'void QQ(int, int, std::vector<long long int>, std::vector<int>, int, int, std::vector<int>)': overtaking.cpp:114:5: error: 'DDD' was not declared in this scope 114 | DDD(i,OOO) | ^~~ overtaking.cpp: In function 'long long int VV(long long int)': overtaking.cpp:36:21: error: no matching function for call to 'lower_bound(std::vector<std::pair<long long int, long long int> >::iterator, std::vector<std::pair<long long int, long long int> >&, std::pair<long long int, long long int>)' 36 | #define FFF(a,b) (vv(a.uu,a,b)-a.tt-1) | ^ overtaking.cpp:139:12: note: in expansion of macro 'FFF' 139 | cc pos=FFF(RRR[pt-1],qq(last,-1LL)); | ^~~ In file included from /usr/include/c++/11/vector:60, from overtaking.h:1, from overtaking.cpp:1: /usr/include/c++/11/bits/stl_algobase.h:1490:5: note: candidate: 'template<class _ForwardIterator, class _Tp> _ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&)' 1490 | lower_bound(_ForwardIterator __first, _ForwardIterator __last, | ^~~~~~~~~~~ /usr/include/c++/11/bits/stl_algobase.h:1490:5: note: template argument deduction/substitution failed: overtaking.cpp:36:21: note: deduced conflicting types for parameter '_ForwardIterator' ('__gnu_cxx::__normal_iterator<std::pair<long long int, long long int>*, std::vector<std::pair<long long int, long long int> > >' and 'std::vector<std::pair<long long int, long long int> >') 36 | #define FFF(a,b) (vv(a.uu,a,b)-a.tt-1) | ^ overtaking.cpp:139:12: note: in expansion of macro 'FFF' 139 | cc pos=FFF(RRR[pt-1],qq(last,-1LL)); | ^~~ In file included from /usr/include/c++/11/algorithm:62, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65, from overtaking.cpp:2: /usr/include/c++/11/bits/stl_algo.h:2011:5: note: candidate: 'template<class _FIter, class _Tp, class _Compare> _FIter std::lower_bound(_FIter, _FIter, const _Tp&, _Compare)' 2011 | lower_bound(_ForwardIterator __first, _ForwardIterator __last, | ^~~~~~~~~~~ /usr/include/c++/11/bits/stl_algo.h:2011:5: note: template argument deduction/substitution failed: overtaking.cpp:36:21: note: deduced conflicting types for parameter '_FIter' ('__gnu_cxx::__normal_iterator<std::pair<long long int, long long int>*, std::vector<std::pair<long long int, long long int> > >' and 'std::vector<std::pair<long long int, long long int> >') 36 | #define FFF(a,b) (vv(a.uu,a,b)-a.tt-1) | ^ overtaking.cpp:139:12: note: in expansion of macro 'FFF' 139 | cc pos=FFF(RRR[pt-1],qq(last,-1LL)); | ^~~