Write an efficient function
int first_occurrence(double x, const vector<double>& v);
that returns the position of the first occurrence of in the vector . If does not belong to , return a -1.
The vector is sorted in nondecreasing order.
You only need to submit the required procedure; your main program will be ignored.
Author: Salvador Roura
Generation: 2026-03-10T18:56:21.017Z
© Jutge.org, 2006–2026.
https://jutge.org