Language: C++

#include <iostream>

using namespace std;

int a[100000], b[100000], min, max = 0, n, t, c;

int main() {
	cin >> n >> t;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	min = a[0];
	for (int i = 0; i < n; i++) {
		b[i] = a[i] - min;
		if (b[i] < 0)min = a[i];
		if (b[i] > max)max = b[i];
	}

	for (int i = 0; i < n; i++) {
		if (b[i] == max)c++;
	}

	cout << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: reference to 'min' is ambiguous
   12 |         min = a[0];
      |         ^~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:5:27: note:                 'int min'
    5 | int a[100000], b[100000], min, max = 0, n, t, c;
      |                           ^~~
a.cc:14:31: error: reference to 'min' is ambiguous
   14 |                 b[i] = a[i] - min;
      |                               ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:5:27: note:                 'int min'
    5 | int a[100000], b[100000], min, max = 0, n, t, c;
      |                           ^~~
a.cc:15:30: error: reference to 'min' is ambiguous
   15 |                 if (b[i] < 0)min = a[i];
      |                              ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:5:27: note:                 'int min'
    5 | int a[100000], b[100000], min, max = 0, n, t, c;
      |                           ^~~
a.cc:16:28: error: reference to 'max' is ambiguous
   16 |                 if (b[i] > max)max = b[i];
      |                            ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:                 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:5:32: note:                 'int max'
    5 | int a[100000], b[100000], min, max = 0, n, t, c;
      |                                ^~~
a.cc:16:32: error: reference to 'max' is ambiguous
   16 |                 if (b[i] > max)max = b[i];
      |                                ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:                 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:5:32: note:                 'int max'
    5 | int a[100000], b[100000], min, max = 0, n, t, c;
      |                                ^~~
a.cc:20:29: error: reference to 'max' is ambiguous
   20 |                 if (b[i] == max)c++;
      |                             ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:                 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:5:32: note:                 'int max'
    5 | int a[100000], b[100000], min, max = 0, n, t, c;
      |                                ^~~