TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
a = [int(x) for x in input().split() if x != "0"]

if a[0]-(sum(a)-a[0]-a[1]) >= 0 :{
	print(a[0]-(sum(a)-a[0]-a[1]))
	}
else :{
	print(-1)
	}

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


if N-sum(A) >= 0 :{
	print(N-sum(A))
	}
else :{
	print(-1)
	}

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n,m = map(int, input().split())
a= list(map(int, input().split()))
if sum(a)<=n:
    print("1")
else:
    print("-1")


n,m = map(int, input().split())
a= sum(list(map(int, input().split())))
if n-a>=0:
    print(n-a)
else:
    print("-1")




Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
m,n = int(input())
li = list(map(int,input().split()))
if sum(li)>m:
  print(-1)
else:
  print(m - sum(li))

m,n = list(map(int,input().split()))
li = list(map(int,input().split()))
if sum(li)>m:
  print(-1)
else:
  print(m - sum(li))


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

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

A = [input()for i in range(M)]

x = N

for j in range(M):
    x = x - int(A[j])
    j += 1

if x < 0 :
    print(-1)

else :
    print(x)


N,M = (input().strip().split())


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

x = int(N)

for j in range(int(M)):
    x = x - int(A[j])
    j += 1

if x < 0 :
    print(-1)

else :
    print(x)


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n,m = map(int,input().split())
a = [map(int,input().split())]
print(max(n-sum(a)),-1)


n,m = map(int,input().split())
a = list(map(int,input().split()))
print(max(n-sum(a),-1))


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
arr = list(map(int, input().split()))
ais = list(map(int, input().split()))

days,tasks = arr[0],arr[1]

def main(days, ais):
  sum = 0
  for i in ais:
    sum += 0
    if sum > days: return -1

  return days - sum

print(main(days, ais))


arr = list(map(int, input().split()))
ais = list(map(int, input().split()))

days,tasks = arr[0],arr[1]

def main(days, ais):
  sum = 0
  for i in ais:
    sum += i
    if sum > days: return -1

  return days - sum

print(main(days, ais))


Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n, m = input().split()
a = list(map(int, input().split()))
print(max(n-sum(a),-1))

n, m = map(int,input().split())
a = list(map(int, input().split()))
print(max(n-sum(a),-1))

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n,m=map(int,input().split())
a=list(map(int,input().split()))
if n-sum(a)<=0:
  print(-1)
else print(n-sum(a))

n,m=map(int,input().split())
a=list(map(int,input().split()))
if n-sum(a)<0:
    print(-1)
else:
    print(n-sum(a))

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

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

A = 0

for i in range(M):
  A += int(input())

if M < A:
  print(N-A)

else:
  print(-1)

N = int(input())
M = int(input())

A = 0

for i in range(M):
  A += int(input())

if M < A:
  print(N-A)

else:
  print(-1)

N = int(input())

A = []

for i in range(N-1):
  a = int(input())
  A.append(a)

B = []

for j in range(N-1):
  temp = 0
  for i in A:
    if i-2 == j:
      temp += 1
  B.append(temp)        
for j in range(N-1):
  print(B[j])

N = int(input())
M = int(input())

A = 0

for i in range(M):
  A += int(input())

if M < A:
  print(N-A)

else:
  print(-1)

N = int(input())
M = int(input())

A = 0

for i in range(M):
    A += int(input())

if M < A:
    print(N-A)

else:
    print(-1)

N = int(input())
M = int(input())

A = 0

for i in range(M):
  A += int(input())

if M < A:
  print(N-A)

else:
  print(-1)

N, M = map(int, input().split())

A = [int(i) for i in range(M)]

B = sum(A)

if N <= B:
  print(N-B)

else:
  print('-1')

N, M = map(int, input().split())

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

B = sum(A)

if N >= B:
  print(N-B)

else:
  print('-1')

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
import numpy as np
tmp = np.array(list(map(int, input().split())))
N = tmp[0]
M = tmp[1]
A = np.array(tmp[2:])
Needed = np.sum(A)
if Needed > N:
    print(str(-1))
else:
    print(str(N - Needed))

import numpy as np

tmp = np.array(list(map(int, input().split())))
N = tmp[0]
A = tmp[2:]

Needed = np.sum(A)

if Needed > N:
    print(-1)
else:
    print(N - Needed)

import numpy as np

N = int(input())
M = int(input())
A = np.array(list(map(int, input().split())))
Needed = np.sum(A)
if Needed > N:
    print(-1)
else:
    print(N - Needed)

import numpy as np

N = int(input().split()[0])
A = np.array(list(map(int, input().split())))
Needed = np.sum(A)
if Needed > N:
    print(-1)
else:
    print(N - Needed)

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n,m = input().split()
a = [i for i in input.split()]
if sum(a)>n:
    print(-1)
else:
    print(m-sum(a))

n,m = (int(x) for x in input().split())
a = [int(i) for i in input().split()]
if sum(a)>n:
    print(-1)
else:
    print(n-sum(a))

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n,m = map(int,input().split())
a = list(map(int,iuput().split()))
x = n - sum(a)
if x >= 0:
    print(x)
else:
    print("-1")

n,m = map(int,input().split())
a = list(map(int,iuput().split()))
a_sum = sum(a)
x = n - a_sum
if x >= 0:
    print(x)
else:
    print(-1)

n,m = map(int,input().split())
a = list(map(int,iuput().split()))
x = n - sum(a)
if x >= 0:
    print(x)
else:
    print(-1)

n, m= map(int, input().split())

c = list(map(int,input().split()))
c_sum = sum(c)

day_count = n-c_sum

if day_count>=0:
  print(day_count)
else:
  print(-1)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
m,n = map(int,input().split())
l = list(map(int,input().split()))
for i in range(n):
  s += l[i]
print(max(m-s,-1))

m,n = map(int,input().split())
l = list(map(int,input().split()))
s = 0
for i in range(n):
  s += l[i]
print(max(m-s,-1))

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n, m = map(int, input().split())
aa = list(map(int, input().split()))
print(min(-1,n - sum(aa)))

n, m = map(int, input().split())
aa = list(map(int, input().split()))
print(max(-1,n - sum(aa)))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N = input()
M = input()
sumA = 0
for i in range(int(M)):
    sumA += int(input())
playday = int(N)-sumA
if playday >= 0:
    print(playday)
else:
    print(-1)

N = int(input())
M = int(input())
for i in range(M):
     N = N - int(input())
if N >= 0:
    print(N)
else:
    print(-1)

N = int(input())
M = int(input())
for i in range(M):
     N = N - int(input())
if N >= 0:
    print(N)
else:
    print(-1)

N = input()
A = input()
M = [int(x) for x in N.split(' ')]
B = [int(x) for x in A.split(' ')]
for i in range(M[1]):
     M[0] = M[0] - B[i]
if M[0] >= 0:
    print(M[0])
else:
    print(-1)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

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

print(lis)
ans = n
for i in range(m):
    ans -= lis[i]
if ans >= 0:
    print(ans)
else:
    print("-1")

n, m = map(int, input().split())
lis = list(map(int, input().split()))


ans = n
for i in range(m):
    ans -= lis[i]
if ans >= 0:
    print(ans)
else:
    print("-1")

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n, m = map(int, input.split())
a = list(map(int, input.split()))
sum = 0
for i in a:
    sum += i
if n >= sum:
    print(n - sum)
else:
    print(-1)

n, m = map(int, input().split())
a = list(map(int, input().split()))
sum = 0
for i in a:
    sum += i
if n >= sum:
    print(n - sum)
else:
    print(-1)


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n, m = map(int, input().split())
a = list(i for i in input().suplt)

all_homework_day = sum(a)

if all_homework_day <= n:
    play_day = all_homework_day
else:
    play_day = -1

print(play_day)

n, m = map(int, input().split())
a = list(int(i) for i in input().split())

all_homework_day = sum(a)

if all_homework_day <= n:
    play_day = n - all_homework_day
else:
    play_day = -1

print(play_day)


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N, M = map(int, input().split()) 
A = [int(input()) for _ in range(M)]

s = sum(A)
ans = -1
if N >= s: ans = N - s
print(ans)

N, M = map(int, input().spit())
A = [input() for _ in range(M)]

s = sum(A)
ans = -1
if N >= s: ans = N - s
print(ans)

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

s = sum(A)
ans = -1
if N >= s: ans = N - s
print(ans)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

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

i=0
sum=0

while i<=M:
  sum=sum+list[i]
  i=i+1
  
if sum>N:
  print("-1")
  
else:
  print(sum-N)

N,M = map(int, input().split())
list_1 = list(map(int, input().split()))
 
i=0
sum=0
 
while i<=M:
  sum=sum+list_1[i]
  i=i+1
  
if sum>N:
  print("-1")
  
else:
  print(sum-N)

N,M = map(int, input().split())
list_1 = list(map(int, input().split()))
 
i=0
sum=0
 
while i<M:
  sum=sum+list_1[i]
  i=i+1
  
if sum>N:
  print("-1")
  
else:
  print(abs(sum-N))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

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

height = [input() for i in range(M)]
sum = N - sum(height)

if (sum >= 0):
    print(sum)
else:
    print('-1')


import numpy as np
N, M = map(int, input().split())
data = np.array(input().split(), dtype=np.int64)

#height = [int(input()) for _ in range(M)]
sum = N - np.sum(data)

if (sum >= 0):
    print(sum)
else:
    print('-1')


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N, M = map(int, input().split())
A = np.array(list(map(int, input().split())))
tot = np.sum(A)

if tot > N:
	print(-1)
else:
	print(N-tot)

import numpy as np
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

N, M = map(int, input().split())
A = np.array(list(map(int, input().split())))
tot = np.sum(A)

if tot > N:
	print(-1)
else:
	print(N-tot)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n,m = map(int,input().split())
A = list(map(int,input(),split()))
a = int(sum(A))
 
if n >= a:
  print(n-a)
else:
  print(-1)

n,m = map(int,input().split())
A = list(map(int,input(),split()))
a = sum(A)

if n>=a:
  print(n-a)
else:
  print(-1)

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

if N>=a:
  print(N-a)
else:
  print(-1)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
D, n = map(int.input().split())

for i in range(n):
    A[i] = input()
    i += 1
    D_sum += A[i]
    x = D - D_sum
print()

N, M = map(int,input().split())

A = list(map(int, input().split()))
A_sum = 0
for i in range(0, n):
    A_sum += A[i]
    
x = N - A_sum
if x < N:
    print("-1")
else:
    print(x)

N, M = map(int,input().split())

A = list(map(int, input().split()))
A_sum = 0
for i in range(0, n):
    A_sum += A[i]
    
x = N - A_sum
print(x)

N, M = map(int,input().split())

A = list(map(int, input().split()))
A_sum = 0
for i in range(0, M):
    A_sum += A[i]
    
x = N - A_sum
if x < 0:
    print("-1")
else:
    print(x)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
from math import floor

X, val, a = eval(input()), 100, 1

while True :
    val += floor(val * 0.01)
    if val >= X:
        break
    a += 1
print(a)

N, M = map(int, input().split())
A = list(map(int, input().split()))
daytofinish = sum(A)
if N-daytofinish < 0:
    print(-1)
else:
    print(N-daytofinish)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N, M = int(input().split())
A = input.split()
total = 0
for i in range(A):
    total = total+A[i]

if total <= N:
    print (N - total)
else:
    print ("-1")


N = int(input())
M = int(input())
total = 0

for i in range(M):
    A = int(input())
    total = total+A

if total <= N:
    print (N - total)
else:
    print (-1)


N = int(input())
M = int(input())
total = 0

for i in range(M):
  	A = int(input())
    total = total + A
    
if total <= N:
    print (N - total)
else:
  	print "-1"

N = int(input())
M = int(input())
total = 0
 
for i in range(M):
    A = int(input())
    total = total+A
 
if total <= N:
    print (N - total)
else:
    print ("-1")

import math

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

if (n-sum(a)) < 0:
    print(-1)
else:
    print(n-sum(a))


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N=int(input())
M=int(input())
A=list(range(M+1))
play_day=N-sum(A)
if play_day>0:
    print(play_day)
else:
    print(-1)

print(sum([int(r) for r in input().split(" ")])-sum([int(r) for r in input().split(" ")]))

a,b=input().split()
c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
play_day=a-(b+c)
if play_day>=0:
    print(play_day)
else:
    print(-1)

N=int(input())
M=int(input())
A=list(range(M+1))
play_day=N-sum(A)
if play_day>0:
    print(play_day)
else:
    print("-1")

([int(r) for r in input().split(" ")])-sum([int(r) for r in input().split(" ")])

a,b=map(int,input().split())
C=list(map(int,input().split()))
play_day=a-sum(C)
if play_day>=0:
    print(play_day)
else:
    print("-1")

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N, M = map(int, input().split())
A = [input().split() for i in range(M)]
 
if(sum(A) == N):
  print('0')
elif(sum(A) > N):
  print(N - sum(A))
else:
  print('-1')

N, M = map(int, input().split())
A = A = map(int, input().split())
 
if(sum(A) == N):
  print('0')
elif(sum(A) > N):
  print(N - sum(A))
else:
  print('-1')

N, M = map(int, input().split())
A = [int(input().split()) for i in range(M)]
 
if(sum(A) == N):
  print('0')
elif(sum(A) > N):
  print(N - sum(A))
else:
  print('-1')

N, M = map(int, input().split())
A = map(int, input().split())
 
if(sum(A) == N):
  print('0')
elif(sum(A) < N):
  print(N - sum(A))
else:
  print('-1')

N, M = map(int, input().split())
A = [input() for i in range(M)]
 
if(sum(A) == N):
  print('0')
elif(sum(A) > N):
  print(N - sum(A))
else:
  print('-1')

N, M = map(int, input().split())
A = [input() for i in range(M)]

if(sum(A) = N):
  print('0')
elif(sum(A) > N):
  print(N - sum(A))
else:
  print('-1')

N, M = map(int, input().split())
A = map(int, input().split())
 
if(sum(A) == N):
  print('0')
elif(sum(A) > N):
  print(sum(A) - N)
else:
  print('-1')


N, M = map(int, input().split())
A = map(int, input().split())
 
if(sum(A) == N):
  print('0')
elif(sum(A) > N):
  print(N - sum(A))
else:
  print('-1')

N, M = map(int, input().split())
A = input().split()
B = [ ]
for i in range(M):
  B.append(int(A[i]))
if(sum(B) == N):
  print('0')
elif(sum(B) < N):
  print(N - sum(B))
else:
  print('-1')

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

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

res = n - li.sum()
if res >= 0:
	print(res)
else:
    print(-1)

n, m = map(int,input().split())
li = list(map(int, input().split()))
 
res = n - sum(li)
if res >= 0:
	print(res)
else:
    print(-1)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
import math
R = int(input(""))
C = 2 * math.pi * R
print(C)

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

x = n - sum(a)
print(x if x >= 0 else -1)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n,m=map(int,input().split())
a=list(map(int,input().split()))
print(sum(a)-n)

n,m=map(int,input().split())
a=list(map(int,input().split()))
if sum(a)-n >= 0:
    print(sum(a)-n)
else:
    print(-1)

n,m=map(int,input().split())
a=list(map(int,input().split()))
if n-sum(a) >= 0:
    print(n-sum(a))
else:
    print(-1)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n,m=map(int,input().split())
a=list(map,int().input())
x=sum(a)
if n<x:
  print('-1')
else:
  print(n-x)

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

sum=sum(A)

if N>=sum:
  print('N-sum')
else('-1')


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

sum=sum(A)

if N>=sum:
  print(N-sum)
else(-1)

n,m=map(int,input().split())
a=list(map(int,input().split()))
x=sum(a)
if n<x:
  print('-1')
else:
  print(n-x)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

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

vacation = n-sum(As)
if vacation < 0:
	print('-1')
else:
	print vacation

n, m = map(int, input().split())
As = list(map(int, input().split()))

vacation = n-sum(As)
if vacation < 0:
	print('-1')
else:
	print(vacation)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

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

ans = N - sum(A)
if sum(A) < N:
    print(-1)
else:
    print(ans)

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

ans = N - sum(A):
if sum(A) < N
    print(-1)
else:
    print(ans)

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

ans = N - sum(A)
if sum(A) < N
    print(-1)
else:
    print(ans)

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

ans = N - sum(A)
if sum(A) > N:
    print(-1)
else:
    print(ans)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n, len(a)= map(int, input().split())
a= list(map(int, input().split()))
c= n-sum(a)
print(c)

n, len(a)= map(int, input().split())
a= list(map(int, input().split()))
c= n-sum(a)
print(c)


n,m= map(int, input().split())
a = list(map(int, input().split()))
c = n-sum(a)
if m == len(a) and c>= 0:
    print(c)
else:
    print(-1)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n,m=map(int, input().split())
A=list(map(int, input(0.split())))
t=0
for i in range(m):
  t+=A[i]
if t>n:
  print(-1)
else:
  print(n-t)
  
  

n,m=map(int, input().split())
A=list(map(int, input().split()))
t=0
for i in range(m):
  t+=A[i]
if t>n:
  print(-1)
else:
  print(n-t)
  
  


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N=int(input())
M=int(input())
arr=list(map(int,input().rstrip().split()))
summ=0
for i in range(M) :
	summ+=arr[i]  
if summ>=N :
	print(-1)
else :
  print(N-summ)

arr=list(map(int,input().rstrip().split()))
N=arr[0]
M=arr[1]
arr=list(map(int,input().rstrip().split()))
summ=0
for i in range(M) :
    summ+=arr[i]
if summ>N :
    print(-1)
else :
    print(N-summ)


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

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

ans=n

for i in range(m):
    ans-=a[m]
    if ans<0:
        ans=-1
        break
print(ans)


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

ans=n

for i in range(m):
    ans-=a[i]
    if ans<0:
        ans=-1
        break
print(ans)


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
d, n = map(int, input().split())
a = map(int, input().split())
remaining = d - sum(a)
print(d if d >= 0 else -1)

d, n = map(int, input().split())
a = map(int, input().split())
remaining = d - sum(a)
print(remaining if remaining >= 0 else -1)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
data = input().rstrip().split(" ")
print(data)
day = int(data[0])
task = int(data[1])
need = 0
hw = input().rstrip().split(" ")
for i in range(task):
    need += int(hw[int(i)])
answer = day - need
if answer >= 0:
    print(answer)
else:
    print("-1")



data = input().rstrip().split(" ")
day = int(data[0])
task = int(data[1])
need = 0
hw = input().rstrip().split(" ")
for i in range(task):
    need += int(hw[int(i)])
answer = day - need
if answer >= 0:
    print(answer)
else:
    print("-1")

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
/usr/local/bin/python3.8 /Users/tmohiro/Desktop/Atcoder/ABC163/B.py
314 15
9 26 5 35 8 9 79 3 23 8 46 2 6 43 3
9

Process finished with exit code 0


n, m = map(int, input().split())
A = list(map(int, input().split()))

total = sum(A)
if total > n:
    print(-1)
else:
    print(n-total)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):

def main():
    nm = list(map(int, input().split()))
    a = list(map(int, input().split()))
    aa = nm[0] - sum(a)
    print(aa) if aa < 0 else print(-1)

if __name__ == '__main__':
    main()



def main():
    nm = list(map(int, input().split()))
    a = list(map(int, input().split()))
    aa = nm[0] - sum(a)
    aa = aa if aa >= 0 else -1
    print(aa)

if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
s = [input() for i in range(2)] 
li1 = list(map(int, s[0].split()))
li2 = list(map(int, s[1].split()))
k=0;
for j in li2:
    k+=j
    print(k)
if li1[0] > k or li1[0] == k:
    print(li1[0]-k)
else:
    print('-1')

s = [input() for i in range(2)] 
li1 = list(map(int, s[0].split()))
li2 = list(map(int, s[1].split()))
k=0;
for j in li2:
    k+=j
if li1[0] > k or li1[0] == k:
    print(li1[0]-k)
else:
    print('-1')

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
#b
n,m=[int(i)for i in input().split()]
arr=[]
for i in range(m):
  x=int(input())
  arr.append(x)
s=sum(arr)
if s>n:
  print(-1)
elif s==n:
  print(0)
else:
  print(n-s)



#b
n,m=[int(i)for i in input().split()]

  arr=[int(i)for i in input().split()]
s=sum(arr)
if s>n:
  print(-1)
elif s==n:
  print(0)
else:
  print(n-s)



#b
n,m=[int(i)for i in input().split()]

arr=[int(i)for i in input().split()]
s=sum(arr)
if s>n:
  print(-1)
elif s==n:
  print(0)
else:
  print(n-s)



Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
user = list(eval(input().replace(" ",",")))
print(user)
sum = 0
for i in user:
    if i == user[0]:
        continue
    elif i == user[1]:
        continue
    sum = sum + i
print(sum - user[0])

user1 = eval(input())
user2 = eval(input())
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + i
print(user1 - sum)

N = eval(input())
M = eval(input())
user = list(eval(input().replace(" ",",")))
sum = 0
for i in user:
    sum = sum + i
result = N - sum
if result < 0:
    print(-1)
else:
    print(result)

N,M = (input()).split()
task = input().split()
list1 = []
sum = 0
for i in task:
    list1.append(i)
for j in list1:
    sum = sum + int(j)
result = int(N) - sum
if result < 0:
    print(-1)
else:
    print(result)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
def main():
  n, m = map(int, input().split())
  l = list(map(int, input(.split())))
  ans = n - sum(l)
  if ans < 0:
      ans = -1
  print(ans)

if __name__ == '__main__':
  main()

def main():
  n, m = map(int, input().split())
  l = list(map(int, input().split()))
  ans = n - sum(l)
  if ans < 0:
      ans = -1
  print(ans)

if __name__ == '__main__':
  main()

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N,M=map(int,input())
A=list(map(int,input()))
print(N-sum(A))

N,M=map(int,input().split())
A=list(map(int,input().split()))
print(N-sum(A) if N-sum(A) >=0 else -1)


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

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

A =[]

for i in range(M):
  A.append(int(input().split()))

gokei = int(sum(A))

if N - gokei < 0:
  print('-1')

else:
  print(N - gokei)

N, M = map(int, input().split())

A =[]

for i in range(M):
  A.append(input())

gokei = int(sum(A))

if N - gokei < 0:
  print('-1')

else:
  print(N - gokei)

N, M = map(int, input().split())

A =[]

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

gokei = int(sum(A))

if N - gokei < 0:
  print('-1')

else:
  print(N - gokei)



Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n,m=map(int,input().split())
hw_days=0
for i in range(m):
  hw_days+=int(input())
print(n-hw_days if (n-hw_days)>0 else -1)

n,m=map(int,input().split())
list1=list(map(int,input().split()))
ans=n-sum(list1)
print(ans if ans>=0 else -1)
  


Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n, m = map(int, input().split())
a = list(map(int, input().split()))
d = n-sum(a)
if(a<0):
  d = -1
pritn(d)

n, m = map(int, input().split())
a = list(map(int, input().split()))
d = n-sum(a)
if(d<0):
  d = -1
print(d)

Verdicts: Runtime Error

Accepted