실행 실패 (제출 코드 컴파일 에러)
Main.c: In function ‘binary_search’: Main.c:10:18: warning: initialization of ‘int *’ from incompatible pointer type ‘long long int *’ [-Wincompatible-pointer-types] 10 | int* right = arr + N - 1; | ^~~ Main.c:12:16: warning: comparison of distinct pointer types lacks a cast 12 | while(left <= right){ | ^~ Main.c:13:44: error: invalid operands to binary - (have ‘int *’ and ‘long long int *’) 13 | long long int *mid = left + (right - left)/2; | ^ Main.c:19:19: warning: assignment to ‘int *’ from incompatible pointer type ‘long long int *’ [-Wincompatible-pointer-types] 19 | right = mid - 1; | ^ Main.c: In function ‘main’: Main.c:39:20: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘int’ [-Wformat=] 39 | printf("%lld\n", binary_search(arr, k, N)); | ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | int | long long int | %d Main.c:28:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 28 | scanf("%lld", &N); | ^~~~~~~~~~~~~~~~~ Main.c:32:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 32 | scanf("%lld", &arr[i]); | ^~~~~~~~~~~~~~~~~~~~~~ Main.c:36:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 36 | scanf("%lld", &M); | ^~~~~~~~~~~~~~~~~ Main.c:38:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 38 | scanf("%lld", &k); | ^~~~~~~~~~~~~~~~~
정답 개수:
-
틀린 개수:
-
실행 실패 개수:
-
반례를 발견하지 못했습니다.