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 = input()
V = input().split(' ')
C = input().split(' ')

max = -1000
for value, cost in zip(V, C):
    value_int = int(value)
    cost_int = int(cost)
    if(max < value_int - cost_int):
        max = value_int - cost_int

print(max)

N = input()
V = input().split(' ')
C = input().split(' ')

max = 0
for value, cost in zip(V, C):
    value_int = int(value)
    cost_int = int(cost)
    if(value_int - cost_int > 0):
        max += value_int - cost_int

print(max)

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

m = 0

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

print(m)

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

m = 0

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

print(m)

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):
v=list(map(int, input().split()))
c=list(map(int, input().split()))
n=int(input())
s=0
for i in range(n):
  if v[i]-c[i]>0:
    s=s+v[i]-c[i]
  else:
    continue
print(s)

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

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

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

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



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

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


Verdicts: Runtime Error

Runtime Error

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):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
a = 0
for i in range(N):
    a += abs(V[i]-C[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 = [int(input()) for _ in range(n)]
c = [int(input()) for _ in range(n)]
result = 0
for i in range(n):
  if v[i] > c[i]:
    result += v[i] - c[i]
print(result)


n = int(input())
v = [int(e) for e in input().split()]
c = [int(e) for e in input().split()]
result = 0
for i in range(n):
  if v[i] > c[i]:
    result += v[i] - c[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):
def calculate_max(Ans, value):
    temp = Ans
    if (Ans + value) > Ans:
        temp += value
    if tmep < 0 :
        temp = 0
    return temp
# input processing 
N = int(input())
Value = map(int, input().split())
Cost = map(int, input().split())
# profit calculation
Profit = [Value[i] - Cost[i] for i in range(N)]
Answer = 0
# process
for i in range(N):
    Answer = calculate_max(Answer, Profit[i])
# Output
print(Answer)


def calculate_max(Ans, value):
    temp = Ans
    if (Ans + value) > Ans:
        temp += value
    if temp < 0 :
        temp = 0
    return temp
# input processing 
N = int(input())
Value = list(map(int, input().split()))
Cost = list(map(int, input().split()))
# profit calculation
Profit = [Value[i] - Cost[i] for i in range(N)]
Answer = 0
# process
for i in range(N):
    Answer = calculate_max(Answer, Profit[i])
# Output
print(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())
H = list(map(int,input().split()))
count = 1
for i in range(1,N):
    if max(H[:i]) <= H[i]:
        count += 1
print(count)

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

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):
# coding: utf-8
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0
for i in [ V[_] - C[_] for _ in range(N)]:
    if i> 0:
        ans+=j
print(ans)

N = int(input())
VC = [list(map(int,input().split())) for _ in range(2) ] 
ans = 0
for i in [ VC[0][_] - VC[1][_] for _ in range(N)]:
    if i> 0:
        ans+=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 = [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]
    
print(sum)

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=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
res=0
for vv cc in zip(V,C):
  if vv-cc>0:
    res=res+vv-cc
print(res)

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

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):
#include <stdio.h>


using namespace std;
typedef long long ll;

int main()
{
    int N, ans = 0;
    vector<int> V(N), C(N);
    scanf("%d", &N);
    for (int i = 0; i < N; i++)
    {
        scanf("%d", V.at(i));
    }
    for (int i = 0; i < N; i++)
    {
        scanf("%d", C.at(i));
    }

    for (int i = 0; i < N; i++)
    {
        if (V.at(i) - C.at(i) >= 0)
        {
            ans += V.at(i) - C.at(i);
        }
    }

    printf("%d", ans);

    return 0;
}



import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
V = map(int, readline().split())
C = map(int, readline().split())
ans = 0
for v, c in zip(V, C):
    if v - c > 0:
        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):
n=int(input())
v=list(map(int, input().split()))
c=list(map(int, input().split()))
d=0
for i in range(n):
  tmp=v[i]-c[i]
  if tmp>0:
    d+=tmp
print(tmp)

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


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):
input();
Values = list(map(int, input().split()))
Costs = list(map(int, input().split()))
total = 0
for (value, cost) in zip(Values, Costs):
  if value > cost:
    total = value - cost

print(total)

input()
Values = list(map(int, input().split()))
Costs = list(map(int, input().split()))
total = 0
for (value, cost) in zip(Values, Costs):
    if value > cost:
        total += value - cost
    
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):
inputs = input().split("\n")
N = int(inputs[0])
V = list(map(int, inputs[1].split(" ")))
C = list(map(int, inputs[2].split(" ")))
Z = 0
for v, c in zip(V, C):
    if v-c>0: z += v-c
print(Z)

inputs = input().split("\n")
N = int(inputs[0])
V = list(map(int, inputs[1]))
C = list(map(int, inputs[2]))
Z = 0
for v, c in zip(V, C):
    if v-c>0: z += v-c
print(Z)

inputs = input().split("\n")
N = int(inputs[0])
V = list(map(int, inputs[1].split(" ")))
C = list(map(int, inputs[2].split(" ")))
Z = 0
for v, c in zip(V, C):
    if v-c>0: Z += v-c
print(Z)

N = int(input())
V = list(map(int, input().split(" ")))
C = list(map(int, input().split(" ")))
Z = 0
for v, c in zip(V, C):
    if v-c>0: Z += v-c
print(Z)

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):
N = int(input())
V = input().split()
C = input().split()
cost = []
x = 0
for i in range(N):
    cost.append(int(V[int(i)]) - int(C[int(i)]))
print(cost)
print(sorted(cost,reverse=True))
for i in range(N):
    if cost[i] > 0:
        x = x + int(cost[i])
print(x)

N = int(input())
V = input().split()
C = input().split()
cost = []
x = 0
for i in range(N):
    cost.append(int(V[int(i)]) - int(C[int(i)]))
for i in range(N):
    if cost[i] > 0:
        x = x + int(cost[i])
print(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):
n = int(input())
b = list(input().split())
c = list(input().split())
r=0
for i in range(n):
  if b[i]-c[i]>0:
    r = r + b[i] - c[i]
    
print(r)

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


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()))
cnt=0
for _ in range(n):
  if v[i]-c[i]>0:
    cnt+=v[i]-c[i]
print(cnt)

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)

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())]
print(sum([max(v[i] - c[i], 0) for i in range(n)]))

n, *d = map(int, open(0).read().split())
print(sum([max(d[i] - d[i+n], 0) for i in range(n)]))

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 itertools
import numpy as np

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

ans = 0
for k in range(1, N+1):
    chosen = list(itertools.combinations(range(N), k))
    for a in range(np.shape(chosen)[0]):
        X = 0
        Y = 0
        for b in range(np.shape(chosen)[1]):
            idx = chosen[a][b]
            X += V[idx]
            Y += C[idx]
            if ans <= (X - Y):
                ans = X - Y
print("ans", ans)

import numpy as np

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

vc = v-c
ans = sum(vc[vc > 0])
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 = map(int,input().split())
c = map(int,input().split())


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

print(getsum)

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


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

print(getsum)

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 = 0

for i in range(0,n):
  if a[i] > b[i]:
    c = c + a[i] - b[i]
  else:
    continue
    
print(c)


n = int(input())
a = []
b = []
c = 0
for _ in range(n):
  a.append(int(input()))
for _ in range(n):
  b.append(int(input()))
for i in range(0,n):
  if a[i] > b[i]:
    c = c + a[i] - b[i]
  else:
    continue
    
print(c)

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

for i in range(0,n):
  if a[i] > b[i]:
    c = c + a[i] - b[i]
  else:
    continue
    
print(c)


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())
x =list(map(int, input().split()))
y =list(map(int, input().split()))
diff = [x[i]-y[i] for i in range(n)]
num = 0
for d in diff:
    if(d > 0):
        num += d

n = int(input())
x =list(map(int, input().split()))
y =list(map(int, input().split()))
diff = [x[i]-y[i] for i in range(n)]
num = 0
for d in diff:
    if(d > 0):
        num += d
print(num)

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 = [ int(v) for v in input().split() ]
c_list = [ int(v) for v in input().split() ]

ans = sum([ max( 0, (v_list[i]-c_list[i]) ) for i in range(n) ])

n = int(input())
	
v_list = [ int(v) for v in input().split() ]
c_list = [ int(v) for v in input().split() ]
	
ans = sum([ max( 0, (v_list[i]-c_list[i]) ) for i in range(n) ])

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())
H = list(map(int, input().split()))
count = 0
M = 0
for i in range(N):
  if H[i]>=M:
    count += 1
    M = H[i]
print(count)

N = int(input())
H = list(map(int, input().split()))
count = 0
M = 0
for i in range(N):
  print(H[i])
  if H[i]>=M:
    count += 1
    M = H[i]
print(count)

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

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

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

    print(algorithm(N, V, C))


def algorithm(N: int, V: List[int], C: List[int]):
    indices = list(filter(lambda i: V[i] - C[i] > 0, list(range(0, N))))

    sum = 0
    for i in indices:
        sum += V[i] - C[i]
    return sum
 
problem()



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

    print(algorithm(N, V, C))


def algorithm(N, V, C):
    indices = list(filter(lambda i: V[i] - C[i] > 0, list(range(0, N))))

    sum = 0
    for i in indices:
        sum += V[i] - C[i]
    return sum

problem()

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()))
R = []
for i range(N):
  R.append(V[i] - C[i])
cost = 0
for r in R:
  if r > 0:
    cost += r
print(cost)
  

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


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


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):
# -*- coding: utf-8 -*-

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

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

print(gain)

# -*- coding: utf-8 -*-

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

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

print(gain)

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):
jewel = [i for i in input().split('\n')]
value = [int(i) for i in jewel[1].split()]
cost = [int(i) for i in jewel[2].split()]
diff = [i-j for i,j in zip(value, cost)]
price = 0
for i in sorted(diff):
    if i>0:
        price += i

print(price)

jewel = int(input())
value = [int(i) for i in input().split()]
cost = [int(i) for i in input().split()]
diff = [i-j for i,j in zip(value, cost)]
price = 0
for i in sorted(diff):
    if i>0:
        price += i

print(price)

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):
# ABC125B

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


# ABC125B

n = int(input())
x = 0
y = 0
for i in range(n):
    v, c = map(int, input().split())
    if v > c:
        x += v
        y += c
print(abs(x - y))


# ABC125B

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


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

ans = 0
for _ in range(N):
    if v[i] > c[i]:
        ans += v[i] - c[i]
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):
n=int(input())
l=map(int,input().split())
m=map(int,input().split())
def f(x):
	return l[x]-m[x]
print(sum([f(i) for i in range(n) if f(i)>0]))

n=int(input())
l=list(map(int,input().split()))
m=list(map(int,input().split()))
def f(x):
	return l[x]-m[x]
print(sum([f(i) for i in range(n) if f(i)>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 = input()
V = input().split(" ")
C = input().split(" ")

n = int(n)
V_tmp = []
for v in V:
    V_tmp.append(int(v))
V = V_tmp
C_tmp = []
for c in C:
    C_tmp.append(int(v))
C = C_tmp
SA = []
for i in range(n):
    SA.append(C[i]-V[i])
max_ = 0
for i in range(n):
    if SA[i] >= 0:
        max_ += SA[i]
print(max_)

n = input()
V = input().split(" ")
C = input().split(" ")

n = int(n)
V_tmp = []
for v in V:
    V_tmp.append(int(v))
V = V_tmp
C_tmp = []
for c in C:
    C_tmp.append(int(c))
C = C_tmp
SA = []
for i in range(n):
    SA.append(V[i]-C[i])
max_ = 0
for i in range(n):
    if SA[i] >= 0:
        max_ += SA[i]
print(max_)

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):
print(sum(max(int(x)- int(y), 0) for x, y in zip(input().split(), input().split())))

input()
print(sum(max(int(x)- int(y), 0) for x, y in zip(input().split(), input().split())))


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()))
print(sum([i for i in range(n) if v[i] > c[i]]))

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

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().spplit()]
ans = [l-p for l,p in zip(v,c)]
ans1 = 0
for i in ans :
  ans1 += i if i>0 else 0
print(ans1)

N = int(input())
v = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
ans = [l-p for l,p in zip(v,c)]
ans1 = 0
for i in ans :
  ans1 += i if i>0 else 0
print(ans1)

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(x) for x in input().split()]
c = [int(x) for x in 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 = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]

ans = 0

for i in range(n):
  if v[i] - c[i] > 0:
    ans += v[i] - c[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())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
cnt = 0
for i in range(len(n)):
    if v[i] > c[i]:
        cnt += (v[i] - c[i])
    else:
        cnt += 0
print(cnt)        


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

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

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

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

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

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]:
        cnt += (v[i] - c[i])
    else:
        cnt += 0
print(cnt) 

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

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


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

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]:
        cnt += (v[i] - c[i])
print(cnt)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

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):
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]:
      sum += v[i]-c[i]
print(sum)


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]:
      sum += v[i]-c[i]
print(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=[int(x) for x in input().split()]
c=[int(x) for x in input().split()]
s=0
for i in range(n):
  if v[i]>c[i]:
    s+=v[i]-c[i]
print(s)

n=int(input())
v=[int(x) for x in input().split()]
c=[int(x) for x in input().split()]
s=0
for i in range(n):
  d=v[i]-c[i]
  if d>0:
    s+=d
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):
input()
v=list(map(int,input().split())
c=list(map(int,input().split())
a=[max(0,i-j) for i,j in zip(v,c)]
print(sum(a))

input()
v=list(map(int,input().split()))
c=list(map(int,input().split()))
a=[max(0,i-j) for i,j in zip(v,c)]
print(sum(a))


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

# In[ ]:

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


# In[ ]:

import numpy as np


# In[ ]:

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


# In[ ]:

bene = V-C
print(np.sum(bene[bene>0]))




# coding: utf-8

# In[ ]:

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


# In[ ]:

import numpy as np


# In[ ]:

bene = V-C
print(np.sum(bene[bene>0]))




# coding: utf-8

# In[1]:

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


# In[2]:

import numpy as np


# In[3]:

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


# In[4]:

bene = V-C
print(np.sum(bene[bene>0]))


# In[ ]:





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

P = 0

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


N = int(input())

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

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

P = 0

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

N = int(input())

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

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

P = 0

for i in range(N):
  Y = V[i] - C[i]
  if Y > P:
    P = Y
print(P)


N = int(input())

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

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

P = 0

for i in range(0,N+1):
  Y = V[i] - C[i]
  if Y >0:
    P += Y
print(Y)


N = int(input())

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

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

P = 0

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


Verdicts: Wrong Answer

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):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
print([v[i]-c[i] if v[i]-c[i]>0 for i in range(n)])

n = int(input())
v = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
print(sum([v[i]-c[i] for i in range(n) if v[i]-c[i]>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):
in_data = [list(map(int,input().split())) for i in range(3)]
print(ls)
print(in_data[0])
print(in_data[1])
print(in_data[2])
print("--------")

N = in_data[0][0]

earn_ttl = 0

for i in range(N):
    #print(i)
    value = in_data[1][i]
    cost = in_data[2][i]
    earn = value - cost
    if (earn > 0):
        earn_ttl = earn_ttl + earn
        
print(earn_ttl)

in_data = [list(map(int,input().split())) for i in range(3)]

N = in_data[0][0]

earn_ttl = 0

for i in range(N):
    value = in_data[1][i]
    cost = in_data[2][i]
    earn = value - cost
    if (earn > 0):
        earn_ttl = earn_ttl + earn
        
print(earn_ttl)

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()))
sum = 0
for v,c in zip(V,C):
  if v-c<0:
    sum+=v-c
print(sum)

N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
sum = 0
for v,c in zip(V,C):
  if (v-c)>0:
    sum+=v-c
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):
num = int(input())
value = [int(s) for s in input().split()]
cost = list(map(int, input().split()))

sum = 0
for i in range(num):
	if (value[i] - cost[i] > 0):
      sum += value[i] - cost[i]
print(sum)

num = int(input())
value = [int(s) for s in input().split()]
cost = list(map(int, input().split()))

sum = 0
for i in range(num):
  if (value[i] - cost[i] > 0):
    sum += value[i] - cost[i]
print(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())
k=0
v=[map(int,input().split())]
c=[map(int,input().split())]
for i in range(n):
    if (v[i]-c[i])>0:
        k += (v[i]-c[i])
print(k)

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


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


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

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):
N = int(input())
V = map(int,input().split())
C = map(int,input().split())
X = max(V)
Y = max(C)
print(X-Y)

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)

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().split())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
def rescale(V,C):
  price=0
  for v,c in zip(V,C):
    if v>c:
      price=price+v-c
  return price 
print("{}".format(rescale(V,C)))


N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
def rescale(V,C):
  price=0
  for v,c in zip(V,C):
    if v>c:
      price=price+v-c
  return price 
print("{}".format(rescale(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):
jewel = 0

for i in range(1, 21):
  if V(i) > C(i):
    jewel += V(i) - C(i)
  else:
    pass

print(jewel)

N = int(input("個数を入力してください----"))
V = list(map(int, input("価値を入力してください").split()))
C = list(map(int, input("コストを入力してください").split()))

worth = 0

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

print(worth)

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

worth = 0

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

print(worth)

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):
x = 0
y= 0
n = input()
v = list(map(int, input().split()))
c = list(map(int, input().split()))
for vv,cc in v,c:
    if cc < vv:
        x+=vv
        y+=cc
print(x-y)

x = 0
y= 0
n = input()
v = list(map(int, input().split()))
c = list(map(int, input().split()))
for (vv,cc) in zip(v,c):
    if cc < vv:
        x+=vv
        y+=cc
print(x-y)

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())
Vs = map(int, input().split())
Cs = map(int, input().split())

print(sum([ v - c for zip(Vs, Cs) if v >= c ]))


N = int(input())
Vs = map(int, input().split())
Cs = map(int, input().split())

print(sum([ v - c for v, c in zip(Vs, Cs) if 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):
a=int(input())
b=list(map(int,input().split()))
c=list(map(int,input().split()))
d=0

for i in range(a):
  if (b[i]-c[i]) > 0:
    d=b[i]-c[i]

print(d)
  

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

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

Verdicts: 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):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
lst = []

for i in range(N):
	lst.append(V[i] - C[i])
  
high_score = 0
  
for i in range(2 ** N):
	a = list(str(bin(i))[2:])
	for k in range(N - len(a)):
		a.insert(0, "0")
	b = list(map(int, a))
	print(b)
	score = 0
	for j in range(len(b)):
		score += lst[j] * b[j]
	if high_score < score:
		high_score = score
    
print(high_score)

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

for i in range(len(N)):
  lst.append(V[i] - C[i])
  
high_score = 0
  
for i in range(2 ** len(N)):
  a = str(bin(i)).split[2 :]
  b = map(int, a)
  score = 0
  for j in range(len(b)):
    score += lst[i] * b[j]
  if high_score < score:
    high_score = score
    
print(high_score)

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

for i in range(N):
	if V[i] > C[i]:
		lst.append(V[i] - C[i])

print(sum(lst))

Verdicts: 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 = input() 
v = list(map(int, input().split())) 
c = list(map(int, input().split())) 
otoku = []

for i in range(n):
  otoku.append(v[i] - c[i])

res = 0
for j in range(n):
  if otoku[j] > 0:
    res += otoku[j]
    
print(res)

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

Verdicts: Runtime Error

Accepted