Problem arrayfind
User yq
Submission Time 2026-06-26 00:12:47
Score 0
Max Time N/A
Max Memory N/A

Compile Error

arrayfind.cpp: In function ‘int main()’:
arrayfind.cpp:16:17: error: ‘n’ was not declared in this scope
16 | int greater = n-(upper_bound(a.begin(), a.end(),x)-a.begin());
| ^
arrayfind.cpp:18:21: error: ‘smaller’ was not declared in this scope
18 | cout<<"Smaller: "<<smaller<< ", Greater: "<<greater<<endl;
| ^~~~~~~
arrayfind.cpp:18:53: error: missing template arguments before ‘<<’ token
18 | cout<<"Smaller: "<<smaller<< ", Greater: "<<greater<<endl;
| ^~