Borderou de evaluare (job #683151)
Utilizator |
|
IP | ascuns |
---|---|---|---|
Problemă | Rotate Search (clasa a 10-a) | Compilator | cpp-32 |
Rundă | Arhiva de probleme | Status | evaluat |
Dată | 21 dec. 2022 10:37:12 | Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In function 'int binarySearch(int, int, int, int)':
main.cpp:32:14: error: invalid types 'int[int]' for array subscript
32 | if (array[mid] == x)
| ^
main.cpp:35:14: error: invalid types 'int[int]' for array subscript
35 | if (array[mid] < x)
| ^
main.cpp: In function 'int main()':
main.cpp:61:36: error: invalid conversion from 'int*' to 'int' [-fpermissive]
61 | cout<<binarySearch(a, 0, n, x);
| ^
| |
| int*
main.cpp:27:22: note: initializing argument 1 of 'int binarySearch(int, int, int, int)'
27 | int binarySearch(int array, int low, int high, int x) {
| ~~~~^~~~~
main.cpp:47:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
47 | freopen("rotatesearch.in", "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:48:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
48 | freopen("rotatesearch.out", "w", stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~