monster.cpp: In function 'void rec(int, int, std::vector<int>&)':
monster.cpp:9:21: error: 'rand' was not declared in this scope
9 | int pivot = l + rand() % (r - l + 1);
| ^~~~
monster.cpp:30:5: error: 'cout' was not declared in this scope
30 | cout << "here: " << pivot << '\n';
| ^~~~
monster.cpp:2:1: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
1 | #include "monster.h"
+++ |+#include <iostream>
2 |
monster.cpp:31:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
31 | for (int i: v) cout << i << ' '; cout << '\n';
| ^~~
monster.cpp:31:38: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
31 | for (int i: v) cout << i << ' '; cout << '\n';
| ^~~~
monster.cpp: In function 'std::vector<int> Solve(int)':
monster.cpp:43:5: error: 'reverse' was not declared in this scope
43 | reverse(save.begin(), save.end());
| ^~~~~~~
monster.cpp:44:5: error: 'cout' was not declared in this scope
44 | cout << '\n';
| ^~~~
monster.cpp:44:5: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
monster.cpp:50:25: warning: unused variable 'l' [-Wunused-variable]
50 | int l = i + 1, r = i + 2;
| ^
monster.cpp:57:36: warning: unused variable 'r' [-Wunused-variable]
57 | int l = i - 2, r = i - 1;
| ^
monster.cpp:69:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
69 | for (int i: T) cout << i << ' '; cout << '\n';
| ^~~
monster.cpp:69:38: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
69 | for (int i: T) cout << i << ' '; cout << '\n';
| ^~~~