?
# | Author | Problem | Lang | Verdict | Time | Memory | Sent | Judged | |
---|---|---|---|---|---|---|---|---|---|
169756749 |
Practice: navyamedi_2002 |
1709B - 11 | Python 3 | Accepted | 623 ms | 31592 KB | 2022-08-27 07:23:09 | 2022-08-27 07:23:09 |
_,(*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])
?
?
?
?