?
# | Author | Problem | Lang | Verdict | Time | Memory | Sent | Judged | |
---|---|---|---|---|---|---|---|---|---|
166302452 |
Practice: xumengxing123 |
1709B - 11 | Python 3 | Accepted | 748 ms | 31580 KB | 2022-07-31 06:50:16 | 2022-07-31 06:50:16 |
_,(*a,),*r=(map(int,s.split())for s in open(0));b=[[0],[0]] for x in b: for u,v in zip([0]+a,a):x+=x[-1]+max(0,u-v), max=min for s,t in r:l=b[s>t];print(l[t]-l[s])
?
?
?
?