ant.cpp: In function 'int main()':
ant.cpp:31:55: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
sort(ord,ord+n,[](int a, int b){return arr[a]<arr[b];});
^
ant.cpp:31:56: error: no matching function for call to 'sort(int [100100], int*, main()::<lambda(int, int)>)'
sort(ord,ord+n,[](int a, int b){return arr[a]<arr[b];});
^
In file included from /usr/include/c++/5/algorithm:62:0,
from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:64,
from ant.cpp:1:
/usr/include/c++/5/bits/stl_algo.h:4689:5: note: candidate: template<class _RAIter> void std::sort(_RAIter, _RAIter)
sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
^
/usr/include/c++/5/bits/stl_algo.h:4689:5: note: template argument deduction/substitution failed:
ant.cpp:31:56: note: candidate expects 2 arguments, 3 provided
sort(ord,ord+n,[](int a, int b){return arr[a]<arr[b];});
^
In file included from /usr/include/c++/5/algorithm:62:0,
from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:64,
from ant.cpp:1:
/usr/include/c++/5/bits/stl_algo.h:4718:5: note: candidate: template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)
sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
^
/usr/include/c++/5/bits/stl_algo.h:4718:5: note: template argument deduction/substitution failed:
ant.cpp: In substitution of 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int*; _Compare = main()::<lambda(int, int)>]':
ant.cpp:31:56: required from here
ant.cpp:31:56: error: template argument for 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)' uses local type 'main()::<lambda(int, int)>'
sort(ord,ord+n,[](int a, int b){return arr[a]<arr[b];});
^
ant.cpp:31:56: error: trying to instantiate 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
ant.cpp:36:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i=0;i<vec.size();i++) {
^
ant.cpp:23:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d",&n,&l,&t);
^
ant.cpp:27:29: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %c",&arr[i],&ch);
^
ant.cpp:33:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&id); id--;
^