cultivation.cpp: In function 'int main()':
cultivation.cpp:52:58: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
sort(P+1, P+1+N, [](pii a, pii b) { return a.Se < b.Se; });
^
cultivation.cpp:52:59: error: no matching function for call to 'sort(pii*, pii*, main()::<lambda(pii, pii)>)'
sort(P+1, P+1+N, [](pii a, pii b) { return a.Se < b.Se; });
^
In file included from /usr/include/c++/5/algorithm:62:0,
from cultivation.cpp:3:
/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:
cultivation.cpp:52:59: note: candidate expects 2 arguments, 3 provided
sort(P+1, P+1+N, [](pii a, pii b) { return a.Se < b.Se; });
^
In file included from /usr/include/c++/5/algorithm:62:0,
from cultivation.cpp:3:
/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:
cultivation.cpp: In substitution of 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = std::pair<int, int>*; _Compare = main()::<lambda(pii, pii)>]':
cultivation.cpp:52:59: required from here
cultivation.cpp:52:59: error: template argument for 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)' uses local type 'main()::<lambda(pii, pii)>'
sort(P+1, P+1+N, [](pii a, pii b) { return a.Se < b.Se; });
^
cultivation.cpp:52:59: error: trying to instantiate 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
cultivation.cpp:49:29: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d", &R, &C, &N);
^
cultivation.cpp:51:57: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(int i=1;i<=N;i++) scanf("%d%d", &P[i].Fi, &P[i].Se);
^