I am a beginner computational thinking programmer and am doing some basic problems for Australian Informatics Olympiad practice problems.
Here's the link to the question
This is my code so far:
inputfile = open("sitin.txt", "r")
outputfile = open("sitout.txt", "w")
r = 0
s = 0
t = 0
sit = 0
stand = 0
seats_available = 0
#Reading integers from input file
r, s = map(int, inputfile.readline().split())
t = map(int, inputfile.readline().split())
#Conducting the operations
seats_available = r * s
if t > seats_available:
sit = r*s
stand = t - seats_available
else:
sit = t
stand = 0
#Writing answer in the output file
outputfile.write(sit + "" + stand + "\n")
outputfile.close()
inputfile.close()
Here's the error I get:
Traceback (most recent call last):
line 25, in <module>
if t > seats_available:
TypeError: '>' not supported between instances of 'map' and 'int'
Any help would be much appreciated!