UVA-414 Machined Surfaces Solution in Python

while True:
x = int(input())
if x == 0:
break
minimum = 25
ls = []
for i in range(x):
s = input().strip()
index1 = s.find(" ")
if index1 >= 0:
index2 = s.find("X", index1)
delta = index2 - index1
ls.append(delta)
if delta < minimum:
minimum = delta
else:
ls.append(0)
minimum = 0
result = 0
for i in range(x):
result = result + ls[i] - minimum
print(result)

Comments

Popular posts from this blog

uva 679 - Dropping Balls Solution

uva 481 - What Goes Up Solution

uva-10077 Solution --- The Stern-Brocot Number System