1 / 3
Oct 2014

I am having difficulty in problem SCOREBOARD: Who will be disapproved, the SPOJ.
how do I program be terminated with EOF in python?

while True:
cont=1
n=int(input())
lista={}
pior=10
piores=[]
for i in range(n):
nomee=str(input())
a=lista[nomee.split(" ")[0]]=int(nomee.split(" ")[1])
if a pior=a
for nome in lista.keys():
if lista[nome]==pior:
piores.append(nome)
piores.sort()
print("Instancia %d" %cont)
cont+=1
print("%s\n" %piores[-1])

  • created

    Oct '14
  • last reply

    May '15
  • 2

    replies

  • 1.0k

    views

  • 3

    users

Use code tags. Without indentation your code doesn't run at all.
A never ending loop cannot be a good solution.
Reading beyond EOF will cause an exception. That has to be catched.

7 months later

nomee=str(input())
a=lista[nomee.split(" ")[0]]=int(nomee.split(" ")[1])
if a