YZ.cpp: In function 'int main()':
YZ.cpp:77:20: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
segs.push_back(Seg{ -1, 0, 0, 0ll });
^
YZ.cpp:83:17: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
ramp[i] = Ramp{ x, d, t, p };
^
YZ.cpp:94:21: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
segs.push_back(Seg{ st, ed, i + 1, time });
^
YZ.cpp:99:2: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
});
^
YZ.cpp:99:3: error: no matching function for call to 'sort(std::vector<Seg>::iterator, std::vector<Seg>::iterator, main()::<lambda(const Seg&, const Seg&)>)'
});
^
In file included from /usr/include/c++/5/algorithm:62:0,
from YZ.cpp:4:
/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:
YZ.cpp:99:3: note: candidate expects 2 arguments, 3 provided
});
^
In file included from /usr/include/c++/5/algorithm:62:0,
from YZ.cpp:4:
/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:
YZ.cpp: In substitution of 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<Seg*, std::vector<Seg> >; _Compare = main()::<lambda(const Seg&, const Seg&)>]':
YZ.cpp:99:3: required from here
YZ.cpp:99:3: error: template argument for 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)' uses local type 'main()::<lambda(const Seg&, const Seg&)>'
});
^
YZ.cpp:99:3: error: trying to instantiate 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
YZ.cpp:109:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 1; i < segs.size(); ++i) {
^
YZ.cpp:115:3: warning: 'auto' changes meaning in C++11; please remove it [-Wc++0x-compat]
auto bt1res = bt1.query(istidx, (int)eds.size() - 1);
^
YZ.cpp:115:8: error: 'bt1res' does not name a type
auto bt1res = bt1.query(istidx, (int)eds.size() - 1);
^
YZ.cpp:116:20: error: 'bt1res' was not declared in this scope
long long vala = bt1res.first - segs[i].st + segs[i].time;
^
YZ.cpp:122:3: warning: 'auto' changes meaning in C++11; please remove it [-Wc++0x-compat]
auto bt2res = bt2.query(1, istidx - 1);
^
YZ.cpp:122:8: error: 'bt2res' does not name a type
auto bt2res = bt2.query(1, istidx - 1);
^
YZ.cpp:123:20: error: 'bt2res' was not declared in this scope
long long valb = bt2res.first + segs[i].st + segs[i].time;
^
YZ.cpp:113:7: warning: unused variable 'istidx' [-Wunused-variable]
int istidx = lower_bound(eds.begin(), eds.end(), segs[i].st) - eds.begin();
^
YZ.cpp:156:29: warning: format '%d' expects argument of type 'int', but argument 2 has type 'std::vector<int>::size_type {aka long unsigned int}' [-Wformat=]
printf("%d\n", trace.size());
^
YZ.cpp:157:15: warning: range-based 'for' loops only available with -std=c++11 or -std=gnu++11
for (int v : vector<int>(trace.rbegin(), trace.rend())) {
^
YZ.cpp:76:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d", &n, &L);
^
YZ.cpp:82:39: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d %d %d", &x, &d, &t, &p);
^