first commit
from old repository to a new repository
This commit is contained in:
18
boj/11501.py
Normal file
18
boj/11501.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import sys
|
||||
input=sys.stdin.readline
|
||||
t=int(input().rstrip())
|
||||
|
||||
for _ in range(t):
|
||||
d=int(input().rstrip())
|
||||
arr=list(map(int,input().rstrip().split()))
|
||||
|
||||
mx=0
|
||||
s=0
|
||||
for i in range(d):
|
||||
a=arr.pop()
|
||||
|
||||
if mx<a:
|
||||
mx=a
|
||||
else:
|
||||
s+=(mx-a)
|
||||
print(s)
|
||||
Reference in New Issue
Block a user