wall.cpp: In function 'void dbg_out()':
wall.cpp:5:18: error: 'cout' was not declared in this scope
5 | void dbg_out() { cout << endl; }
| ^~~~
wall.cpp:2:1: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
1 | #include "wall.h"
+++ |+#include <iostream>
2 |
wall.cpp:5:26: error: 'endl' was not declared in this scope
5 | void dbg_out() { cout << endl; }
| ^~~~
wall.cpp:2:1: note: 'std::endl' is defined in header '<ostream>'; did you forget to '#include <ostream>'?
1 | #include "wall.h"
+++ |+#include <ostream>
2 |
wall.cpp: In function 'void dbg_out(Head, Tail ...)':
wall.cpp:6:77: error: 'cout' was not declared in this scope
6 | template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cout << ' ' << H; dbg_out(T...); }
| ^~~~
wall.cpp:6:77: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
wall.cpp: At global scope:
wall.cpp:16:13: error: 'pair' does not name a type
16 | using pii = pair<LL,LL>;
| ^~~~
wall.cpp:26:71: error: expected class-name before '{' token
26 | template<typename T, typename = void> struct is_iterable : false_type {};
| ^
wall.cpp:27:44: error: 'void_t' was not declared in this scope
27 | template<typename T> struct is_iterable<T, void_t<decltype(begin(declval<T>())),decltype(end(declval<T>()))>> : true_type {};
| ^~~~~~
wall.cpp:2:1: note: 'std::void_t' is defined in header '<type_traits>'; did you forget to '#include <type_traits>'?
1 | #include "wall.h"
+++ |+#include <type_traits>
2 |
wall.cpp:27:66: error: 'declval' was not declared in this scope
27 | template<typename T> struct is_iterable<T, void_t<decltype(begin(declval<T>())),decltype(end(declval<T>()))>> : true_type {};
| ^~~~~~~
wall.cpp:2:1: note: 'std::declval' is defined in header '<utility>'; did you forget to '#include <utility>'?
1 | #include "wall.h"
+++ |+#include <utility>
2 |
wall.cpp:27:60: error: there are no arguments to 'begin' that depend on a template parameter, so a declaration of 'begin' must be available [-fpermissive]
27 | template<typename T> struct is_iterable<T, void_t<decltype(begin(declval<T>())),decltype(end(declval<T>()))>> : true_type {};
| ^~~~~
wall.cpp:27:60: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
wall.cpp:27:66: error: 'declval' was not declared in this scope
27 | template<typename T> struct is_iterable<T, void_t<decltype(begin(declval<T>())),decltype(end(declval<T>()))>> : true_type {};
| ^~~~~~~
wall.cpp:27:66: note: 'std::declval' is defined in header '<utility>'; did you forget to '#include <utility>'?
wall.cpp:27:75: error: expected primary-expression before '>' token
27 | template<typename T> struct is_iterable<T, void_t<decltype(begin(declval<T>())),decltype(end(declval<T>()))>> : true_type {};
| ^
wall.cpp:27:77: error: expected primary-expression before ')' token
27 | template<typename T> struct is_iterable<T, void_t<decltype(begin(declval<T>())),decltype(end(declval<T>()))>> : true_type {};
| ^
wall.cpp:27:60: error: there are no arguments to 'begin' that depend on a template parameter, so a declaration of 'begin' must be available [-fpermissive]
27 | template<typename T> struct is_iterable<T, void_t<decltype(begin(declval<T>())),decltype(end(declval<T>()))>> : true_type {};
| ^~~~~
wall.cpp:27:108: error: template argument 2 is invalid
27 | template<typename T> struct is_iterable<T, void_t<decltype(begin(declval<T>())),decltype(end(declval<T>()))>> : true_type {};
| ^~
wall.cpp:27:123: error: expected class-name before '{' token
27 | template<typename T> struct is_iterable<T, void_t<decltype(begin(declval<T>())),decltype(end(declval<T>()))>> : true_type {};
| ^
wall.cpp:28:31: error: expected nested-name-specifier before 'enable_if'
28 | template<typename T> typename enable_if<is_iterable<T>::value&&!is_same<T, string>::value,ostream&>::type operator<<(ostream &cout, T const &v);
| ^~~~~~~~~
wall.cpp:28:40: error: expected initializer before '<' token
28 | template<typename T> typename enable_if<is_iterable<T>::value&&!is_same<T, string>::value,ostream&>::type operator<<(ostream &cout, T const &v);
| ^
wall.cpp:29:34: error: 'ostream' does not name a type
29 | template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) { return cout << "(" << p.f << ", " << p.s << ")"; }
| ^~~~~~~
wall.cpp:30:31: error: expected nested-name-specifier before 'enable_if'
30 | template<typename T> typename enable_if<is_iterable<T>::value&&!is_same<T, string>::value,ostream&>::type operator<<(ostream &cout, T const &v) {
| ^~~~~~~~~
wall.cpp:30:40: error: expected initializer before '<' token
30 | template<typename T> typename enable_if<is_iterable<T>::value&&!is_same<T, string>::value,ostream&>::type operator<<(ostream &cout, T const &v) {
| ^
wall.cpp: In constructor 'Info::Info(LL, LL)':
wall.cpp:46:3: warning: 'Info::R' is initialized with itself [-Winit-self]
46 | Info(LL L, LL r) : L(L), R(R) {}
| ^~~~
wall.cpp: In member function 'Info& Info::operator+=(const Info&)':
wall.cpp:59:17: error: 'max' was not declared in this scope
59 | this->L = max(this->L, o.L);
| ^~~
wall.cpp:60:17: error: 'min' was not declared in this scope
60 | this->R = min(this->R, o.R);
| ^~~
wall.cpp: In member function 'Info Merge::operator()(const Info&, const Info&)':
wall.cpp:76:13: error: 'min' was not declared in this scope
76 | ret.L = min(a.L, b.L);
| ^~~
wall.cpp:77:13: error: 'max' was not declared in this scope
77 | ret.R = max(a.R, b.R);
| ^~~
wall.cpp: At global scope:
wall.cpp:82:39: error: 'plus' does not name a type
82 | template<typename T, typename Merge = plus<T>, typename LazyOp=LL>
| ^~~~
wall.cpp:82:43: error: expected '>' before '<' token
82 | template<typename T, typename Merge = plus<T>, typename LazyOp=LL>
| ^
wall.cpp:85:3: error: 'vector' does not name a type
85 | vector<T> tr;
| ^~~~~~
wall.cpp:86:3: error: 'vector' does not name a type
86 | vector<LazyOp> lazy_inc;
| ^~~~~~
wall.cpp:87:3: error: 'vector' does not name a type
87 | vector<bool> tag_inc;
| ^~~~~~
wall.cpp:96:18: error: expected ')' before '<' token
96 | lazy_seg(vector<LL> a) : lazy_seg((int)a.size()) {
| ~ ^
| )
wall.cpp:124:58: error: 'LazyOp' does not name a type
124 | void up_inc(int z, int l, int r, int ql, int qr, const LazyOp& val) {
| ^~~~~~
wall.cpp:152:35: error: 'LazyOp' does not name a type
152 | void up_inc(int l, int r, const LazyOp& val) { return up_inc(1, 0, n - 1, l, r, val); }
| ^~~~~~
wall.cpp: In member function 'void lazy_seg<T, Merge>::pull(int)':
wall.cpp:91:5: error: 'tr' was not declared in this scope
91 | tr[z] = merge(tr[2 * z], tr[2 * z + 1]);
| ^~
wall.cpp: In constructor 'lazy_seg<T, Merge>::lazy_seg(int)':
wall.cpp:94:27: error: class 'lazy_seg<T, Merge>' does not have any field named 'tr'
94 | lazy_seg(int n) : n(n), tr(4 * n + 5), lazy_inc(4 * n + 5), tag_inc(4 * n + 5), merge(Merge()) {}
| ^~
wall.cpp:94:42: error: class 'lazy_seg<T, Merge>' does not have any field named 'lazy_inc'
94 | lazy_seg(int n) : n(n), tr(4 * n + 5), lazy_inc(4 * n + 5), tag_inc(4 * n + 5), merge(Merge()) {}
| ^~~~~~~~
wall.cpp:94:63: error: class 'lazy_seg<T, Merge>' does not have any field named 'tag_inc'
94 | lazy_seg(int n) : n(n), tr(4 * n + 5), lazy_inc(4 * n + 5), tag_inc(4 * n + 5), merge(Merge()) {}
| ^~~~~~~
wall.cpp: In member function 'void lazy_seg<T, Merge>::push(int, int, int)':
wall.cpp:112:9: error: 'tag_inc' was not declared in this scope
112 | if (tag_inc[z]) {
| ^~~~~~~
wall.cpp:113:7: error: 'tr' was not declared in this scope; did you mean 'r'?
113 | tr[z] += lazy_inc[z];
| ^~
| r
wall.cpp:113:16: error: 'lazy_inc' was not declared in this scope
113 | tr[z] += lazy_inc[z];
| ^~~~~~~~
wall.cpp:120:5: error: 'tag_inc' was not declared in this scope
120 | tag_inc[z] = false;
| ^~~~~~~
wall.cpp:121:5: error: 'lazy_inc' was not declared in this scope
121 | lazy_inc[z] = LazyOp();
| ^~~~~~~~
wall.cpp:121:19: error: there are no arguments to 'LazyOp' that depend on a template parameter, so a declaration of 'LazyOp' must be available [-fpermissive]
121 | lazy_inc[z] = LazyOp();
| ^~~~~~
wall.cpp: In member function 'void lazy_seg<T, Merge>::up_inc(int, int, int, int, int, const int&)':
wall.cpp:128:7: error: 'lazy_inc' was not declared in this scope
128 | lazy_inc[z] += val;
| ^~~~~~~~
wall.cpp:129:7: error: 'tag_inc' was not declared in this scope
129 | tag_inc[z] = true;
| ^~~~~~~
wall.cpp:134:29: error: there are no arguments to 'min' that depend on a template parameter, so a declaration of 'min' must be available [-fpermissive]
134 | up_inc(2 * z, l, m, ql, min(qr, m), val);
| ^~~
wall.cpp:135:33: error: there are no arguments to 'max' that depend on a template parameter, so a declaration of 'max' must be available [-fpermissive]
135 | up_inc(2 * z + 1, m + 1, r, max(ql, m + 1), qr, val);
| ^~~
wall.cpp: In member function 'T lazy_seg<T, Merge>::query(int, int, int, int, int)':
wall.cpp:143:14: error: 'tr' was not declared in this scope; did you mean 'r'?
143 | return tr[z];
| ^~
| r
wall.cpp:147:30: error: there are no arguments to 'min' that depend on a template parameter, so a declaration of 'min' must be available [-fpermissive]
147 | query(2 * z, l, m, ql, min(qr, m)),
| ^~~
wall.cpp:148:34: error: there are no arguments to 'max' that depend on a template parameter, so a declaration of 'max' must be available [-fpermissive]
148 | query(2 * z + 1, m + 1, r, max(ql, m + 1), qr)
| ^~~
wall.cpp: In function 'void buildWall(int, int, int*, int*, int*, int*, int*)':
wall.cpp:157:3: error: 'vector' was not declared in this scope
157 | vector<int> a(n, 0);
| ^~~~~~
wall.cpp:2:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
1 | #include "wall.h"
+++ |+#include <vector>
2 |
wall.cpp:157:10: error: expected primary-expression before 'int'
157 | vector<int> a(n, 0);
| ^~~
wall.cpp:159:29: error: wrong number of template arguments (3, should be at least 1)
159 | lazy_seg<Info, Merge, Info> tree(a);
| ^
wall.cpp:83:8: note: provided for 'template<class T, class Merge> struct lazy_seg'
83 | struct lazy_seg {
| ^~~~~~~~
wall.cpp:159:36: error: 'a' was not declared in this scope
159 | lazy_seg<Info, Merge, Info> tree(a);
| ^
wall.cpp:165:10: error: request for member 'up_inc' in 'tree', which is of non-class type 'int'
165 | tree.up_inc(l, r, val);
| ^~~~~~
wall.cpp:169:27: error: request for member 'query' in 'tree', which is of non-class type 'int'
169 | finalHeight[i] = tree.query(i,i).L;
| ^~~~~