CCF提交30分:
a = list(map(int,input().split()))
b = list(map(int,input().split()))
sum = 0
while a[1]>0:
c = list(map(int,input().split()))
if c[0]==1:
for i in range(c[1],(c[2]+1)):
if b[i-1]%c[3] == 0:
b[i-1]=b[i-1]/c[3]
a[1]-=1
elif c[0]==2:
for i in range(c[1],(c[2]+1)):
sum += b[i-1]
print(round(sum))
sum = 0
a[1]-=1
https://blog.csdn.net/Fitzzzz/article/details/81910175
python用了树状数组之后,还是超时,不过从30分提到50分了。。
java c++ 都可以通过
难道这道题python真的没法满分吗。