TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):
n = int(input())
values = [int(i) for i in input().split()]
costs = [int(i) for i in input().split()]
result = 0

for i in range(n):
    if values[i] > costs[i]:
	result += values[i] - costs[i]

print(result)

n = int(input())
values = [int(i) for i in input().split()]
costs = [int(i) for i in input().split()]
result = 0

for i in range(n):
    if values[i] > costs[i]:
        result += values[i] - costs[i]

print(result)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int,input()
3
integer = int(0)
v = input().split()

c = input().split()
for i in range(n):
    if int(v[i])>int(c[i]):
            integer += int(v[i])-int(c[i])
            continue
    print(integer)


n = int,input()

integer = int(0)
v = input().split()

c = input().split()

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


n = int,input()

integer = int(0)
v = input().split()

c = input().split()

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


n = int(input())

integer = int(0)
v = input().split()

c = input().split()

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
A = input()

ans = 0

ALEN = (len(A))

B = list(A)



B_re =  list(reversed(B))

ans = 0


for i in range(ALEN):
    if B[i] != B_re[i]:
        ans = ans+1
    
if ans　% 2 == 0:
    print(ans//2)
elif ans %2 != 0:
    print((ans//2) +1)
elif ans == 0:
    print(0)

S = input()

ans = 0

ALEN = (len(S))
 
B = list(S)
 
 
 
B_re =  list(reversed(B))
 
ans = 0
 

 
for i in range(ALEN):
  if B[i] != B_re[i]:
        ans = ans+1
    
if ans % 2 == 0:
    print(ans//2)
elif ans %2 != 0:
    print((ans//2) +1)
elif ans == 0:
    print(0)

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 = ans + ((V[i]) - (C[i]))

print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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+=1
print(ans)

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)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())

value = list(map(int(input().split()))
cost = list(map(int(input().split()))

ans = 0
for j in range(n):
    if value[j] -cost[j] >0:
            ans +=value[j] - cost[j]

print(ans)



n = int(input())

value = list(map(int(input().split()))
cost = list(map(int(input().split()))

ans = 0
for j in range(n):
    if value[j] -cost[j] >0:
            ans +=value[j] - cost[j]

print(ans)



n = int(input())

value = list(map(int, input().split()))
cost = list(map(int, input().split()))

ans = 0
for j in range(n):
    if value[j] -cost[j] >0:
            ans +=value[j] - cost[j]

print(ans)



Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
A = list[int,input().split()]
B = list[int,input().split()]
i = 0
for c in range(N):
  if A[c]>B[c]:
    i += (A[c]-B[c])
print (i)

N = int(input())
A = list[int,input().split()]
B = list[int,input().split()]
i = 0
for c in range(N):
  if A[c]>B[c]:
    i = i +A[c]-B[c]
print (i)

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
G = [0] * N
for i in range(N):
    dif = V[i] - C[i]
    if(dif > 0):
        G[i] = dif
print(sum(G[i]))

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
def sub():
    N, Vs, Cs = [e for e in input().split(" ")]
    N = int(N)
    Vs = [int(e) for e in Vs.split(" ")]
    Cs = [int(e) for e in Cs.split(" ")]
    ds = [v - c for v, c in zip(Vs, Cs)]
    ds = [d for d in ds if d > 0]
    print(sum(ds))


sub()


def sub():
    N, Vs, Cs = [input() for _ in range(3)]
    N = int(N)
    Vs = [int(e) for e in Vs.split(" ")]
    Cs = [int(e) for e in Cs.split(" ")]
    ds = [v - c for v, c in zip(Vs, Cs)]
    ds = [d for d in ds if d > 0]
    print(sum(ds))


sub()


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list()
for benefit, cost in a, b:
  if benefit - cost > 0:
    c.append(benefit - cost)
print(sum(c))

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list()
for benefit, cost in zip(a, b):
  if benefit - cost > 0:
    c.append(benefit - cost)
print(sum(c))



Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
v = map(int, input().split())
c = map(int, input().split())
ans = 0
for i, j in zip(v, c):
  if i - j > 0:
    ans = i - j
print(ans)


n = int(input())
v = map(int, input().split())
c = map(int, input().split())
ans = 0
for i, j in zip(v, c):
  if i - j > 0:
    ans += i - j
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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))


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))


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a = int(input())
List=list(map(int,input().split()))
List2=list(map(int,input().split()))

print(List)
sum=0
i=0
while i < a:
  if List[i] - List2[i] > 0:
    sum += List[i] - List2[i]
  i +=1
print(sum)

a = int(input())
List=list(map(int,input().split()))
List2=list(map(int,input().split()))

sum=0
i=0
while i < a:
  if List[i] - List2[i] > 0:
    sum += List[i] - List2[i]
  i +=1
print(sum)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def main():
    n = get_next_int()
    values = get_next_ints()
    costs = get_next_ints()
    
    total = 0
    for value, cost in zip(values, costs):
        if value > cost:
            total += (value - cost)
    
    print(total)
    
if __name__ == '__main__':
    main()

def get_next_int():
    return int(float(input()))
def get_next_ints(delim=" "):
    return tuple([int(float(x)) for x in input().split(delim)])

def main():
    n = get_next_int()
    values = get_next_ints()
    costs = get_next_ints()
    
    total = 0
    for value, cost in zip(values, costs):
        if value > cost:
            total += (value - cost)
    
    print(total)
    
if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = _
V = list(map(int, input().split()))
C = list(map(int, input().split()))

print(sum(map(lambda p: max(0, p[0] - p[1]), zip(V, C))))


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

print(sum(map(lambda p: max(0, p[0] - p[1]), zip(V, C))))


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
v_l = [int(input()) for i in range(N)]
c_l = [int(input()) for i in range(N)]
net = [v_l[i] - c_l[i] for i in range(N)]
max = 0
for i in range(N):
  if net[i] > 0:
    max = max + net[i]
  else:
    max = max
print(max)

N = int(input())
v_l = list(map(int, input().split()))
c_l = list(map(int, input().split()))
net = [v_l[i] - c_l[i] for i in range(N)]
max = 0
for i in range(N):
  if net[i] > 0:
    max = max + net[i]
  else:
    max = max
print(max)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import numpy as np
n = int(input())
v = np.array(list(map(int,input().split())))
c = np.array(list(map(int,input().split())))

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

max_profit = np.sum(profit[profit>0])
print(max_profit)

import numpy as np
n = int(input())
v = np.array(list(map(int,input().split())))
c = np.array(list(map(int,input().split())))

profit = v - c

max_profit = np.sum(profit[profit>0])
print(max_profit)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
v=list(map(int, input().split()))
c=list(map(int, input().split()))

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


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

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
v,c = list(map(int,input().split())),list(map(int,input().split()))
ans = 0
for i in range(n):
    if v[i] > c[i]:
        ans += v[i] - c[i]

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
 = int(input())
v = list(map(int, input().strip().split(' ')))
c = list(map(int, input().strip().split(' ')))
l = [0] * n
for i in range(n):
  l[i]=v[i]-c[i]
l.sort(reverse=True)
s = 0
for i in range(n):
  if s < sum(l[0:i+1]):
    s = sum(l[0:i+1])
print(s)

n = int(input())
v = list(map(int, input().strip().split(' ')))
c = list(map(int, input().strip().split(' ')))
l = [0] * n
for i in range(n):
  l[i]=v[i]-c[i]
l.sort(reverse=True)
s = 0
for i in range(n):
  if s < sum(l[0:i+1]):
    s = sum(l[0:i+1])
print(s)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
# -*- coding: utf-8 -*-
import numpy as np
import itertools

# input
l = list(map(int, input().split()))
N = l[0]

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

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

best_result = 0


for n in range(N):
    print("n", n)

    v_list = list(itertools.combinations(V,n));
    c_list = list(itertools.combinations(C,n));
    for v, c in zip(v_list, c_list):
        X = sum(v)
        Y = sum(c)

        result = X - Y

        # Renew
        if best_result < result:
            best_result = result

print(best_result)




# -*- coding: utf-8 -*-
import numpy as np
import itertools

# input
l = list(map(int, input().split()))
N = l[0]

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

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

best_result = 0



for n in range(N+1):
    v_list = list(itertools.combinations(V,n));
    c_list = list(itertools.combinations(C,n));
    for v, c in zip(v_list, c_list):
        X = sum(v)
        Y = sum(c)

        result = X - Y

        # Renew
        if best_result <= result:
            best_result = result

print(best_result)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
  2 V=list(map(int,input().split()))
  3 C=list(map(int,input().split()))
  4 output = 0
  5 for i in range(N):
  6     if V[i]-C[i] >= 0:
  7         output +=V[i]-C[i]
  8
  9 print(output)

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

print(output)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
X = list(map(int, input().split())
Y = list(map(int, input().split())
ans = 0
         
for i in range(N):
         ans += max(X[i] - Y[i]), 0)

print(ans)
         

N = int(input())
X = list(map(int, input().split()))
Y = list(map(int, input().split()))
ans = 0
         
for i in range(N):
         ans += max(X[i] - Y[i], 0)

print(ans)
         


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N=int(input())
Vlist=list(map(int, input().split()))
Clist=list(map(int, input().split()))
print(Vlist)
ret=0

for i in range(N):
    if Vlist[i]-Clist[i] > 0:
        ret += Vlist[i]-Clist[i]
print(ret)

N=int(input())
Vlist=list(map(int, input().split()))
Clist=list(map(int, input().split()))

ret=0

for i in range(N):
    if Vlist[i]-Clist[i] > 0:
        ret += Vlist[i]-Clist[i]
print(ret)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
X = [V - C for (V, C) in zip(V, C)]
i = 0
for i in X:
    if i < 0:
        X.remove(i)

print(X)

N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
X = [V - C for (V, C) in zip(V, C)]
i = 0
a = 0
for i in X:
    if i > 0:
        a += i
print(a)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input().strip())
values = list(map(int, input().split()))
costs = list(map(int, input().split()))

sales = [v - c for v, c in zip(values, costs) if v > c else 0]

print(sum(sales))

n = int(input().strip())
values = list(map(int, input().split()))
costs = list(map(int, input().split()))
 
sales = [v - c for v, c in zip(values, costs) if v > c]
 
print(sum(sales))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
V = map(int, input().split())
C = map(int, input().split())

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

print(int(answer))

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

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
list_v = map(int,input().split())
list_c = map(int,input().split())
 
ans = 0
for i in range(n):
  if list_v[i] - list_c[i] > 0:
    ans += list_v[i] - list_c[i]
print(int(ans))

n = int(input())
list_v = map(int,input().split())
list_c = map(int,input().split())

ans = 0
for i in range(n):
  if list_v[i] - list_c[i] > 0:
    ans += list_v[i] - list_c[i]
return(int(ans))

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
from numpy import*;v,c=loadtxt(open(0),skiprows=1);i=v>c;print(sum(v[i]-c[i]))

from numpy import*;_,a,b=[int64(i.split())for i in open(0)];c=a-b;print(sum(c[c>0]))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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]:
        X = V[i]
        Y = V[i]
        X += X 
        Y += Y

if (X-Y) > 0:
    print(X-Y)

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]:
        v = V[i]
        c = C[i]
        X = X + v
        Y = Y + c
        print(X-Y)

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]:
        X = V[i]
        Y = V[i]
        X += X
        Y += Y

if (X-Y) > 0:
    print(X-Y)

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]:
        print(i)
        v = V[i]
        c = C[i]
        X = X + v
        Y = Y + c
        print(X-Y)

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]:
        v = V[i]
        c = C[i]
        X = X + v
        Y = Y + c

print(X-Y)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
from functools import reduce
import numpy as np
a = np.array(list(map(int, input().split())))
b = np.array(list(map(int, input().split())))
print(reduce(lambda x,y: max(0,x)+max(0,y), list(a-b)))

from functools import reduce
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
print(sum([max(0, a[i]-b[i]) for i in range(n)]))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input()
V = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
        
print(
  sum(
    max(v - c, 0) for v, c in zip(V,C)
  )
)

N = int(input())
V = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
            
print(
  sum(
    max(v - c, 0) for v, c in zip(V,C)
  )
)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
a=[int(input()) for _ range(n)]
b=[int(input()) for _ range(n)]

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

print(ans)

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

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

print(ans)

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

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

print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):

test = {}

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

new_n = 0
for i in range(N):
    if V[i] <=  C[i]:
        continue
    else:
        test[i] = [V[i],C[i]]
        new_n += 1

N = new_n

def calc_cost(com,test,i):
    x = 0
    y = 0
    for j in com:
        x += test[j][0]
        y += test[j][1]
    return x - y

ans = 0




for i in range(N):
    c = itertools.combinations(test.keys(), i+1)
    for j in c:
        ans = max(ans,calc_cost(j,test,i))


print(ans)
        
    

import itertools
N = int(input())

test = {}

V = list(map(int,input().split()))
C = list(map(int,input().split()))
new_n = 0
for i in range(N):
    if V[i] <=  C[i]:
        continue
    else:
        test[i] = [V[i],C[i]]
        new_n += 1

N = new_n

def calc_cost(com,test,i):
    x = 0
    y = 0
    for j in com:
        x += test[j][0]
        y += test[j][1]
    return x - y

ans = 0

for i in range(N):
    c = itertools.combinations(test.keys(), i+1)
    for j in c:
        ans = max(ans,calc_cost(j,test,i))


print(ans)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())

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

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

print(a)

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 += V[i]-C[i]

print(a)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input)
V=list(map(int, input().split()))
C=list(map(int, input().split()))

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

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
v=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]
vv=[]
cc=[]
ans=0
if n==1:
  ans = v[0]-c[0]
else:
  for i in range(n):
    vv.append(v[i])
    cc.append(c[i])
    for j in range(i+1, n):
      vv.append(vv[-1]+v[j])
      cc.append(cc[-1]+c[j])
  for i in range(len(vv)):
    ans=max(ans,vv[i]-cc[i])
if ans < 0:
  print(0)
else:  
  print(ans)      
   

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)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
V_list = np.array(list(map(int, input().split())))
C_list = np.array(list(map(int, input().split())))

diff = V_list - C_list

print(diff[diff > 0].sum())

import numpy as np
N = int(input())
V_list = np.array(list(map(int, input().split())))
C_list = np.array(list(map(int, input().split())))

diff = V_list - C_list

print(diff[diff > 0].sum())

Verdicts: Runtime Error

Accepted
Problem: 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.

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

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
V = map(int,input().split(" "))
C = map(int,input().split(" "))
P = []

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

result = list(filter(lambda x:x>=1,P))
print(sum(result))

N = int(input())
V = list(map(int,input().split(" ")))
C = list(map(int,input().split(" ")))
P = []

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

result = list(filter(lambda x:x>=1,P))
print(sum(result))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
V_array = [int(input()) for _ in range(N)]
ans = [max(0, V_i - int(input())) for V_i in V_array]

N = int(input())
V_array = [int(V_i_str) for V_i_str in input().split()]
C_array = [int(C_i_str) for C_i_str in input().split()]
ans = sum([max(0, V_array[i] - C_array[i]) for i in range(N)])
print(ans)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
List = []
for i in range(N):
    List.append(V[i]-C[i])
List.sort()
for i in List:
    if i > 0:
        print(sum(List[i:]))
        break
print('0')

#B

N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
List = []
for i in range(N):
    List.append(V[i]-C[i])
List.sort(reverse=True)
total = 0
for i in List:
    if i > 0:
        total += i
print(total)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for i in range(2 ** n):
  k = 0
  m = 0
  for j in range(n):
    if (i >> j) & 1:
      k += v[j]
      c += c[j]
  ans = max(ans, k - m)
print(ans)

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)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import numpy as np
import itertools

N = int(input())

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

ans = -1

for condition in itertools.product(range(2),repeat=N):

    cond_nparr = np.array(condition)

    x = np.sum(V[cond_nparr]) - np.sum(C[cond_nparr])

    ans = max(ans, x)

print(ans)


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)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import sys
import numpy as np

N = input()

V = input().split()
v = np.array([ int(x) for x in V])

C = input().split()
c = np.array([ int(x) for x in C])

delt = v - c
print(delt)
print(delt[delt>0].sum())

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

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

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))

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

print(VC)

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

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

print(VC)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
D = [X[i] - Y[i] for i in range(N)]
D = filter(lambda x: x > 0, D)
print(sum(D))

N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
D = [V[i] - C[i] for i in range(N)]
D = filter(lambda x: x > 0, D)
print(sum(D))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N=int(input())
V=[]
C=[]
dif=[]
sum=0
V=list(input().split())
C=list(input().split())
for i in range(N):
    dif.append(int(V[i])-int(C[i]))
print(dif)
for i in range(N):
    if dif[i]>=0:
        sum+=dif[i]
print(sum)


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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
num=0
for i in range(n):
            if(v[i]-c[i]>0):
                num+=v[i]-d[i]
print(num)


N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
num=0
for i in range(N):

    sum=V[i]-C[i]
    print(sum)
    if sum>0:
        num+=sum


print(num)


N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
num=0
for i in range(N):

    sum=V[i]-C[i]
    if sum>0:
        num+=sum


print(num)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = input()
v = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]

import numpy as np
 
n = input()
v = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
 
profit = v - c
positive_profit = profit(profit > 0)
print(np.sum(positive_profit))

import numpy as np

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

profit = v - c
positive_profit = profit(profit > 0)
print(positive_profit.sum())


n = input()
v = np.array([int(x) for x in input().split()])
c = np.array([int(x) for x in input().split()])
profit = v -c
positive_profit = profit(profit > 0)
print(positive_profit.sum())

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()])
 
profit = v - c
positive_profit = profit(profit > 0)
print(np.sum(positive_profit))

import numpy as np

n = input()
v_list = [int(x) for x in input().split()]
c_list = [int(x) for x in input().split()]
total_profit = 0
for v, c in zip(v_list, c_list)
    profit = v -c
    if profit > 0:
        total_profit += profit
print(total_profit)

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()])
 
profit = v - c
positive_profit = profit[profit > 0]
print(np.sum(positive_profit))

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
V = input().split()
C = input().split()
i = int(0)
value = int(0)
if i < N:
    if V[i] - C[i] > 0:
        value = value + V[i] - C[i]
        i += 1
print(value)

N = int(input())
V = input().split()
C = input().split()
i = int(0)
if i < N:
    if V[i] - C[i] > 0:
        value = value + V[i] - C[i]
        i += 1
print(value)

N = int(input())
V = input().split()
C = input().split()
value = int(0)
i = int(0)
for i in range(N):
    if int(V[i]) > int(C[i]):
        add = int(V[i]) - int(C[i])
        value = value + add
    i = i + 1
print(value)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
v = [int(input()) for _ in range(n)]
c = [int(input()) for _ in range(n)]

a=0
b=0

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

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


a=0
b=0

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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
ans1=0
ans2=0
for i in range (len(v)):
    if v[i]>c[i]:
        ans1 += v[i]-c[i]
    else:
        ans2 += c[i]-v[i]
print(min(ans1,ans2))

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
v=int(x) for x in input().split()
c=int(y) for y in input().split()
e=[i for i in range(n) if (v[i]-c[i])>0]
ans=sum(e)
print(ans)

n=int(input())
v=list(int(x) for x in input().split())
c=list(int(y) for y in input().split())
e=[]
for i in range(n):
	if (v[i]-c[i])>0:
		e.append(v[i]-c[i])
ans=sum(e)
print(ans)

Verdicts: Runtime Error

Accepted
Problem: 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.

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




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




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




Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a = int(input())
b = [map(int,input().split()) for i in range(a) ]
c = [map(int,input().split()) for j in range(a) ]
e = 0
for k in range(a):
    d = b[k] - c[k]
    if d > 0:
        e += d
print(e)

a = int(input())
b = map(int,input().split())
c = map(int,input().split())
b,c = list(b),list(c)
e = 0
for k in range(a):
    d = b[k] - c[k]
    if d > 0:
        e += d
print(e)

Verdicts: Runtime Error

Accepted