Troublesome Frog (AIO Intermediate 2013) 3.x
Without going into the algorithm I see a few things that could be improved upon


Use with open(...) as ... instead of manually opening and closing
Use max() instead of the ... if ... else ... structure
Improve naming of your variables, PEP8 is a good guideline
Use if __name__ == __main__:
List comprehension at reading input




def froggin(fences):
    maximum = 0
    for idx in range(1, N - 1):
        left = min(fences[0: idx])
        right = min(fences[idx + 1:])
        middle = fences[idx]

    if left &lt; middle and right &lt; middle:
        new_max = middle - left + middle - right
        maximum = max(new_max, maximum)
    return maximum

if __name__ == '__main__':
    with open('frogin.txt', 'r') as infile:
        N = int(infile.readline())
        fences = [int(infile.readline()) for _ in range(N)]

    result = froggin(fences)

    with open('frogout.txt', 'w') as frogout:
        frogout.write(str(result))