Language: C++

#include <iostream>
#include <string>
using namespace std;

int N;
string str0, str1;

int min, max;

int main(void) {

	cin >> N;

	cout << 0 << endl;
	cin >> str0; if (str0 == "Vacant") { return 0; }

	cout << (N - 1) / 2 << endl;
	cin >> str1; if (str1 == "Vacant") { return 0; }

	if (str0 == str1) { min = 0; max = (N - 1) / 2; }
	else { min = (N - 1) / 2; max = N; }

	while (1) {
		int med = (min + max) / 2;
		string tmp;
		if ((max - min) % 2 == 0) { //even
			if ((med - min) % 2 == 0) { med--; }
			cout << med << endl;
			cin >> tmp; if (tmp == "Vacant") { return 0; }
			if (str0 == tmp) { max = med; str1 = tmp; }
			else { min = med; str0 = tmp; }
		}
		else { //odd
			if ((med - min) % 2 == 0) { med--; }
			cout << med << endl;
			cin >> tmp; if (tmp == "Vacant") { return 0; }
			if (str0 == tmp) { max = med; str1 = tmp; }
			else { min = med; str0 = tmp; }
		}

	}


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:29: error: reference to 'min' is ambiguous
   20 |         if (str0 == str1) { min = 0; max = (N - 1) / 2; }
      |                             ^~~
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:8:5: note:                 'int min'
    8 | int min, max;
      |     ^~~
a.cc:20:38: error: reference to 'max' is ambiguous
   20 |         if (str0 == str1) { min = 0; max = (N - 1) / 2; }
      |                                      ^~~
/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:8:10: note:                 'int max'
    8 | int min, max;
      |          ^~~
a.cc:21:16: error: reference to 'min' is ambiguous
   21 |         else { min = (N - 1) / 2; max = N; }
      |                ^~~
/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:8:5: note:                 'int min'
    8 | int min, max;
      |     ^~~
a.cc:21:35: error: reference to 'max' is ambiguous
   21 |         else { min = (N - 1) / 2; max = N; }
      |                                   ^~~
/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:8:10: note:                 'int max'
    8 | int min, max;
      |          ^~~
a.cc:24:28: error: reference to 'min' is ambiguous
   24 |                 int med = (min + max) / 2;
      |                            ^~~
/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:8:5: note:                 'int min'
    8 | int min, max;
      |     ^~~
a.cc:24:34: error: reference to 'max' is ambiguous
   24 |                 int med = (min + max) / 2;
      |                                  ^~~
/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:8:10: note:                 'int max'
    8 | int min, max;
      |          ^~~
a.cc:26:22: error: reference to 'max' is ambiguous
   26 |                 if ((max - min) % 2 == 0) { //even
      |                      ^~~
/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:8:10: note:                 'int max'
    8 | int min, max;
      |          ^~~
a.cc:26:28: error: reference to 'min' is ambiguous
   26 |                 if ((max - min) % 2 == 0) { //even
      |                            ^~~
/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:8:5: note:                 'int min'
    8 | int min, max;
      |     ^~~
a.cc:27:36: error: reference to 'min' is ambiguous
   27 |                         if ((med - min) % 2 == 0) { med--; }
      |                                    ^~~
/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:8:5: note:                 'int min'
    8 | int min, max;
      |     ^~~
a.cc:30:44: error: reference to 'max' is ambiguous
   30 |                         if (str0 == tmp) { max = med; str1 = tmp; }
      |                                            ^~~
/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:8:10: note:                 'int max'
    8 | int min, max;
      |          ^~~
a.cc:31:32: error: reference to 'min' is ambiguous
   31 |                         else { min = med; str0 = tmp; }
      |                                ^~~
/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:8:5: note:                 'int min'
    8 | int min, max;
      |     ^~~
a.cc:34:36: error: reference to 'min' is ambiguous
   34 |                         if ((med - min) % 2 == 0) { med--; }
      |                                    ^~~
/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:8:5: note:                 'int min'
    8 | int min, max;
      |     ^~~
a.cc:37:44: error: reference to 'max' is ambiguous
   37 |                         if (str0 == tmp) { max = med; str1 = tmp; }
      |                                            ^~~
/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:8:10: note:                 'int max'
    8 | int min, max;
      |          ^~~
a.cc:38:32: error: reference to 'min' is ambiguous
   38 |                         else { min = med; str0 = tmp; }
      |                                ^~~
/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:8:5: note:                 'int min'
    8 | int min, max;
      |     ^~~