Problem:


Score : 200 points

Problem Statement

There are N gems. The value of the i-th gem is V_i.

You will choose some of these gems, possibly all or none, and get them.

However, you need to pay a cost of C_i to get the i-th gem.

Let X be the sum of the values of the gems obtained, and Y be the sum of the costs paid.

Find the maximum possible value of X-Y.

Constraints

All values in input are integers.

1 \leq N \leq 20

1 \leq C_i, V_i \leq 50

Input

Input is given from Standard Input in the following format:

N
V_1 V_2 ... V_N
C_1 C_2 ... C_N

Output

Print the maximum possible value of X-Y.

Sample Input 1

3
10 2 5
6 3 4

Sample Output 1

5

If we choose the first and third gems, X = 10 + 5 = 15 and Y = 6 + 4 = 10.
We have X-Y = 5 here, which is the maximum possible value.

Sample Input 2

4
13 21 6 19
11 30 6 15

Sample Output 2

6

Sample Input 3

1
1
50

Sample Output 3

0



Sample input:
3
10 2 5
6 3 4


Sample output:
5

Submission status: Accepted

Solution code:
N=int(input())

V=list(map(int,input().split()))
C=list(map(int,input().split()))

ans = 0
for n in range(N):
	if 0 < V[n]-C[n]:
		ans += V[n]-C[n]

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int, input().split(" ")))
c = list(map(int, input().split(" ")))
x = 0
for i in range(n):
    x = (x + (v[i] - c[i])) if v[i] > c[i] else x
print(x)

Submission status: Accepted

Solution code:
n = int(input())
vs = input().split(" ")
cs = input().split(" ")
 
xy = 0
for i in range(n):
  v = int(vs[i])
  c = int(cs[i])
  if v>c:
    xy += v-c
 
print(xy)

Submission status: Accepted

Solution code:
import numpy as np
n=1
N=[input() for i in range(n)]
V=list(map(int, input().split()))
C=list(map(int, input().split()))
samu=0

for i in range(len(V)):
  kari=V[i]-C[i]
  if kari>=0:
    samu=samu+kari

print(samu)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))

L = []
for i in range(N):
    L.append(V[i] - C[i])

L.sort(reverse=True)
ans = 0
for i in range(N):
    if ans > ans+L[i]:
        break
    else:
        ans += L[i]

print(ans)

Submission status: Accepted

Solution code:
import numpy as np 

N = int(input())
C = [int(i) for i in input().split()]
V = [int(i) for i in input().split()] 
X = 0
Y = 0
for n in range(N):
	if(C[n]>V[n]):
		X += C[n]
		Y += V[n]

print(X-Y)

Submission status: Accepted

Solution code:
N = int(input())
V = input().split()
C = input().split()
Vnum=[]
Cnum=[]
res = 0
for i in range(N):
  Vnum.append(int(V[i]))
  Cnum.append(int(C[i]))
for i in range(N):
  if Vnum[i]>Cnum[i]:
    res += Vnum[i]-Cnum[i]
print(res)

Submission status: Accepted

Solution code:
n = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0
temp = []
for v,c in zip(V,C):
    temp.append(v-c)
temp.sort(reverse = True)
ans = 0

for t in temp:
    if t < 0:
        break
    ans += t
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
values = list(map(int, input().split()))
costs = list(map(int, input().split()))

max_cost = 0
for i in range(N):
  if values[i] > costs[i]:
    max_cost += values[i] - costs[i]

print(max_cost)

Submission status: Accepted

Solution code:
n = int(raw_input())
vs = [int(i) for i in raw_input().split()]
cs = [int(i) for i in raw_input().split()]

res = 0

for ind, v in enumerate(vs):
    if cs[ind] > v:
        continue
    res += v - cs[ind]

print(res)

Submission status: Accepted

Solution code:
N = int(input())
Vs = [int(s) for s in input().split()]
Cs = [int(s) for s in input().split()]
VC = [v-c for v, c in zip(Vs, Cs)]
print(sum([vc for vc in VC if vc > 0]))

Submission status: Accepted

Solution code:
#B
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
r = []
for i in range(N):
    r.append(V[i] - C[i])
r.sort()
ans = 0
for i in r:
    if i > 0:
        ans += i
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
V = input().split(" ")
V = [int(i) for i in V]
C = input().split(" ")
C = [int(i) for i in C]
list = [0]
ans = 0
X = 0
Y = 0
for i in range(N):
    if V[i] - C[i] > 0:
        X = V[i]
        Y = C[i]
        list.append(X - Y)
print(sum(list))

Submission status: Accepted

Solution code:
N = int(input())
v_list = list(map(int,input().split()))
c_list = list(map(int,input().split()))

ans = 0
for i in range(N):
    sub = v_list[i] - c_list[i]
    if sub>0:
        ans += sub
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = 0
for i in range(n):
  x = v[i] - c[i]
  if x >= 0:
    ans += x
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

V = []
for i in input().split():
    V.append(int(i))

C = []
for j in input().split():
    C.append(int(j))

total = 0
for k in range(N):
    p = V[k] - C[k]
    if p > 0:
        total =total + p

print(total)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = 0
for i in range(N):
    if V[i] > C[i]:
        ans += V[i] - C[i]
print(ans)

Submission status: Accepted

Solution code:

if __name__ == '__main__':
    n = int(input())
    v = list(map(int, input().split()))
    c = list(map(int, input().split()))

    result = 0
    for i in range(n):
        sa = v[i] - c[i]
        if(sa > 0):
            result += sa
    
    print(int(result))

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

cost = 0

for t in range(len(V)):
    if V[t] > C[t]:
        cost += V[t] - C[t]
print(cost)

Submission status: Accepted

Solution code:
n = int(input())
v = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
r = 0
for i,val in enumerate(v):
    if val > c[i]:
        r += val - c[i]
print(r)

Submission status: Accepted

Solution code:
N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
sa=[]
for i in range(N):
    sa.append(V[i]-C[i])
sa_sort=sorted(sa,reverse=True)
ans=0
for i in range(N):
    if sa_sort[i]>0:
        ans=ans+sa_sort[i]
    else:
        break
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
v_list = [int(i) for i in input().split()]
c_list = [int(i) for i in input().split()]

ans = 0
for i in range(n):
    if v_list[i] - c_list[i] > 0:
        ans += v_list[i] - c_list[i]
        
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
v=list(map(int, input().split()))
c=list(map(int, input().split()))

total=0
for i in range(n):
    if v[i]-c[i]>0:
        total+=v[i]-c[i]
print(total)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
values = list(map(int,input().split()))
costs = list(map(int,input().split()))
values_np = np.array(values)
costs_np = np.array(costs)

profits = values_np - costs_np
ans = 0

for p in profits:
    if p > 0:
        ans += p

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
v = []
for i in input().split():
    v.append(int(i))
c = []
for i in input().split():
    c.append(int(i))

d = []
for i in range(len(v)):
    d.append(max(v[i]-c[i], 0))

print(sum(d))

Submission status: Accepted

Solution code:
N = int(input())
listv = list(map(int, input().split()))
listc = list(map(int, input().split()))
sum1 = 0
for i in range(N):
    if(listv[i]>listc[i]):
        sum1 += listv[i]-listc[i]

print(sum1)

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for value, cost in zip(v,c):
    if value - cost > 0:
        ans += value - cost
print(ans)

Submission status: Accepted

Solution code:
n=input()
n=int(n)
vll=input().split()
vll=[int(i) for i in vll]
cll=input().split()
cll=[int(i) for i in cll]
count=0
ofset=0
for i in range(n):
    x=vll[ofset]
    y=cll[ofset]
    z=x-y
    if z>=0:
        count+=z
    ofset+=1
print(count)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
         

ans = 0
for v, c in zip(V, C):
  if v > c: ans += v - c
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
V=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
Z=[V[i]-C[i] for i in range(N)]
ans=0
for i in range(N):
    if Z[i]>0:
        ans+=Z[i]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
x = 0
y = 0

for i in range(n):
    if v[i] - c[i] > 0 :
        x += v[i]
        y += c[i]

print(x-y)

Submission status: Accepted

Solution code:
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
sum=0

for i in range(n):
    if v[i]-c[i]>0:
        sum+=v[i]-c[i]
    
print(sum)

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
cnt = 0

for i in range(n):
    if v[i] - c[i] > 0:
        cnt += v[i] - c[i]

print(cnt)

Submission status: Accepted

Solution code:
import sys
def p(*a):
  s=" ".join(map(str,a))
  #print(s)
  sys.stderr.write(s+"\n")


N=int(input())
V = [int(i) for i in input().split()]	# 1 2 3 4 5 ...
C = [int(i) for i in input().split()]	# 1 2 3 4 5 ...


p(N)
p(V)
p(C)

ans=0
for i in range(N):
	a = V[i]-C[i]
	if a>0: ans+=a

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = 0
for i in range(N):
    k = V[i] - C[i]
    if k>0:
        ans+=k

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N =int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0
for i in range(N):
    if V[i]-C[i] > 0:
        ans+=V[i]-C[i]
print(ans)

Submission status: Accepted

Solution code:
import numpy as np

N = input()
V = np.array([int(x) for x in input().split(" ")])
C = np.array([int(x) for x in input().split(" ")])

ans = V - C
idx = np.where(ans > 0)

print(ans[idx].sum())

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))

num = 0
a = []
for i in range(len(v)):
    a.append(v[i] - c[i])

a.sort(reverse=True)

for b in a:
    if b <= 0:
        break
    num += b

print(num)

Submission status: Accepted

Solution code:
N = int(input())
lst_V = list(map(int, input().split()))
lst_C = list(map(int, input().split()))
lst_diff = [v - c for v, c in zip(lst_V, lst_C) if (v - c) > 0]
ans = sum(lst_diff)
print(ans)

Submission status: Accepted

Solution code:
n=int(input())

v=[]
c=[]

line=input().split()

for i in range(n):
    v.append(int(line[i]))

line=input().split()

for i in range(n):
    c.append(int(line[i]))

sum=0

for i in range(n):
    if v[i]-c[i]>0:
        sum=sum+(v[i]-c[i])

print(sum)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))


c = 0
for i in range(N):
    if V[i] - C[i] > 0:
        c += V[i] - C[i]

print(c)

Submission status: Accepted

Solution code:
N = int(input())
V = map(int, input().split())
C = map(int, input().split())

D = [v - c for v, c in zip(V, C) if v - c > 0]

print(sum(D))

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
a = []
for i in range(n):
    if v[i]-c[i] > 0:
        a.append(v[i]-c[i])
print(sum(a))

Submission status: Accepted

Solution code:
n=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=0
for i in range(n):
  ans+=max(0,V[i]-C[i])
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
count1 = 0
count2 = 0
for s in range(n):
	if a[s] > b[s]:
		count1 += a[s]
		count2 += b[s]
print(count1 - count2)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int, input().split()))
b=list(map(int, input().split()))
x=0
for i in range(n):
	if b[i]<a[i]:
		x+=a[i]-b[i]
print(x)

Submission status: Accepted

Solution code:
N = int(input())
V_list = map(int, input().split())
C_list = map(int, input().split())

ans = 0
for v, c in zip(V_list, C_list):
    if v > c:
        ans += (v - c)

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
values = list(map(int, input().split()))
costs = list(map(int, input().split()))
gains = [values[i] - costs[i] for i in range(N) if values[i] - costs[i] > 0]
print(max(sum(gains), 0))

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
dif = 0
for N in range(n):
    if v[N] - c[N] > 0:
        dif += v[N] - c[N]
print(dif)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    n = input()
    obj = [int(i) for i in input().split()]
    costs = [int(i) for i in input().split()]
    print(sum([o - c for o, c in zip(obj, costs) if o - c > 0]))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

result = 0
for i in range(N):
    temp = V[i] - C[i]
    if temp >= 0:
        result += temp
print(result)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
Vn = list(map(int, input().split()))
Cn = list(map(int, input().split()))

ans = 0
for v,c in zip(Vn, Cn):
  if v - c > 0:
    ans += v - c

print(ans)

Submission status: Accepted

Solution code:
import math
import re

n = int(raw_input())
v = raw_input().split()
c = raw_input().split()
#s = list(raw_input())

cnt = 0
for i in v:
    v[cnt] = int(i)
    cnt += 1

cnt = 0
for i in c:
    c[cnt] = int(i)
    cnt += 1

total = 0
for i in range(n):
    if v[i] - c[i] > 0:
        total += v[i] - c[i]

print total

Submission status: Accepted

Solution code:
import numpy as np
n=int(input())
v=np.asarray(list(map(int, input().split())))
c=np.asarray(list(map(int, input().split())))
print(np.sum(np.where(v-c>=0,v-c,0)))

Submission status: Accepted

Solution code:
n=int(input())
v=list(map(int, input().split()))
c=list(map(int, input().split()))

xmy = 0
dp=[0]*n
dp[0] = max(v[0]-c[0], 0)
for i in range(1, n):
    dp[i] = max(dp[i-1]+v[i]-c[i], dp[i-1])
print(dp[-1])

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
x = []
for i in range(N):
    if V[i]-C[i] > 0:
        x.append(V[i]-C[i])
print(sum(x))

Submission status: Accepted

Solution code:
n = int(input())
res = 0
v = list(map(int,input().split()))
c = list(map(int,input().split()))

for i in range(n):
    if v[i] > c[i]:
        res += v[i] - c[i]
print(res)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().strip().split(' ')))
C = list(map(int, input().strip().split(' ')))
sum = 0

for i in range(N):
  sa = V[i] - C[i]
  if sa > 0:
    sum = sum + sa
    
print(sum)

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))

x = 0
for (i,j) in zip(v,c):
	if i-j > 0:
		x += (i-j)

print(x)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


def main():
    n = int(input())
    v = list(map(int, input().split()))
    c = list(map(int, input().split()))
    ans = 0

    for vi, ci in zip(v, c):
        if vi >= ci:
            ans += vi - ci

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=input()
V=map(int, raw_input().split())
C=map(int, raw_input().split())

ans=0
for v,c in zip(V,C):
	if v>=c:
		ans+=(v-c)
print ans

Submission status: Accepted

Solution code:
import numpy as np
n=int(input())
v = np.array(list(map(int,input().split())))
c= np.array(list(map(int,input().split())))
li=v-c
sum=0
for i in li:
    if i > 0:
        sum += i
print(sum)

Submission status: Accepted

Solution code:
N = int(input())
V = input().split()
C = input().split()

answer = 0
for i in range(N):
  if int(V[i]) > int(C[i]):
    answer += int(V[i]) - int(C[i])

print(answer)

Submission status: Accepted

Solution code:
N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))

cnt=0
for i in range(N):
    if V[i] - C[i] >=0:
        cnt += V[i] - C[i]
print(cnt)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

V = np.array(V)
C = np.array(C)

diff = V - C
print(np.sum(diff[diff>=1]))

Submission status: Accepted

Solution code:
N = int(input())
V = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
count = 0

for x in range(N):
    if V[x] >= C[x]:
        count += V[x] - C[x]

print(count)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))

vc = []
i = 0
for v in V:
    vc.append(V[i] - C[i])
    i += 1

d_sum = 0
for d in vc:
    if 0 < d:
        d_sum += d

print(d_sum)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0
for i in range(N):
  if V[i] - C[i] > 0:
    ans += V[i] - C[i]
print(ans)

Submission status: Accepted

Solution code:
import numpy as np

if __name__ == "__main__":
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))
    ans = 0
    for i in range (N):
        if(V[i] > C[i]):
            ans += V[i] - C[i]
    print(ans)

Submission status: Accepted

Solution code:
n = input()
vs = map(int, raw_input().split())
cs = map(int, raw_input().split())
t = 0
for i in xrange(n):
    v = vs[i]
    c = cs[i]
    if v - c > 0:
        t += v - c
print(t)

Submission status: Accepted

Solution code:
N = int(input())
V=input().split()
C=input().split()
Ans = 0
for i in range(N):
    net = int(V[i])-int(C[i])
    if net > 0:
        Ans = Ans + net
print(Ans)

Submission status: Accepted

Solution code:
n = input()
vs = map(int, input().split())
cs = map(int, input().split())

x_y = [v - c for v, c in zip(vs, cs)]

ans = sum([i for i in x_y if i > 0])
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))

ans = 0

for i in range(N):
    if V[i]-C[i] > 0:
        ans += V[i] - C[i]

print(ans)

Submission status: Accepted

Solution code:
import numpy as np

n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))

v=np.array(v)
c=np.array(c)

a=(v-c).tolist()
ans=0
for i in a:
    if(i>0):ans+=i

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
ans = 0
for i in range(N):
  if V[i] > C[i]:
    ans += V[i] - C[i]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
v = [int(_) for _ in input().split()]
c = [int(_) for _ in input().split()]
ans = 0

for i in range(n):
    a = v[i] - c[i]
    if a > 0:
        ans += a
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
V = [int(x) for x in stdin.readline().rstrip().split()]
C = [int(x) for x in stdin.readline().rstrip().split()]
a=0
for i in range(N):
    if V[i]-C[i] > 0:
        a += V[i] - C[i]
print(a)

Submission status: Accepted

Solution code:
n = int(input())
v = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
s = 0
for i in range(n):
    if v[i]-c[i] > 0:
        s += v[i]-c[i]

print(s)

Submission status: Accepted

Solution code:
n=int(input())
v=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]
ans=0
diff=[0]*n
for i in range(n):
    diff[i]=v[i]-c[i]
for i in range(n):
    if diff[i]>=0:
        ans+=diff[i]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

sum = 0
for i in range(N):
  if V[i] > C[i]:
    sum += V[i] - C[i]
    
print(sum)

Submission status: Accepted

Solution code:
n = int(input())
v_lst = list(map(int,input().split()))
c_lst = list(map(int,input().split()))
ans_lst = []


for i in range(n):
    ans_lst.append(v_lst[i]-c_lst[i])
ans_lst.sort(reverse=True)

ans = 0
for a in ans_lst:
    if a > 0:
        ans += a

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=0
for i in range(N):
  if V[i]>C[i]:
    ans+=V[i]-C[i]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))

d = []
for i in range(N):
    d.append(V[i]-C[i])

d = sorted(d,reverse=True)

ans = 0
for i in range(N):
    if d[i] < 0:
        break
    ans += d[i]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

S = 0

for i in range(len(V)):
    if V[i]-C[i] > 0 :
        S += V[i]-C[i]
print(S)

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))

v = np.array(v)
c = np.array(c)

diff = v - c

total = 0
for d in diff:
	if d > 0:
		total += d
print(total)

Submission status: Accepted

Solution code:
n = int(input())

v = [int(i) for i in input().split()] 
c = [int(i) for i in input().split()] 

s = 0

for i in range(n):
    if v[i] > c[i]:
        s += v[i] - c[i]

print(s)

Submission status: Accepted

Solution code:
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
Y = 0
for i in range(N):
  if V[i]>C[i] : Y += V[i]-C[i]
print(Y)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

n = int(input())
v = input().split()
c = input().split()

total = 0

for i in range(n):
    if int(v[i]) - int(c[i]) > 0:
        total += int(v[i]) - int(c[i])

print(total)

Submission status: Accepted

Solution code:
#スペース入力
n = int(input())
v = input().split()
c = input().split()



result = 0

for i in range(n):
        if int(v[i]) > int(c[i]):
            result = result + int(v[i])-int(c[i])


print(result)

Submission status: Accepted

Solution code:

N = input()
N = int(N)
V = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0
for i in range(N):
    if V[i] > C[i]:
        ans += V[i] - C[i]

print(str(ans))

Submission status: Accepted

Solution code:
# coding:utf-8


def main():
    N = int(input())
    value = list(map(int, input().split()))
    cost = list(map(int, input().split()))
    ans = 0
    for i in range(len(value)):
        if value[i] > cost[i]:
            ans += (value[i]-cost[i])
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
Vlist = [int(c) for c in input().split()]
Clist = [int(c) for c in input().split()]
plus = []
for i in range(N):
    a = Vlist[i]-Clist[i]
    plus.append(a)

ans =0
for i in plus:
    if i >= 0:
        ans += i

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
V = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]

ans = 0

for i in range(N):
    d = V[i] - C[i]
    if d > 0:
        ans += d

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
ans = 0

for i in range (N):
    if V[i] > C[i]:
        ans += V[i] - C[i]

print (ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    V = [int(v) for v in input().split()]
    C = [int(c) for c in input().split()]

    vcSum = 0

    for i in range(N):
        vc = V[i] - C[i]
        if vc > 0:
            vcSum += vc

    print(vcSum)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0

for i in range(n):
    if v[i] > c[i]:
        ans += v[i] - c[i]

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

sum = 0

for i in range(N):
    if V[i] - C[i] > 0:
        sum += V[i]-C[i]
        
print(sum)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

li = []
for i in range(N):
    if 0 < V[i] - C[i]:
        li.append(V[i] - C[i])

print(sum(li))

Submission status: Accepted

Solution code:
n=int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
result=0
for v,c in zip(V,C):
    if v-c>0:
        result+=v-c
print(result)

Submission status: Accepted

Solution code:
_ = input()
vs = map(int, input().split())
cs = map(int, input().split())

sum_ = 0
for v, c in zip(vs, cs):
    sub = v - c
    if sub > 0:
        sum_ += sub

print(sum_)

Submission status: Accepted

Solution code:
n = int(input())
v = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
vc = [[x/y, x-y] for x, y in zip(v, c)]
vc.sort(key=lambda x: x[0], reverse=True)
diff = 0
for a in vc:
    if a[0] > 1.0:
        diff += a[1]
print(diff)

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))

a = 0

for i in range(n):
    if v[i] >= c[i]:
        a = a + v[i] - c[i]

print(a)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0
for x in range(N):
    if V[x] > C[x]:
        ans += (V[x]-C[x]) 
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
ans=0

for i in range(n):
	if v[i]-c[i]>0:
		ans+=v[i]-c[i]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
b = 0

for i in range(N):
    if v[i] - c[i] > 0:
        b += v[i] - c[i]

print(b)

Submission status: Accepted

Solution code:
N = int(input())
v = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]

ans = 0
for i in range(N):
    if v[i] > c[i]:
        ans += v[i] - c[i]

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
v = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
ans = 0
for x,y in zip(v,c):
  if x-y >0:
    ans += x-y
print(ans)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
V = np.array(list(map(int,input().split())))	#1 2 3 4 5 ... n  li=[1,2,3,4,5,...,n]
C = np.array(list(map(int,input().split())))	#1 2 3 4 5 ... n  li=[1,2,3,4,5,...,n]
diff = V - C
sum = 0
for i in range(N):
    if diff[i] > 0:
        sum += diff[i]
print(sum)

Submission status: Accepted

Solution code:
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

print(sum([v - c for v, c in zip(V, C) if (v-c)>0]))

Submission status: Accepted

Solution code:
n = int(input())
vs = list(map(int, input().split()))
cs = list(map(int, input().split()))
res = 0

for i in range(n):
  if vs[i] > cs[i]:
    res += vs[i] - cs[i]

print(res)

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int,input().split()))	
c = list(map(int,input().split()))	

total = 0
for i in range(n):
    if v[i] > c[i]:
        total += v[i] - c[i]

print(total)

Submission status: Accepted

Solution code:
n = int(input())
list1 = list(map(int,input().split()))
list2 = list(map(int,input().split()))
list3 = []
for i in range(n):
  list3.append(list1[i]-list2[i])
sum = 0
for j in range(n):
  if list3[j] > 0:
    sum += list3[j]
print(sum)

Submission status: Accepted

Solution code:

N = int(input())
Vs = list(map(int,input().split()))
Cs = list(map(int,input().split()))
ans = 0
for i in range(N):
    if Vs[i] > Cs[i]:
        ans += Vs[i] - Cs[i]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))

def solve():
    ans = 0
    for v, c in zip(V, C):
        if v - c >= 0:
            ans += v - c

    return ans

print(solve())

Submission status: Accepted

Solution code:
N = int(input())
V = list(input().split())
C = list(input().split())

ret = 0

for i in range(N):
  m = int(V[i]) - int(C[i])
  if 0 < m :
    ret += m

print(ret)

Submission status: Accepted

Solution code:
n=int(input())
v=list(map(int, input().split()))
c=list(map(int, input().split()))

ans=0
for vi, ci in zip(v,c):
  if vi>ci:
    ans+=vi-ci
print(ans)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
Vlist = np.array(list(map(int,input().split())))
Clist = np.array(list(map(int,input().split())))

Dlist = Vlist-Clist

sum_ = 0
for d in Dlist:
    if d >= 0:
        sum_ += d

print(sum_)

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))

p = [v[i] - c[i] for i in range(n)]

ans = 0
for i in range(n):
    if p[i] > 0:
        ans = ans + p[i]

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

ans = 0
for i in range(N):
    if V[i] - C[i] > 0:
        ans += V[i] - C[i]
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
ben=0
for i in range(n):
    if v[i]>c[i]:
        
        ben+=v[i]-c[i]
print(ben)

Submission status: Accepted

Solution code:
# Resale

N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

def answer():
    ans = 0
    for i in range(N):
        profit = V[i] - C[i]
        if profit >= 0:
            ans += profit

    return ans

def main():
    print(answer())


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
a=[]
for i in range(n):
    a.append(v[i]-c[i])
ans=0
for x in a:
    if x>0:
        ans+=x
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
Vi = map(int, input().split())
Ci = map(int, input().split())

print(sum([max(0, v-c) for (v, c) in zip(Vi, Ci)]))

Submission status: Accepted

Solution code:
n=int(input())
lv=list(map(int,input().split()))
lc=list(map(int,input().split()))
s=0
for i in range(n):
    if lv[i]-lc[i]>0:
        s+=(lv[i]-lc[i])
print(s)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

sa = [V[i] - C[i] for i in range(N)]
print(sum([x for x in sa if x > 0]))

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0
for i in range(N):
    if V[i] - C[i] > 0:
        ans += V[i] - C[i]

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = 0
for i in range(N):
        if V[i] > C[i] :
                x = V[i] - C[i]
                ans += x
print(ans)