Problem:


Score : 200 points

Problem Statement

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

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

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

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

Find the maximum possible value of X-Y.

Constraints

All values in input are integers.

1 \leq N \leq 20

1 \leq C_i, V_i \leq 50

Input

Input is given from Standard Input in the following format:

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

Output

Print the maximum possible value of X-Y.

Sample Input 1

3
10 2 5
6 3 4

Sample Output 1

5

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

Sample Input 2

4
13 21 6 19
11 30 6 15

Sample Output 2

6

Sample Input 3

1
1
50

Sample Output 3

0



Sample input:
3
10 2 5
6 3 4


Sample output:
5

Submission status: Runtime Error

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

k=0

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

Submission status: Runtime Error

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

k=0

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

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
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()

Submission status: Runtime Error

Solution code:
n = int(input())
if n == 1:
	print(0)
else:
	vals = list(map(int, input().split()))
    costs = list(map(int, input().split()))
 
	total = 0
	for v, c in zip(vals, costs):
    	resale = v - c
        if resale > 0:
        	total += resale
    print(total)

Submission status: Runtime Error

Solution code:
n = int(input())
if n == 1:
	print(0)
else:
	vals = list(map(int, input().split()))
    costs = list(map(int, input().split()))

	total = 0
	for v, c in zip(vals, costs):
    	resale = v - c
        if resale > 0:
        	total += resale

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
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())

Submission status: Runtime Error

Solution code:
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())

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
num = input()
value = [int(n) for n in input().split()]
cost = [int(n) for n in input().split()]

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

print(ans)

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

Solution code:
N=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
d=[]
for i in N-1:
  m=v[i]-c[i]
  if m>0:
    d.append(m)
print(sum(d))

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
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())

Submission status: Runtime Error

Solution code:
N = int(input())
val = []
cos = []
for i in range(N):
    val.append(int(input())
for i in range(N):
    cos.append(int(input())
dif = [val[i]-cos[i] for i in range(N)]
ma = 0
for d in dif:
    ma += d if d >= 0 else 0
return ma

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
a=int(input())
p=list(map(int,input().split())
q=list(map(int,input().split())
cost=0
for i in range(a):
    if p[i]-q[i] > 0:
        cost += (p[i]-q[i])
print(cost)

Submission status: Runtime Error

Solution code:
A=int(input())
P=list(map(int,input().split())
Q=list(map(int,input().split())
cost=0
for i in range(A):
    if P[i]-Q[i] > 0:
        cost += (P[i]-Q[i])
print(cost)

Submission status: Runtime Error

Solution code:
a=input()
p=list(map(int,input().split()))
q=list(map(int,input().split()))
cost=0
for i in range(a):
    if p[i] - q[[i] > 0:
        cost += (p[i]-q[i])   
print(n)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
N = int(input())

V = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0
for i in range(2**N):
    X = 0
    Y = 0
    for j in range(N):
        if ((i >> j) & 1):
            X += V[j]
            Y += C[i]
    ans = max(ans, X-Y)

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
v = map(int, input().split())
c = map(int, input().split())
max_val = 0
for _v, _c in zip(v, c):
  if _v - _c > 0:
    max_val += _v - _c
print(max_val

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
import numpy as np 
n = int(input())
e = [[int(i) for i in input().split()] for i in range(2)] 
e3 = np.array(e)
print(np.sort((e3[0] - e3[1]))[::-1][0] + np.sort((e3[0] - e3[1]))[::-1][1])

Submission status: Runtime Error

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

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

print (count)

Submission status: Runtime Error

Solution code:
N = int(input())
list1 = map(int,input().split())
list2 = map(int,input().split())
x = 0
for i in range(N):
    x = list1[i] - list2[i]
    if x >> 0:
         y += x
print(y)

Submission status: Runtime Error

Solution code:
N = int(input())
list1 = []
for i in range(N):
    list1.append(int(input))
list2 = []
for i in range(N):
    list2.append(int(input))
x = 0
for i in range(N):
    x = list1[i] - list2[i]
    if x >> 0:
         y += x
print(y)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
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]:
		s += V[i]-C[i]
	else:
		s += 0
print(s)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(N)]

profit = [0] * N
sum_profit = 0

for i in range(N):
    profit[i] = int(data[0][i]) - int(data[1][i])
    if profit[i] > 0:
        sum_profit += profit[i]

print(sum_profit)

Submission status: Runtime Error

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(N)]

profit = []
sum_profit = 0

for i in N:
    profit[i] = data[0][i] - data[1][i]
    if profit[i] > 0:
        sum_profit += profit[i]

print(sum_profit)

Submission status: Runtime Error

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(N)]

profit = []
sum_profit = 0

for i in N:
    profit[i] = data[1][i] - data[2][i]
    if profit[i] > 0:
        sum_profit += profit[i]

print(sum_profit)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

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

val = 0
for _ in zip(v_list, c_list):
  if(v_list>=c_list):
    val = val + (v_list-c_list)
 
print(val)

Submission status: Runtime Error

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

for _ in zip(v_list, c_list):
  if(v_list>=c_list):
    val = val + (v_list-c_list)

print(val)

Submission status: Runtime Error

Solution code:
jewel = 0

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

print(jewel)

Submission status: Runtime Error

Solution code:
n = input()
vli = list(map(int,input().split()))
cli = list(map(int,input().split()))
for i in n:
  sli = []
  sli.append(vli[i] - cli[i])
for j in n:
  ans = []
  if sli[j] > 0:
    ans.append(sli[j])
answer = sum(ans)    
print(answer)

Submission status: Runtime Error

Solution code:
n=input()
vli = list(map(int,input().split()))
cli = list(map(int,input().split()))
for i in n:
  sli=[]
  sli.append(vli[i]-cli[i])
for j in n:
  ans=[]
  if sli[j]>0:
    ans.append(sli[j])
print(sum(ans))

Submission status: Runtime Error

Solution code:
abc125b

n=int(raw_input())
v=map(int,raw_input().split())
c=map(int,raw_input().split())
res=0
for i in xrange(n):
 if v[i]-c[i]>0:
  res+=v[i]-c[i]
print res

Submission status: Runtime Error

Solution code:
import math

N = int(input())
A = list(map(int, input().split()))

gcd_l = [0]
gcd_r = [0]

for i in range(N):
    gcd_l.append(math.gcd(gcd_l[i], A[i]))
    gcd_r.append(math.gcd(gcd_r[i], A[-(i+1)]))
gcd_r = gcd_r[::-1]

ans = []
for i in range(N):
    ans.append(math.gcd(gcd_l[i], gcd_r[i+1]))
print(max(ans))

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
num = int(input())
lists = [list(map(int,input().split())) for i in range(2)]
nums = [lists[0][j] - lists[1][j] for j in range(num)]
print(sorted(nums,reverse=True)[0]+sorted(nums,reverse=True)[1])

Submission status: Runtime Error

Solution code:

i = list(map(int, input().split()))
s = list(map(int, input().split()))
t = list(map(int, input().split()))
z=0
for q in range(0,i[0]):
	if(s[q]-t[0]>0):
      z+s[q]
    else:
      
print(z)

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;cin >> n;
    int v[20];
    int c[20];
    for(int i=0;i<n;i++) cin >> v[i];
    for(int i=0;i<n;i++) cin >> c[i];

    int ans = 0;
    for(int bit=0;bit<(1<<n);bit++){
        int sum = 0;
        for(int i=0;i<n;i++){
            if((bit >> i) & 1){
                sum += v[i] - c[i];
            }
        }
        ans = max(ans, sum);
    }
    cout << ans << endl;
    return 0;
}

Submission status: Runtime Error

Solution code:
n=int(input())
arr=list(map(int,input().split()))
arr2=lisT9map(int,input().split())
ans=0
for i in range(n):
	if(arr[i]-arr2[i]>0):
		ans+=arr[i]-arr2[i]

	#ans=max(ans,arr[i]-arr2[i])
print(ans)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
import sys
# import bisect
# import math
# import itertools
import numpy as np
# import collections

"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        # 参考
        # https://blog.rossywhite.com/2018/08/06/bit-search/
        # https://atcoder.jp/contests/abc105/submissions/4088632
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    # output.append(a[j])
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)


"""ここからメインコード"""


def main():
    # 1文字に省略
    r, e, p = range, enumerate, print
    ip = IP()
    id = Idea()
    mod = 10 ** 9 + 7

    """この下から書いてね"""
    n = ip.I()
    v = ip.IL()
    c = ip.IL()
    v = np.array(v)
    c = np.array(c)
    o = v - c
    ans = np.where(o > 0, x, 0)
    p(sum(ans))

main()

Submission status: Runtime Error

Solution code:
import sys
# import bisect
# import math
# import itertools
import numpy as np
# import collections

"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        # 参考
        # https://blog.rossywhite.com/2018/08/06/bit-search/
        # https://atcoder.jp/contests/abc105/submissions/4088632
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    # output.append(a[j])
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)


"""ここからメインコード"""


def main():
    # 1文字に省略
    r, e, p = range, enumerate, print
    ip = IP()
    id = Idea()
    mod = 10 ** 9 + 7

    """この下から書いてね"""
    n = ip.I()
    v = ip.IL()
    c = ip.IL()
    v = np.array(v)
    c = np.array(c)
    o = v - c
    ans = np.where(x > 0, x, 0)
    p(sum(ans))

main()

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())
VS = input().split()
CS = input().split()

V = [int(v) for v in VS]
C = [int(v) for v in CS]

R = []


for i in range(N-1):
    R.append(V[i]/C[i])

RR = reversed(R)
RA = np.argsort(RR)

best = 0

Vsum=0
Csum=0

for r in RA:
    Vsum += V[r]
    Csum += C[r]

    if (Vsum-Csum) >= best:
        best = Vsum-Csum

print(best)

Submission status: Runtime Error

Solution code:
n=int()
v=input()
c=input()
v_2= [int(a) for a in v]
c_2= [int(b) for b in c]
p=[int(x-y) for (x,y) in zip(v_2,c_2)]
p_sei=[i for i in n if i>=0]
if sum(p)<0:
	print("0")
else:
	print(sum(p_sei))

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())
VS = input().split()
CS = input().split()

V = [int(v) for v in VS]
C = [int(v) for v in CS]

R = [N]


for i in range(N-1):
    R[i] = V[i]/C[i]

RA = np.argsort(-R)

best = 0

Vsum=0
Csum=0

for r in RA:
    Vsum += V[i]
    Csum += C[i]

    if (Vsum-Csum) >= best:
        best = Vsum-Csum

print(best)

Submission status: Runtime Error

Solution code:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
ans_max = 0
V_ans=[]
C_ans=[]

for i in range(0,N):
    if V[i]>C[i]:
        V_ans.append(V[i])
        C_ans.append(C[i])
        
print(V_ans.sum-C_ans.sum)

Submission status: Runtime Error

Solution code:
V = []
C = []
N = int(input())

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

max_1 = max(V)
cax_1 = C[V.index(max_1)]

V.pop(V.index(max_1))
C.pop(C.index(cax_1))

max_2 = max(V)
cax_2 = C[V.index(max_2)]

ans = (max_1 + max_2) - (cax_1 + cax_2)

print(ans)

Submission status: Runtime Error

Solution code:
# coding: utf-8
import numpy as np
N = int(input())

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

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

v2[np.argsort(v2)]
c2[np.argsort(c2)]

x = v2[0] + v2[2]
y = c2[0] + c2[2]
print(x-y)

Submission status: Runtime Error

Solution code:
# coding: utf-8
import numpy as np
N = int(input())

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

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

v2[np.argsort(v2)]
c2[np.argsort(c2)]

x = v2[-1] + v2[-2]
y = c2[-1] + c2[-2]
print(x-y)

Submission status: Runtime Error

Solution code:

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)

Submission status: Runtime Error

Solution code:
from numpy import*;v,c=loadtxt(open(0),'i',skiprows=1);i=v>c;print(sum(v[i]-c[i]))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# 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)

Submission status: Runtime Error

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

XY = 0

for i in range(N):
    XY += np.maximum(0, V[i]-C[i])

print(XY)

Submission status: Runtime Error

Solution code:
from itertools import combinations

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

idx = range(n)
result = [0, sum(value)-sum(cost)]
index = [idx for idx, v, c in enumerate(zip(value, cost)) if v > c]
comb = [com for i in range(1, len(index)) for com in combinations(index, i)]

for com in comb:
  tmp = 0
  for c in com:
    tmp += value[c]-cost[c]
  result.append(tmp)
    
print(max(result))

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
def combinationListRecursive(data, r):
  if r == 0 or r > len(data):
    return []

  result = []
  _combinationListRecursive(data, r, 0, [], result)
  return result


def _combinationListRecursive(data, r, start, progress, result):
  if r == 0:
    result.append(progress)
    return

  for i in range(start, len(data)):
    _combinationListRecursive(data, r - 1, i + 1, progress + [data[i]], result)



N = int(input())
V = input().split(" ")
C = input().split(" ")
res = []
for i in range(N+1):
    index = combinationListRecursive(list(range(N)),i)
    for ind in index:
        if len(ind) == 0:
            res.append(0)
        else:
            s = 0
            for n in ind:
                s += int(V[n])-int(C[n])
                res.append(s)
print("{}".format(max(abs(res))))

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
N = int(input())
listV = list(map(int, input().split()))
listC = list(map(int, input().split()))
//listP P:Profit = listV(i) - listC(i)
ans = 0
for i in range(0, N):
	P = listV[i] - listC[i]
	if P > 0:
		ans += P
//if sum < 0, ans = 0.
//how can I search combination of sum. -> sum all listP(i) > 0
print(ans)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
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)