Problem gap
User YeoBL20
Submission Time 2023-01-02 22:27:24
Score 0
Max Time N/A
Max Memory N/A

Compile Error

gap.cpp: In function ‘long long int findGap(int, int)’:
gap.cpp:19:36: error: ‘max’ was not declared in this scope; did you mean ‘std::max’?
19 | for (int i = 1; i < N; i++) ans = max(ans, a[i] - a[i - 1]);
| ^~~
| std::max
In file included from /usr/include/c++/9/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
from gap.cpp:2:
/usr/include/c++/9/bits/stl_algo.h:3468:5: note: ‘std::max’ declared here
3468 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~