ho_t5.cpp: In function 'int main()':
ho_t5.cpp:110:37: error: use of 'auto' in lambda parameter declaration only available with -std=c++14 or -std=gnu++14
for_each(res + 1, res + q + 1, [] (auto &i) { printf("%lld\n", i); } );
^~~~
ho_t5.cpp: In lambda function:
ho_t5.cpp:110:66: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type 'int' [-Wformat=]
for_each(res + 1, res + q + 1, [] (auto &i) { printf("%lld\n", i); } );
~^
In file included from /usr/include/c++/7/algorithm:62:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
from ho_t5.cpp:1:
/usr/include/c++/7/bits/stl_algo.h: In instantiation of '_Funct std::for_each(_IIter, _IIter, _Funct) [with _IIter = long long int*; _Funct = main()::<lambda(int&)>]':
ho_t5.cpp:110:71: required from here
/usr/include/c++/7/bits/stl_algo.h:3884:5: error: no match for call to '(main()::<lambda(int&)>) (long long int&)'
__f(*__first);
~~~^~~~~~~~~~
/usr/include/c++/7/bits/stl_algo.h:3884:5: note: candidate: void (*)(int&) <conversion>
/usr/include/c++/7/bits/stl_algo.h:3884:5: note: conversion of argument 2 would be ill-formed:
/usr/include/c++/7/bits/stl_algo.h:3884:5: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
ho_t5.cpp:110:44: note: candidate: main()::<lambda(int&)> <near match>
for_each(res + 1, res + q + 1, [] (auto &i) { printf("%lld\n", i); } );
^
ho_t5.cpp:110:44: note: conversion of argument 1 would be ill-formed:
In file included from /usr/include/c++/7/algorithm:62:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
from ho_t5.cpp:1:
/usr/include/c++/7/bits/stl_algo.h:3884:5: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
__f(*__first);
~~~^~~~~~~~~~
ho_t5.cpp: In function 'int main()':
ho_t5.cpp:49:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d", &n, &q);
~~~~~^~~~~~~~~~~~~~~~~
ho_t5.cpp: In lambda function:
ho_t5.cpp:50:48: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for_each(s + 1, s + n + 1, [] (int &i) { scanf("%d", &i); });
~~~~~^~~~~~~~~~
ho_t5.cpp: In lambda function:
ho_t5.cpp:52:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d %d", &i.t, &i.l, &i.r); });
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~