Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <utility>
#include <typeinfo>
#include <string>
#include <sstream>
using namespace std;

int stoi(string str){
    int ret;
    stringstream ss;
    ss << str;
    ss >> ret;
    return ret;
}

int main()
{
    string s;
    cin >> s;

    string y = s.substr(0, 4);
    string m = s.substr(5, 2);
    string d = s.substr(8, 2);
    int month = 0;
    if (m[0] == '0') {
        month = stoi(m.substr(0, 1));
    } else {
        month = stoi(m);
    }
    int year = stoi(y);
    int day = 0;
    if (d[0] == '0') {
        day = stoi(d.substr(0, 1));
    } else {
        day = stoi(d);
    }
    if (year < 2019) {
        cout << "Heisei" << endl;
    } else if (year == 2019 && month < 4) {
        cout << "Heisei" << endl;
    } else if (year == 2019 && month == 4 && day <= 30) {
        cout << "Heisei" << endl;
    } else {
        cout << "TBD" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:21: error: call of overloaded 'stoi(std::__cxx11::basic_string<char>)' is ambiguous
   29 |         month = stoi(m.substr(0, 1));
      |                 ~~~~^~~~~~~~~~~~~~~~
a.cc:11:5: note: candidate: 'int stoi(std::string)'
   11 | int stoi(string str){
      |     ^~~~
In file included from /usr/include/c++/14/string:54,
                 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/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
a.cc:31:21: error: call of overloaded 'stoi(std::string&)' is ambiguous
   31 |         month = stoi(m);
      |                 ~~~~^~~
a.cc:11:5: note: candidate: 'int stoi(std::string)'
   11 | int stoi(string str){
      |     ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
a.cc:33:20: error: call of overloaded 'stoi(std::string&)' is ambiguous
   33 |     int year = stoi(y);
      |                ~~~~^~~
a.cc:11:5: note: candidate: 'int stoi(std::string)'
   11 | int stoi(string str){
      |     ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
a.cc:36:19: error: call of overloaded 'stoi(std::__cxx11::basic_string<char>)' is ambiguous
   36 |         day = stoi(d.substr(0, 1));
      |               ~~~~^~~~~~~~~~~~~~~~
a.cc:11:5: note: candidate: 'int stoi(std::string)'
   11 | int stoi(string str){
      |     ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
a.cc:38:19: error: call of overloaded 'stoi(std::string&)' is ambiguous
   38 |         day = stoi(d);
      |               ~~~~^~~
a.cc:11:5: note: candidate: 'int stoi(std::string)'
   11 | int stoi(string str){
      |     ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~