Language: C++

#include <cstdio>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <cstdlib>
#include <complex>

using namespace std;

typedef pair<int , int> P2;
typedef pair<pair<int , int> , int> P3;
typedef pair<pair<int , int> , pair<int , int> > P4;
#define Fst first
#define Snd second
#define PB(a) push_back(a)
#define MP(a , b) make_pair((a) , (b))
#define M3P(a , b , c) make_pair(make_pair((a) , (b)) , (c))
#define M4P(a , b , c , d) make_pair(make_pair((a) , (b)) , make_pair((c) , (d)))
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)
#define repv(t,it,v) for(vector<t>::iterator it = v.begin() ; it != v.end() ; ++it)

typedef complex<double> vec2;

const double EA = 1e-9;

double dot(vec2 a , vec2 b){
	return a.real() * b.real() + a.imag() * b.imag();
}

double cross(vec2 a , vec2 b){
	return a.real() * b.imag() - a.imag() * b.real();
}

double pab(vec2 a , vec2 b){
	return abs(vec2(a - b));
}

double dis(vec2 a , vec2 b , vec2 c){
	return fabs(cross(a - c , b - c)) / pab(b , c);
}

int x1,x2,x3,y1,y2,y3;
vec2 p1,p2,p3;
vec2 q;
double h;
double d1,d2,d3;

bool eval(double a){
	return d3 * (h-a) / h >= 2 * a;
}

double BS(double a , double b , int t){
	double c = (a+b) / 2.0;
	if(t == 100) return c;
	return eval(c) ? BS(c,b,t+1) : BS(a,c,t+1);
}

int main(){
	scanf("%d%d%d%d%d%d" , &x1 , &y1 , &x2 , &y2 , &x3 , &y3);
	p1 = vec2(x1,y1);
	p2 = vec2(x2,y2);
	p3 = vec2(x3,y3);
	d1 = pab(p2,p3);
	d2 = pab(p3,p1);
	d3 = pab(p1,p2);
	if(d1 >= d2 && d1 >= d3){
		swap(p1,p3);
		swap(d1,d3);
	} else if(d2 >= d3 && d2 >= d1){
		swap(p2,p3);
		swap(d2,d3);
	}
	double s = d1+d2+d3;
	q = d1 / s * p1 + d2 / s * p2 + d3 / s * p3;
	h = dis(q,p1,p2);
	if(h==0.0) return 0;
	printf("%.9f\n" , BS(0.0,h,0));
	return 0;
}


Compiler output:
a.cc:46:14: error: 'int y1' redeclared as different kind of entity
   46 | int x1,x2,x3,y1,y2,y3;
      |              ^~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cstdio:41,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
  257 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:64:24: error: no matching function for call to 'std::complex<double>::complex(int&, double (&)(double) noexcept)'
   64 |         p1 = vec2(x1,y1);
      |                        ^
In file included from a.cc:9:
/usr/include/c++/14/complex:1986:3: note: candidate: 'constexpr std::complex<double>::complex(const std::complex<long double>&)'
 1986 |   complex<double>::complex(const complex<long double>& __z)
      |   ^~~~~~~~~~~~~~~
/usr/include/c++/14/complex:1986:3: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/complex:1534:26: note: candidate: 'constexpr std::complex<double>::complex(const std::complex<float>&)'
 1534 |       _GLIBCXX_CONSTEXPR complex(const complex<float>& __z)
      |                          ^~~~~~~
/usr/include/c++/14/complex:1534:26: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/complex:1525:28: note: candidate: 'constexpr std::complex<double>::complex(const std::complex<double>&)'
 1525 |       _GLIBCXX14_CONSTEXPR complex(const complex&) = default;
      |                            ^~~~~~~
/usr/include/c++/14/complex:1525:28: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/complex:1514:26: note: candidate: 'constexpr std::complex<double>::complex(double, double)'
 1514 |       _GLIBCXX_CONSTEXPR complex(double __r = 0.0, double __i = 0.0)
      |                          ^~~~~~~
/usr/include/c++/14/complex:1514:59: note:   no known conversion for argument 2 from 'double(double) noexcept' to 'double'
 1514 |       _GLIBCXX_CONSTEXPR complex(double __r = 0.0, double __i = 0.0)
      |                                                    ~~~~~~~^~~~~~~~~
/usr/include/c++/14/complex:1512:26: note: candidate: 'constexpr std::complex<double>::complex(_ComplexT)'
 1512 |       _GLIBCXX_CONSTEXPR complex(_ComplexT __z) : _M_value(__z) { }
      |                          ^~~~~~~
/usr/include/c++/14/complex:1512:26: note:   candidate expects 1 argument, 2 provided