Problem p02805 (python)

Fixed submission:
import math

def f(a,b,x,y):
    ans=math.sqrt( (a-x)*(a-x) + (b-y)*(b-y) )
    return ans

def circumcenter(ax,ay,bx,by,cx,cy):
    d = 2 * (ax * (by - cy) + bx * (cy - ay) + cx * (ay - by))
    if d==0:
        return (-1,-1)
    ux = ((ax * ax + ay * ay) * (by - cy) + (bx * bx + by * by) * (cy - ay) + (cx * cx + cy * cy) * (ay - by)) / d
    uy = ((ax * ax + ay * ay) * (cx - bx) + (bx * bx + by * by) * (ax - cx) + (cx * cx + cy * cy) * (bx - ax)) / d
    return (ux, uy)

n=int(input())
x=[]
y=[]
for i in range(n):
    u,v=map(int,input().split())
    x.append(u)
    y.append(v)
if n==2:
    ans=f(x[0],y[0],x[1],y[1])/2
    print("%0.12f"%ans)
else:
    radius=20000
    for i in range(n):
        for j in range(i+1,n):
            for k in range(j+1,n):

                a,b=circumcenter(x[i],y[i],x[j],y[j],x[k],y[k])
                if a==-1 and b==-1:
                    continue
                r=f(a,b,x[i],y[i])

                ff=1
                for l in range(n):
                    if f(a,b,x[l],y[l])>r:
                        ff=0
                        break
                if ff:
                    radius=min(radius,r)
    for i in range(n):
        for j in range(i+1,n):
            a=(x[i]+x[j])/2
            b=(y[i]+y[j])/2
            r=f(x[i],y[i],x[j],y[j])/2
            ff=1
            for k in range(n):
                if f(a,b,x[k],y[k])>r:
                    ff=0
                    break
            if ff:
                radius=min(r,radius)
    print("%0.12f"%radius)

Buggy submission (verdict: Runtime Error):
import math

def f(a,b,x,y):
    ans=math.sqrt( (a-x)*(a-x) + (b-y)*(b-y) )
    return ans

def circumcenter(ax,ay,bx,by,cx,cy):
    d = 2 * (ax * (by - cy) + bx * (cy - ay) + cx * (ay - by))
    if d==0:
        return (-1,-1)
    ux = ((ax * ax + ay * ay) * (by - cy) + (bx * bx + by * by) * (cy - ay) + (cx * cx + cy * cy) * (ay - by)) / d
    uy = ((ax * ax + ay * ay) * (cx - bx) + (bx * bx + by * by) * (ax - cx) + (cx * cx + cy * cy) * (bx - ax)) / d
    return (ux, uy)

n=int(input())
x=[]
y=[]
for i in range(n):
    u,v=map(int,input().split())
    x.append(u)
    y.append(v)
if n==2:
    ans=f(x[0],y[0],x[1],y[1])/2
    print("%0.12f"%ans)
else:
    radius=20000
    for i in range(n):
        for j in range(i+1,n):
            for k in range(j+1,n):

                a,b=circumcenter(x[i],y[i],x[j],y[j],x[k],y[k])
                if a==-1 and b==-1:
                    continue
                r=f(a,b,x[i],y[i])

                ff=1
                for l in range(n):
                    if f(a,b,x[l],y[l])>r:
                        ff=0
                        break
                if ff:
                    radius=min(radius,r)
    if radius==20000:
        exit(1)
    print("%0.12f"%radius)

Buggy submission (verdict: Runtime Error):
#include<bits/stdc++.h>
#define ll long long int
#define M 1000000007
#define mod 998244353
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define pi pair<ll,ll>
using namespace std;
const ll N=500010;

ll power(ll x,ll n)
{
    if(n==0){return 1;}
    if(n==1){return x;}
    if(n%2==0){
        return power((x*x)%M,n/2);
    }
    if(n%2==1){
        return (power((x*x)%M,n/2)*x)%M;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    ll a=50*50*50*50;
    cout<<a;

    return (0);
}