Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- //#include <bits/stdc++.h>
- using namespace std;
- const int maxn = 1e5 + 10;
- int main()
- {
- int n, x;
- cin >> n >> x;
- int a[n];
- for(int i = 0; i < n; i++) {
- cin >> a[i];
- }
- int idx = lower_bound(a, a + n, x) - a;
- if(idx >= 0 and idx < n) {
- cout << idx << endl;
- }
- else {
- cout << "Ne postoi " << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment