#!/usr/bin/env python import sys sys.setrecursionlimit(1000000000) # # Solution Template for Beautiful Buildings # # Australian Informatics Olympiad 2022 # # This file is provided to assist with reading and writing of the input # files for the problem. You may modify this file however you wish, or # you may choose not to use this file at all. # # N is the number of buildings. N = None # H contains the heights on the buildings. Note that here the buildings are # numbered starting from 0. H = [] answer = None # Open the input and output files. input_file = open("buildin.txt", "r") output_file = open("buildout.txt", "w") # Read the value of N. N = int(input_file.readline().strip()) # Read the heights. input_line = input_file.readline().strip() H = list(map(int, input_line.split())) # TODO: This is where you should compute your solution. Store the minimum # ugliness you can achieve into the variable answer. # Write the answer to the output file. output_file.write("%d\n" % (answer)) # Finally, close the input/output files. input_file.close() output_file.close()