মুনতাসির উপল45w
Getting WA in two cases 4 and 10. What's wrong with this code?
#include<cstdio>#include<algorithm>using namespace std;int beg_bin(int a[], int n, int x){int l = 0, r = n-1;while(l<=r) {int mid = (l+r)/2;if(a[mid] <= x && a[mid+1] > x)return a[mid];else if(a[mid] < x) l = mid+1;else r = mid-1;}}int end_bin(int a[], int n, int x){
Read more… (13 words)