fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main() {
  7. // your code goes here
  8. vector<int> arr = {1,2,3,4,5};
  9. printf("%d", upper_bound(arr.begin(), arr.end(), 0) - arr.begin());
  10. return 0;
  11. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Standard output is empty