first commit

from old repository to a new repository
This commit is contained in:
Gyubin Han
2024-04-30 16:59:10 +09:00
commit 2600340c03
93 changed files with 1610 additions and 0 deletions

18
boj/11501.py Normal file
View 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)