|
|
back to boardRuntime 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 Because of the way you are getting input. http://ideone.com/COmKqTMaybe 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 |
|
|