#26395: TLE python


zhengyouli547@gmail.com (hahaha)


想不到有什麼比較快的作法

while True:
    try:
        n,m=map(int,input().split())
        a=list(map(int,input().split()))
        for v in range(m):
             x,y=map(int,input().split())
             print(sum(a[x-1:y]))
    except:
        break
#26542: Re:TLE python


zhengyouli547@gmail.com (hahaha)


有人能提供想法嗎QQ

#26543: Re:TLE python


406490150@gms.tku.edu.tw (我是朱朱)


有人能提供想法嗎QQ


https://zerojudge.tw/ShowThread?postid=25101&reply=0