yeasung240 / algorithm

Records about algorithm theory that I learned
0 stars 0 forks source link

python Vliage #1

Open yeasung240 opened 7 months ago

yeasung240 commented 7 months ago

`

number = int(input())
vilage = []
size = 0 
realsize = 0 
for i in range(number):
    vilage.append(int(input()))

vilage.sort()    
size = ((vilage[1]-vilage[0])/2) + ((vilage[2]-vilage[1])/2)

for x in range(2,number-1):
    realsize = ((vilage[x]-vilage[x-1])/2) + ((vilage[x+1]-vilage[x])/2)
    if realsize < size:
        print(realsize)`