Problem arrayfind
User godex
Submission Time 2025-02-19 17:15:16
Score 0
Max Time N/A
Max Memory N/A

Compile Error

arrayfind.cpp: In function ‘int32_t main()’:
arrayfind.cpp:12:5: error: ‘sort’ was not declared in this scope; did you mean ‘qsort’?
12 | sort (a, a + n);
| ^~~~
| qsort
arrayfind.cpp:17:20: error: ‘r’ was not declared in this scope
17 | int l = 0; r = q - 1;
| ^
arrayfind.cpp:24:17: error: expected ‘}’ before ‘else’
24 | else r = mid - 1;
| ^~~~
arrayfind.cpp:21:28: note: to match this ‘{’
21 | if (a[mid] < x){
| ^
arrayfind.cpp:28:27: error: ‘ans’ was not declared in this scope; did you mean ‘abs’?
28 | cout << "Smaller:" << ans + 1 << ", "
| ^~~
| abs
arrayfind.cpp:32:16: error: ‘l’ was not declared in this scope
32 | while (l <= r){
| ^
arrayfind