Language: C++

#include <bits/stdc++.h>
 
const double pi = 3.141592653589793238462643383279;
 
 
using namespace std;
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
 
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
 
//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007
 
 
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
 
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const double EPS = 1E-10;
 
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)


//ここから編集
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int N; cin >> N;

  string s;
  cout << 0 << endl;
  flush(cin);

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

  if(s == "Famale"){

    int lb = 0, ub = N;
    for(int i=0; i<19; i++){
      int mid = (lb+ub) >> 1;
      
      cout << mid << endl;
      flush(cin);
      string t;
      cin >> t;

      if(t == "Vacant"){
        cout << mid << endl;
        return 0;
      }
      if(mid % 2 == 1){
        if(t == "Male"){
          lb = mid;
        }else{
          ub = mid;
        }
      }else{
        if(t == "Male"){
          ub = mid;
        }else{
          lb = mid;
        }
      }
    }
  }else{

    int lb = 0, ub = N;
    for(int i=0; i<19; i++){
      int mid = (lb+ub) >> 1;
      
      cout << mid << endl;
      flush(cin);
      string t;
      cin >> t;

      if(t == "Vacant"){
        cout << mid << endl;
        return 0;
      }
      if(mid % 2 == 1){
        if(t == "Male"){
          ub = mid;
        }else{
          lb = mid;
        }
      }else{
        if(t == "Male"){
          lb = mid;
        }else{
          ub = mid;
        }
      }
    }
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:8: error: no matching function for call to 'flush(std::istream&)'
   65 |   flush(cin);
      |   ~~~~~^~~~~
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:1:
/usr/include/c++/14/ostream:766:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::flush(basic_ostream<_CharT, _Traits>&)'
  766 |     flush(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~~
/usr/include/c++/14/ostream:766:5: note:   template argument deduction/substitution failed:
a.cc:65:8: note:   'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
   65 |   flush(cin);
      |   ~~~~~^~~~~
a.cc:80:12: error: no matching function for call to 'flush(std::istream&)'
   80 |       flush(cin);
      |       ~~~~~^~~~~
/usr/include/c++/14/ostream:766:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::flush(basic_ostream<_CharT, _Traits>&)'
  766 |     flush(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~~
/usr/include/c++/14/ostream:766:5: note:   template argument deduction/substitution failed:
a.cc:80:12: note:   'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
   80 |       flush(cin);
      |       ~~~~~^~~~~
a.cc:109:12: error: no matching function for call to 'flush(std::istream&)'
  109 |       flush(cin);
      |       ~~~~~^~~~~
/usr/include/c++/14/ostream:766:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::flush(basic_ostream<_CharT, _Traits>&)'
  766 |     flush(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~~
/usr/include/c++/14/ostream:766:5: note:   template argument deduction/substitution failed:
a.cc:109:12: note:   'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
  109 |       flush(cin);
      |       ~~~~~^~~~~