m getting a runtime error "NZEC #0" on my submission of problem 1716 http://www.spoj.com/problems/GSS3/1
here's my code
n=int(raw_input())
a=[]
str = raw_input()
a=str.split(' ')
i=0
while i<n:
a[i]=int(a[i])
i+=1
m=int(raw_input())
while m>0:
choice,x,y =raw_input().split(' ')
choice=int(choice)
x=int(x)
y=int(y)
if choice == 0: #modify a[x]-> y
a[x-1] = y
else: #print max{ai + ai+1 + ... + aj}
c = a[x-1:y]
sum = 0
for i in c:
sum += i
c = sorted(c)
max = c[len(c)-1]
if sum > max:
print sum
else:
print max
m -= 1
[color=#BF0000]plss help !!![/color]
created
last reply
- 3
replies
- 936
views
- 3
users
- 2
links