servers.cpp: In function 'int main()':
servers.cpp:12:17: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'char*' [-Wformat=]
12 | scanf("%d", &c); scanf("%d", &c);
| ~^ ~~
| | |
| | char*
| int*
| %hhd
servers.cpp:12:34: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'char*' [-Wformat=]
12 | scanf("%d", &c); scanf("%d", &c);
| ~^ ~~
| | |
| | char*
| int*
| %hhd
servers.cpp:16:13: error: 'toright' was not declared in this scope
16 | toright[a] = toright[b] + 1;
| ^~~~~~~
servers.cpp:17:13: error: 'toleft' was not declared in this scope
17 | toleft[b] = toleft[a] + 1;
| ^~~~~~
servers.cpp:22:21: error: 'toright' was not declared in this scope
22 | if (toright[a] >= b - a) {
| ^~~~~~~
servers.cpp:30:21: error: 'toleft' was not declared in this scope
30 | if (toleft[a] >= a - b) {
| ^~~~~~
servers.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
10 | scanf("%d%d", &n, &q);
| ~~~~~^~~~~~~~~~~~~~~~
servers.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
12 | scanf("%d", &c); scanf("%d", &c);
| ~~~~~^~~~~~~~~~
servers.cpp:12:31: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
12 | scanf("%d", &c); scanf("%d", &c);
| ~~~~~^~~~~~~~~~
servers.cpp:14:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
14 | scanf("%d%d", &a, &b);
| ~~~~~^~~~~~~~~~~~~~~~
servers.cpp:20:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
20 | scanf("%d%d", &a, &b); // does a store b
| ~~~~~^~~~~~~~~~~~~~~~