diff --git a/swea/1859.py b/swea/1859.py new file mode 100644 index 0000000..b8fb1dc --- /dev/null +++ b/swea/1859.py @@ -0,0 +1,14 @@ +t=int(input()) + +for tc in range(1,t+1): + n=int(input()) + arr=list(map(int,input().split())) + + mx=0 + r=0 + for i in range(1,n+1): + if arr[-i]>mx: + mx=arr[-i] + else: + r+=mx-arr[-i] + print("#"+str(tc),r)