long_mansion.cpp: In function 'int main()':
long_mansion.cpp:57:15: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
57 | if (x >= 0 && (hi[x] >= l[i] && hi[x] <= r[i]) || (lo[x] >= l[i] && lo[x] <= r[i])) {
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
long_mansion.cpp:62:22: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
62 | if (r[i] < n - 1 && (hi[r[i]] >= l[i] && hi[r[i]] <= r[i]) || (lo[r[i]] >= l[i] && lo[r[i]] <= r[i])) {
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
long_mansion.cpp:53:21: warning: unused variable 'y' [-Wunused-variable]
53 | for (int i = 0, x, y; i < n; i++) {
| ^
long_mansion.cpp:8:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
8 | freopen(taskname".inp", "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
long_mansion.cpp:9:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
9 | freopen(taskname".out", "w", stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
long_mansion.cpp:13:11: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
13 | freopen(taskname".in", "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
long_mansion.cpp:14:11: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
14 | freopen(taskname".out", "w", stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~