#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
int Search_Binary (vector<int> arr, int key)
{
int midd = 0, left =-1, right = arr.size();
|
|
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, w, h, l, r, k, index;
cin >> n >> k;
vector<int> A(n);
for (int i = 0; i < n; i++) {
cin >> A[i];
}
index = Search_Binary (A, k);
if (index >= 0)
cout << index+1 << endl;
else
cout << "NO" << endl;
return 0;
}
|