Problem:


Distance

  Write a program which calculates the distance between two points P1(x1, y1) and P2(x2, y2).

Input

  Four real numbers x1, y1, x2 and y2 are given in a line.

Output

  Print the distance in real number. The output should not contain an absolute error greater than 10-4.

Sample Input

0 0 1 1

Sample Output

1.41421356



Sample input:
0 0 1 1


Sample output:
1.41421356

Submission status: Runtime Error

Solution code:
import math
x1, y1, x2, y2 = map(int, input().split())
x = x2 - x1
y = y2 - y1
result = x**2 + y**2
print(math.sqrt(result))

Submission status: Runtime Error

Solution code:
import math

x1,y1,x2,y2=map(int,input().split())
answer=(math.sqrt((x2-x1)**2+(y2-y1)**2))
print("{0:.8f}".format(answer))

Submission status: Runtime Error

Solution code:
import math

x1,y1,x2,y2=map(int,input().split())
answer=(math.sqrt((x2-x1)**2+(y2-y1)**2))
print("{0:.8f}".format(answer))
print()

Submission status: Runtime Error

Solution code:
import math
x1,y1,x2,y2 = map(int,input().split())
print(math.sqrt(math.pow((x2-x1),2)+math.pow((y2-y1),2)))

Submission status: Runtime Error

Solution code:
import math
x1, y1, x2, y2 = map(int, raw_input().split())
x, y = x2 - x1, y2 - y1
print math.sqrt(x**2 + y**2)

Submission status: Runtime Error

Solution code:
import math
xa,ya,xb,yb=map(int, input().split())
print(math.sqrt( (xa-xb)**2 + (ya-yb)**2 ))

Submission status: Runtime Error

Solution code:
import math
xa,ya,xb,yb=map(int, input().split())
print("{0:.8f}".format(math.sqrt( (xa-xb)**2 + (ya-yb)**2 )))

Submission status: Runtime Error

Solution code:
import math
x1, y1, x2, y2 = map(int, input().split())
print('%f' %(math.sqrt((x1-x2)**2 + (y1-y2)**2)))

Submission status: Runtime Error

Solution code:
import math

x1,y1,x2,y2 = input().split()

print(sqrt((x2-x1)^2 + (y2-y1)^2))

Submission status: Runtime Error

Solution code:
import math

x1,y1,x2,y2 = input().split()

print(math.sqrt((x2-x1)^2 + (y2-y1)^2))

Submission status: Runtime Error

Solution code:
import math

x1,y1,x2,y2 = input().split()

print(math.sqrt((x2-x1)**2 + (y2-y1)**2))

Submission status: Runtime Error

Solution code:
import math

str = input().split(' ')
x1 = int(str[0])
x2 = int(str[1])
y1 = int(str[2])
y2 = int(str[3])

result = (x1-y1)*(x1-y1) + (x2-y2)*(x2-y2)
result = math.sqrt(result) if result != 0 else 0

print('%.6f'%result)

Submission status: Runtime Error

Solution code:
import math
def main():
    x1, y1, x2, y2 = map(int, input().split())
    b = abs(x2 - x1)
    h = abs(y2 - y1)
    d = math.sqrt(b ** 2 + h ** 2)
    print(d)
    

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import math
def main():
    x1, y1, x2, y2 = map(int, input().split())
    b = abs(x2 - x1)
    h = abs(y2 - y1)
    d = math.sqrt(b ** 2 + h ** 2)
    print("{0:.8f}".format(d))


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
a,b,c,d=list(map(int,input().split))
print(((b-a)**2+(c-d)**2)**.5)

Submission status: Runtime Error

Solution code:
a,b,c,d=list(map(int,input().split()))
print(((b-a)**2+(c-d)**2)**.5)

Submission status: Runtime Error

Solution code:
a,b,c,d=list(map(int,input().split()))
print(((c-a)**2+(b-d)**2)**.5)

Submission status: Runtime Error

Solution code:
from math import sqrt

def main():

    x1, y1, x2, y2 = map(int, input().split())
    print(sqrt(abs(x2-x1)**2 + abs(y2-y1)**2))


main()

Submission status: Runtime Error

Solution code:
import math
x1,y1,x2,y2 = map(int, input().split())
print(math.sqrt(pow(x2-x1, 2) + pow(y2-y1, 2)))

Submission status: Runtime Error

Solution code:
import math

x1, y1, x2, y2 = [int(s) for s in input().split()]
print(math.sqrt((math.fabs(x1 - x2) ** 2) + (math.fabs(y1 - y2) ** 2)))

Submission status: Runtime Error

Solution code:
# -*-coding:utf-8

import math

def main():

    x1, y1, x2, y2 = map(int, input().split())

    print(math.sqrt(pow(x2-x1, 2) + pow(y2-y1, 2)))

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
x1,y1,x2,y2=map(int,input().split())
print(float((abs(x1-x2)**2)+abs(y1-y2)**2)**(1/2))

Submission status: Runtime Error

Solution code:
from math import sqrt
a, b, c, d = map(int, input().split())
print(sqrt((c - a)**2 + (d - b)**2))

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
print(pow((c-a)**2 + (d-b)**2, 0.5))

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
print(((a-c)**2+(b-d)**2)**0.5)

Submission status: Runtime Error

Solution code:
a=map(float,input().split())
print(((a[0]-a[2])**2+(a[1]-a[3])**2)**0.5)

Submission status: Runtime Error

Solution code:
import math
l = input().split()
x1 = int(l[0])
y1 = int(l[1])
x2 = int(l[2])
y2 = int(l[3])

a = pow((x2 - x1), 2) + pow((y2 - y1), 2)
ans = math.sqrt(a)
print("{0:.8f}".format(ans))

Submission status: Runtime Error

Solution code:
o,p,q,r = [int(i) for i in input().split()]
print(format(((q-o)**2+(r-p)**2)**(1/2), '.8f'))

Submission status: Runtime Error

Solution code:
x1,y1,x2,y2 = map(int,input().split())
distance = ( (x1 - x2)**2 + (y1 - y2)**2 )**(1/2)
print('{}'.format(distance))

Submission status: Runtime Error

Solution code:
import math

x1, y1, x2, y2 = map(int, input().split())

print("{a:5f}".format(a=math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2))))

Submission status: Runtime Error

Solution code:
import math

x1, y1, x2, y2 = map(int, input().split())

print("{a:5f}".format(
    a=math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2))))

Submission status: Runtime Error

Solution code:
import math
x1, y1, x2, y2 = map(int, input().split())
z = math.sqrt((x1-x2)**2 + (y1-y2)**2)
print(z)

Submission status: Runtime Error

Solution code:
import math
def hoge(a):
    return a * a
x1, y1, x2, y2 = map(int, input().split())
print (math.sqrt(hoge(math.fabs(x1-x2)) + hoge(math.fabs(y1-y2))))

Submission status: Runtime Error

Solution code:
# coding:utf-8
import math
array = map(int,raw_input().split())
x1 = array[0]
y1 = array[1]
x2 = array[2]
y2 = array[3]
answer = math.sqrt(math.pow(x2 - x1,2) + math.pow(y2 - y1,2))
print answer

Submission status: Runtime Error

Solution code:
data = list(map(int, input().split()))
print(((data[2]-data[0])**2+(data[3]-data[1])**2)**0.5)

Submission status: Runtime Error

Solution code:
data = list(map(int, input().split()))
print("{:.8f}".format(((data[2]-data[0])**2+(data[3]-data[1])**2)**0.5))

Submission status: Runtime Error

Solution code:
x1,y1,x2,y2 = [int(x) for x in input().split()]
print(((x1-x2)**2+(y1-y2)**2)**(1/2))

Submission status: Runtime Error

Solution code:
import math

def distance(a, b):
    return float('{:.9}'.format(math.sqrt((b[0] - a[0])**2 + (b[1] - a[1])**2)))

if __name__ == '__main__':
    x1, y1, x2, y2 = map(int, input().split())
    print(distance((x1, y1), (x2, y2)))

Submission status: Runtime Error

Solution code:
import math
x1, y1, x2, y2 = map(int, input().split())
print("{:.8f}".format(math.sqrt((x2-x1)**2 + (y2-y1)**2)))

Submission status: Runtime Error

Solution code:
x1, y1, x2, y2 = map(float, input().split())
print("{:4f}".format((x2-x1)**2 + (y2-y1)**2)**0.5)

Submission status: Runtime Error

Solution code:
x1, y1, x2, y2 = map(float, input().split())
print("{0:f}".format(sqrt((x1-x2)**2.0 + (y1-y2)**2.0)))

Submission status: Runtime Error

Solution code:
import numpy as np
x = list(map(float, input().split(' ')))
ans = np.sqrt(pow(x[0]-x[2], 2) + pow(x[1]-x[3], 2))
print("{0:.8f}".format(ans))

Submission status: Runtime Error

Solution code:
import math
val = str(input()).split()

numList = list(map(int, list(val)))

print(math.sqrt(((numList[2]-numList[0]) ** 2) + ((numList[3]-numList[1]) ** 2)))

Submission status: Runtime Error

Solution code:
import math


def distance(p1, p2):
    """returns the distance between p1 and p2

    >>> d = distance((0, 0), (1, 1))
    >>> print("{:.5f}".format(d))
    1.41421
    """
    (x1, y1) = p1
    (x2, y2) = p2
    return math.sqrt((x2-x1)**2 + (y2-y1)**2)


def run():
    x1, y1, x2, y2 = [int(i) for i in input().split()]

    print("{:.5f}".format(distance((x1, y1), (x2, y2))))


if __name__ == '__main__':
    run()

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3

import math


def distance(p1, p2):
    """returns the distance between p1 and p2

    >>> d = distance((0, 0), (1, 1))
    >>> print("{0:.5f}".format(d))
    1.41421
    """
    (x1, y1) = p1
    (x2, y2) = p2
    return math.sqrt((x2-x1)**2 + (y2-y1)**2)


def run():
    x1, y1, x2, y2 = [int(i) for i in input().split()]

    print("{0:.5f}".format(distance((x1, y1), (x2, y2))))


if __name__ == '__main__':
    run()

Submission status: Runtime Error

Solution code:
def distance(p1, p2):
    """returns the distance between p1 and p2

    >>> d = distance((0, 0), (1, 1))
    >>> print("{0:.5f}".format(d))
    1.41421
    """
    (x1, y1) = p1
    (x2, y2) = p2
    return math.sqrt((x2-x1)**2 + (y2-y1)**2)


def run():
    x1, y1, x2, y2 = [float(i) for i in input().split()]

    print("{0:.5f}".format(distance((x1, y1), (x2, y2))))


if __name__ == '__main__':
    run()

Submission status: Runtime Error

Solution code:
import math
x1, y1, x2, y2 = map(float, input().split())  
 print(math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2))

Submission status: Runtime Error

Solution code:
from math import sort
x1, y1, x2, y2 = map(float, input().split())  
 print(math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2))

Submission status: Runtime Error

Solution code:
#coding: utf-8
import math

x1, y1, x2, y2 = (int(i) for i in input().split())
print(math.sqrt((x2-x1)+(y2-y1)))

Submission status: Runtime Error

Solution code:
import numpy
numlist = list(map(int, input().split()))
a = numpy.array([numlist[0], numlist[1]])
b = numpy.array([numlist[2], numlist[3]])
u = b - a
print(numpy.linalg.norm(u))

Submission status: Runtime Error

Solution code:
import numpy
numlist = list(map(float, input().split()))
a = numpy.array([numlist[0], numlist[1]])
b = numpy.array([numlist[2], numlist[3]])
u = b - a
print(numpy.linalg.norm(u))

Submission status: Runtime Error

Solution code:
import math

x1,y1,x2,y2 = tuple(int(n) for n in input().split())
D = math.sqrt((x2-x1)**2 + (y2-y1)**2)
print("{:.8f}".format(D))

Submission status: Runtime Error

Solution code:
import math
x1, y1, x2, y2 = map(int, input().split())
X = x1 - x2
Y = y1 - y2
print('{:.5f}'.format(math.sqrt(X * X + Y * Y)))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

import math

x1, y1, x2, y2 = map(int, input().split())
dis = math.sqrt((x1 + x2) * (x1 + x2) + (y1 + y2) * (y1 + y2))
print(dis)

Submission status: Runtime Error

Solution code:
#! python3
# distance.py

import math

x1, y1, x2, y2 = [int(x) for x in input().split(' ')]
print('%.5f'%math.sqrt(pow(x2-x1, 2) + pow(y2-y1, 2)))

Submission status: Runtime Error

Solution code:
import math
a,b,c,d = map(int,input().split())
print(math.sqrt(((c-a)**2) + ((d-b)**2)))

Submission status: Runtime Error

Solution code:
import math
l=input().split()
x1=int(l[0])
y1=int(l[1])
x2=int(l[2])
y2=int(l[3])

A=math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
print(A)

Submission status: Runtime Error

Solution code:
import math
def distance():
    x1,x2,x3,x4 = map(int, input().split())
    n = (x3 - x1)**2 + (x4 - x2)**2
    ans = math.sqrt(n)
    print(ans)
    
if __name__ == '__main__':
    distance()

Submission status: Runtime Error

Solution code:
import numpy as np
def distance():
    x1,x2,x3,x4 = map(float, input().split())
    n = (x3 - x1)**2 + (x4 - x2)**2
    ans = np.sqrt(n)
    print(ans)
    
if __name__ == '__main__':
    distance()

Submission status: Runtime Error

Solution code:
import numpy as np

x1,x2,x3,x4 = map(float, input().split())
n = (x3 - x1)**2 + (x4 - x2)**2
ans = np.sqrt(n)
print(ans)

Submission status: Runtime Error

Solution code:
import numpy

x1,x2,x3,x4 = map(float, input().split())
n = (x3 - x1)**2 + (x4 - x2)**2
ans = numpy.sqrt(n)
print(ans)

Submission status: Runtime Error

Solution code:
import math

def floatinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = float(a[i])
    return a
   
def main():
    a = numinput()
    x1 = a[0]; y1 = a[1]; x2 = a[2]; y2 = a[3]
    print(math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
   
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import math
 
def floatinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = float(a[i])
    return a
    
def main():
    a = numinput()
    x1 = a[0]; y1 = a[1]; x2 = a[2]; y2 = a[3]
    print(math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2))
    
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
from math import sqrt
x1,x2,y1,y2=map(int, print().split())
a=abs(x1-y1)
b=abs(x2-y2)
s=sqrt(a+b)
print(s)

Submission status: Runtime Error

Solution code:
from math import sqrt
x1,x2,y1,y2=map(double, print().split())
a=abs(x1-y1)
b=abs(x2-y2)
s=sqrt(a+b)
print(s)

Submission status: Runtime Error

Solution code:
from math import sqrt
x1,x2,y1,y2=map(float, print().split())
a=abs(x1-y1)
b=abs(x2-y2)
s=sqrt(a+b)
print(s)

Submission status: Runtime Error

Solution code:
import math

x1, y1, x2, y2 = map(int, input().split())
print(math.sqrt(abs(x2-x1)**2 + abs(y2-y1)**2))

Submission status: Runtime Error

Solution code:
import math
a, b, c, d = map(int, input().split())
s1 = (a - c) * (a - c)
s2 = (b - d) * (b - d)
print(math.sqrt(s1+s2))

Submission status: Runtime Error

Solution code:
import math
a, b, c, d = map(int, input().split())
s1 = (a - c) * (a - c)
s2 = (b - d) * (b - d)
print("%.6f"%math.sqrt(s1+s2))

Submission status: Runtime Error

Solution code:
import math
x1, y1, x2, y2 = map(int, input().split())
print(math.sqrt((y2-y1)**2 + (x2-x1)**2))

Submission status: Runtime Error

Solution code:
import math
x1, y1, x2, y2 = map(int, input().split())
print(((y2-y1)**2 + (x2-x1)**2)**(1/2))

Submission status: Runtime Error

Solution code:
x1, y1, x2, y2 = map(int, input().split())
print(((y2-y1)**2 + (x2-x1)**2)**(1/2))

Submission status: Runtime Error

Solution code:
# Distance

points = [int(i) for i in input().rstrip().split()]
a = [points[0], points[1]]
b = [points[2], points[3]]

distanceSquare = (a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2
distance = distanceSquare ** 0.5

print(distance)

Submission status: Runtime Error

Solution code:
import math

x1, y1, x2, y2 = map(int, input().split())
r = math.sqrt((x1 - x2) **2 + (y1 - y2) **2)
print(r)

Submission status: Runtime Error

Solution code:
import sys

for line in sys.stdin:
    x1, y1, x2, y2 = line.strip('\n')
    x1, y1, x2, y2 = int(x1), int(y1), int(x2), int(y2)
    print ((x1-x2)**2+(y1-y2)**2)**0.5

Submission status: Runtime Error

Solution code:
import sys

for line in sys.stdin:
    x1, y1, x2, y2 = line.strip('\n')
    x1, y1, x2, y2 = float(x1), float(y1), float(x2), float(y2)
    print ((x1-x2)**2+(y1-y2)**2)**0.5

Submission status: Runtime Error

Solution code:
import sys

for line in sys.stdin:
    x1, y1, x2, y2 = line.strip('\n').split()
    x1, y1, x2, y2 = float(x1), float(y1), float(x2), float(y2)
    print ((x1-x2)**2+(y1-y2)**2)**0.5

Submission status: Runtime Error

Solution code:
import math

n = map(int, raw_input().split())
ans=math.sqrt((n[0]-n[2])**2 + (n[1]-n[3])**2)
print ans

Submission status: Runtime Error

Solution code:
(n,m,o,p) = map(int, raw_input().split())
print ((n-o)**2 + (m-p)**2)**0.5

Submission status: Runtime Error

Solution code:
import math
inputlist=map(int,raw_input().split(","))
print math.sqrt((inputlist[0]-inputlist[1])**2-(inputlist[2]-inputlist[3])**2)

Submission status: Runtime Error

Solution code:
import math
inputlist=map(int,raw_input().split()))
print math.sqrt((inputlist[0]-inputlist[2])**2+(inputlist[1]-inputlist[3])**2)

Submission status: Runtime Error

Solution code:
import math
inputlist=map(int,raw_input().split())
print math.sqrt((inputlist[0]-inputlist[2])**2+(inputlist[1]-inputlist[3])**2)

Submission status: Runtime Error

Solution code:
inputlist=map(int,raw_input().split())
print math.sqrt((inputlist[0]-inputlist[2])**2+(inputlist[1]-inputlist[3])**2)

Submission status: Runtime Error

Solution code:
import math

x1, y1, x2, y2 = map(float, raw_input().split())

print sqrt((x2-x1)**2 + (y2-y1)**2)

Submission status: Runtime Error

Solution code:
import math

x1, y1, x2, y2 = raw_input().split()

print sqrt((x2-x1)**2 + (y2-y1)**2)

Submission status: Runtime Error

Solution code:
import math

x1, y1, x2, y2 = float(raw_input().split())

print sqrt((x2-x1)**2 + (y2-y1)**2)

Submission status: Runtime Error

Solution code:
import math

x1, y1, x2, y2 = raw_input().split()
x1 = float(x1)
x2 = float(x2)
y1 = float(y1)
y2 = float(y2)

print sqrt((x2-x1)**2 + (y2-y1)**2)

Submission status: Runtime Error

Solution code:
import math.py

x1, y1, x2, y2 = raw_input().split()

print sqrt((float(x2)-float(x1))**2 + (float(y2)-float(y1))**2)

Submission status: Runtime Error

Solution code:
import math

x1, y1, x2, y2 = map(raw_input().split())
print sqrt((float(x2)-float(x1))**2 + (float(y2)-float(y1))**2)