Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <limits>

using namespace std;

int count,min;

void pre(vector<vector<int> > &tree,int now)
{
	cout << " " << tree[now][0];
	for(int i=1;i<3;i++)
	{
		if(tree[now][i] != min)
		{
			pre(tree,tree[now][i]);
		}
	}
}

void ino(vector<vector<int> > &tree,int now)
{
	int size = tree[now].size();
	if(tree[now][1] == min && tree[now][2] == min)
	{
		cout << " " << tree[now][0];
	}
	else
	{
		if(tree[now][1]!=min)
		{
			ino(tree,tree[now][1]);
		}
		cout << " " << tree[now][0];
		if(tree[now][2]!=min)
		{
			ino(tree,tree[now][2]);
		}
	}
}

void print(vector<vector<int> > &tree)
{
	ino(tree,0);
	cout << endl;
	pre(tree,0);
	cout << endl;
}

void insert(vector<vector<int> > &tree,int key,int now)
{
	if(count == 0)					//root none
	{
		tree[0][0] = key;
	}
	else
	{
		if(tree[now][0] > key)		//left
		{
			if(tree[now][1] == min)	//child none
			{
				tree[now][1] = count;
				tree[count][0] = key;
			}
			else											//child exist
			{
				insert(tree,key,tree[now][1]);
			}
		}
		else						//right
		{
			if(tree[now][2] == min)	//child none
			{
				tree[now][2] = count;
				tree[count][0] = key;
			}
			else
			{
				insert(tree,key,tree[now][2]);
			}
		}
	}
}

void find(vector<vector<int> > &tree, int key)
{
	for(int i=0;i<count;i++)
	{
		if(tree[i][0] == key)
		{
			cout << "yes" << endl;
			return;
		}
	}
	cout << "no" << endl;
}

int main(void)
{
	count = 0;
	mint = numeric_limits<int>::min();
    vector<vector<int> > tree;
	int n,num;
	string command;
	cin >> n;
    tree = vector<vector<int> >(n,vector<int>(3,min));

	for(int i=0;i<n;i++)
	{
		cin >> command;
		if(command == "insert")
		{
			cin >> num;		//input node num
			insert(tree,num,0);
			count++;
		}
		else if(command == "print")
		{
			print(tree);
		}
		else if(command == "find")
		{
			cin >> num;
			find(tree,num);
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'void pre(std::vector<std::vector<int> >&, int)':
a.cc:15:36: error: reference to 'min' is ambiguous
   15 |                 if(tree[now][i] != min)
      |                                    ^~~
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:11: note:                 'int min'
    8 | int count,min;
      |           ^~~
a.cc: In function 'void ino(std::vector<std::vector<int> >&, int)':
a.cc:25:28: error: reference to 'min' is ambiguous
   25 |         if(tree[now][1] == min && tree[now][2] == 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:8:11: note:                 'int min'
    8 | int count,min;
      |           ^~~
a.cc:25:51: error: reference to 'min' is ambiguous
   25 |         if(tree[now][1] == min && tree[now][2] == 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:8:11: note:                 'int min'
    8 | int count,min;
      |           ^~~
a.cc:31:34: error: reference to 'min' is ambiguous
   31 |                 if(tree[now][1]!=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:8:11: note:                 'int min'
    8 | int count,min;
      |           ^~~
a.cc:36:34: error: reference to 'min' is ambiguous
   36 |                 if(tree[now][2]!=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:8:11: note:                 'int min'
    8 | int count,min;
      |           ^~~
a.cc: In function 'void insert(std::vector<std::vector<int> >&, int, int)':
a.cc:61:44: error: reference to 'min' is ambiguous
   61 |                         if(tree[now][1] == min) //child none
      |                                            ^~~
/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:11: note:                 'int min'
    8 | int count,min;
      |           ^~~
a.cc:73:44: error: reference to 'min' is ambiguous
   73 |                         if(tree[now][2] == min) //child none
      |                                            ^~~
/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:11: note:                 'int min'
    8 | int count,min;
      |           ^~~
a.cc: In function 'int main()':
a.cc:102:9: error: 'mint' was not declared in this scope; did you mean 'uint'?
  102 |         mint = numeric_limits<int>::min();
      |         ^~~~
      |         uint
a.cc:107:32: error: expected primary-expression before '(' token
  107 |     tree = vector<vector<int> >(n,vector<int>(3,min));
      |                                ^
a.cc:107:46: error: expected primary-expression before '(' token
  107 |     tree = vector<vector<int> >(n,vector<int>(3,min));
      |                                              ^
a.cc:107:49: error: reference to 'min' is ambiguous
  107 |     tree = vector<vector<int> >(n,vector<int>(3,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:8:11: note:                 'int min'
    8 | int count,min;
      |           ^~~