ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1910. Titan Ruins: Hidden Entrance

Runtime Error
Posted by Tanay 28 Jun 2017 19:26
a=[]
n=int(input())
for i in range(0,n):
    f=(int,input())
    a.append(f)
sum=0
ans=0
for i in range(0,n-2):
    sum=0
    for f in range(i,i+3):
        sum=sum+a[f]
    if(sum>ans):
       ans=sum
       z=f
print(ans)
print(z)


#What could be the error in this. It works on my computer. Why do they show runtime error #when submitted??
Re: Runtime Error
Posted by Mahilewets 29 Jun 2017 08:56
Because of the way you are getting input.
 http://ideone.com/COmKqT
Maybe on your machine you are pressing Enter before after each number.  Maybe your interpeter is smarter than mine.
You should write:
a=list (map (int, input (). split ()))

 a