/in/foo.cc: In function 'int main()':
/in/foo.cc:15:7: error: no matching function for call to 'sort()'
sort()
^
In file included from /usr/include/c++/6/algorithm:62:0,
from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:65,
from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_algo.h:4697:5: note: candidate: template<class _RAIter> void std::sort(_RAIter, _RAIter)
sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
^~~~
/usr/include/c++/6/bits/stl_algo.h:4697:5: note: template argument deduction/substitution failed:
/in/foo.cc:15:7: note: candidate expects 2 arguments, 0 provided
sort()
^
In file included from /usr/include/c++/6/algorithm:62:0,
from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:65,
from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_algo.h:4727:5: note: candidate: template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)
sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
^~~~
/usr/include/c++/6/bits/stl_algo.h:4727:5: note: template argument deduction/substitution failed:
/in/foo.cc:15:7: note: candidate expects 3 arguments, 0 provided
sort()
^
/in/foo.cc:17:2: error: 'ans' was not declared in this scope
ans.l=a[1].l;
^~~
/in/foo.cc:19:14: error: 'i' was not declared in this scope
for(int i=2;i<=n;i++){
^