towers.cpp: In member function 'void sgt2::build(std::vector<int>, int)':
towers.cpp:39:29: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
39 | memset(t, -0x3f, sizeof(t));
| ^
towers.cpp:44:3: warning: iteration 2146435072 invokes undefined behavior [-Waggressive-loop-optimizations]
44 | for (int i = off-1 ; i >= 1; i++){
| ^~~
towers.cpp:44:26: note: within this loop
44 | for (int i = off-1 ; i >= 1; i++){
| ~~^~~~
towers.cpp: In member function 'void sgt::build(std::vector<int>, int)':
towers.cpp:19:3: warning: iteration 2146435072 invokes undefined behavior [-Waggressive-loop-optimizations]
19 | for (int i = off-1 ; i >= 1; i++){
| ^~~
towers.cpp:19:26: note: within this loop
19 | for (int i = off-1 ; i >= 1; i++){
| ~~^~~~
towers.cpp:17:20: warning: array subscript <unknown> is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
17 | t[i+off] = {a[i]};
| ^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:17:11: warning: array subscript <unknown> is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
17 | t[i+off] = {a[i]};
| ~~~~~~~^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:17:11: warning: array subscript <unknown> is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
17 | t[i+off] = {a[i]};
| ~~~~~~~^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:17:11: warning: array subscript <unknown> is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
17 | t[i+off] = {a[i]};
| ~~~~~~~^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:17:11: warning: array subscript <unknown> is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
17 | t[i+off] = {a[i]};
| ~~~~~~~^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:17:11: warning: array subscript <unknown> is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
17 | t[i+off] = {a[i]};
| ~~~~~~~^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:17:11: warning: array subscript <unknown> is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
17 | t[i+off] = {a[i]};
| ~~~~~~~^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:17:11: warning: array subscript <unknown> is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
17 | t[i+off] = {a[i]};
| ~~~~~~~^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:17:11: warning: array subscript <unknown> is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
17 | t[i+off] = {a[i]};
| ~~~~~~~^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:17:11: warning: array subscript <unknown> is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
17 | t[i+off] = {a[i]};
| ~~~~~~~^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:17:11: warning: array subscript <unknown> is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
17 | t[i+off] = {a[i]};
| ~~~~~~~^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:17:11: warning: array subscript <unknown> is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
17 | t[i+off] = {a[i]};
| ~~~~~~~^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:17:11: warning: array subscript <unknown> is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
17 | t[i+off] = {a[i]};
| ~~~~~~~^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:13:46: warning: array subscript i is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
13 | merge(all(t[ls]),all(t[rs]), t[idx].begin());
| ^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:13:46: warning: array subscript <unknown> is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
13 | merge(all(t[ls]),all(t[rs]), t[idx].begin());
| ^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:13:46: warning: array subscript <unknown> is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
13 | merge(all(t[ls]),all(t[rs]), t[idx].begin());
| ^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp: In member function 'int sgt::get(int, int, int, int, int, int)':
towers.cpp:27:56: warning: array subscript mi is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
27 | return lower_bound(all(t[idx]), val) - t[idx].begin();
| ^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:27:56: warning: array subscript mi is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
27 | return lower_bound(all(t[idx]), val) - t[idx].begin();
| ^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:27:56: warning: array subscript lo is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
27 | return lower_bound(all(t[idx]), val) - t[idx].begin();
| ^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:27:56: warning: array subscript hi is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
27 | return lower_bound(all(t[idx]), val) - t[idx].begin();
| ^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:27:56: warning: array subscript mi is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
27 | return lower_bound(all(t[idx]), val) - t[idx].begin();
| ^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:27:56: warning: array subscript mi is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
27 | return lower_bound(all(t[idx]), val) - t[idx].begin();
| ^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp:27:56: warning: array subscript idx is outside array bounds of 'std::vector<int> [0]' [-Warray-bounds]
27 | return lower_bound(all(t[idx]), val) - t[idx].begin();
| ^
towers.cpp:10:14: note: while referencing 'sgt::t'
10 | vector<int> t[off<1];
| ^
towers.cpp: In member function 'int sgt2::get(int, int, int, int, int)':
towers.cpp:52:16: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
52 | return t[idx];
| ~~~~~^
towers.cpp:33:6: note: while referencing 'sgt2::t'
33 | int t[off<1];
| ^
towers.cpp:52:16: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
52 | return t[idx];
| ~~~~~^
towers.cpp:33:6: note: while referencing 'sgt2::t'
33 | int t[off<1];
| ^
towers.cpp:52:16: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
52 | return t[idx];
| ~~~~~^
towers.cpp:33:6: note: while referencing 'sgt2::t'
33 | int t[off<1];
| ^
towers.cpp:52:16: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
52 | return t[idx];
| ~~~~~^
towers.cpp:33:6: note: while referencing 'sgt2::t'
33 | int t[off<1];
| ^
towers.cpp:52:16: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
52 | return t[idx];
| ~~~~~^
towers.cpp:33:6: note: while referencing 'sgt2::t'
33 | int t[off<1];
| ^
towers.cpp:52:16: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
52 | return t[idx];
| ~~~~~^
towers.cpp:33:6: note: while referencing 'sgt2::t'
33 | int t[off<1];
| ^
towers.cpp:52:16: warning: array subscript idx is outside array bounds of 'int [0]' [-Warray-bounds]
52 | return t[idx];
| ~~~~~^
towers.cpp:33:6: note: while referencing 'sgt2::t'
33 | int t[off<1];
| ^
towers.cpp: In function 'int max_towers(int, int, int)':
towers.cpp:52:16: warning: array subscript 1 is outside array bounds of 'int [0]' [-Warray-bounds]
52 | return t[idx];
| ~~~~~^
towers.cpp:33:6: note: while referencing 'sgt2::t'
33 | int t[off<1];
| ^
towers.cpp:56:3: note: defined here 'seg2'
56 | } seg2;
| ^~~~