Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03166 (python)

Fixed submission:
import sys
sys.setrecursionlimit(100000)
N,M = map(int,input().split())
graph = [[] for i in range(10**5 + 10)]
dp = [-1 for i in range(10**5 + 10)]

for i in range(M):
    x,y = map(int,input().split())
    graph[x-1].append(y-1)
    
def rec(v):
    if dp[v] != -1:
        return dp[v]
    tmp = 0
    for x in graph[v]:
        r = rec(x)+1
        if tmp < r:
            tmp = r
    dp[v] = tmp
    return dp[v]

result = 0
for i in range(N):
    r = rec(i)
    result = r if r>result else result
print(result)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10000)
N,M = map(int,input().split())
graph = [[] for i in range(10**5 + 10)]
dp = [-1 for i in range(10**5 + 10)]

for i in range(M):
    x,y = map(int,input().split())
    graph[x-1].append(y-1)
    
def rec(v):
    if dp[v] != -1:
        return dp[v]
    tmp = 0
    for x in graph[v]:
        r = rec(x)+1
        if tmp < r:
            tmp = r
    dp[v] = tmp
    return dp[v]

result = 0
for i in range(N):
    r = rec(i)
    result = r if r>result else result
print(result)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
graph = [[] for i in range(10**5 + 10)]
dp = [-1 for i in range(10**5 + 10)]

for i in range(M):
    x,y = map(int,input().split())
    graph[x-1].append(y-1)
    
def rec(v):
    if dp[v] != -1:
        return dp[v]
    tmp = 0
    for x in graph[v]:
        r = rec(x)+1
        if tmp < r:
            tmp = r
    dp[v] = tmp
    return dp[v]

result = 0
for i in range(N):
    r = rec(i)
    result = r if r>result else result
print(result)
Problem p03283 (python)

Fixed submission:
N,M,Q = map(int,input().split())
vote = [[0 for _ in range(N+1)] for _ in range(N+1)]
cum = [[0 for _ in range(N+1)] for _ in range(N+1)]
for i in range(M):
    l,r = map(int,input().split())
    vote[l][r] += 1
for i in range(1,N+1):
    for j in range(1,N+1):
        cum[i][j] = vote[i][j]+cum[i-1][j]+cum[i][j-1]-cum[i-1][j-1]
for i in range(Q):
    p,q = map(int,input().split())
    print(cum[q][q]-cum[q][p-1]-cum[p-1][q]+cum[p-1][p-1])

Buggy submission (verdict: Runtime Error):
import numpy as np
N,M,Q = map(int,input().split())
vote = np.array([[0 for _ in range(N)] for _ in range(N)])
for i in range(M):
    l,r = map(int,input().split())
    vote[:l,r-1:] += 1
for i in range(Q):
    p,q = map(int,input().split())
    print(vote[p-1][q-1])
Problem p02768 (python)

Fixed submission:
def com(n, r, mod):
    num = 1
    denom = 1
    for i in range(r):
        denom = (denom * (i+1)) % mod
        num = (num * (n-i)) % mod
    return num*pow(denom, mod-2, mod)

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

mod = 10**9 + 7

sum = pow(2, n, mod) - 1
sum -= com(n, a, mod)
sum -= com(n, b, mod)

print(int(sum % mod))

Buggy submission (verdict: Runtime Error):
import math
from scipy.special import comb

def comb(n, r, mod):
    num = 1
    denom = 1
    for i in range(r):
        denom = (denom * (i+1)) % mod
        num = (num * (n-i)) % mod
    return num*pow(denom, mod-2, mod)

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

mod = 10**9 + 7

sum = pow(2, n, mod) - 1
sum -= comb(n, a, mod)
sum -= comb(n, b, mod)

print(int(sum % mod))

Buggy submission (verdict: Runtime Error):
import math
from scipy.special import comb

def comb(n, r, mod):
    num = 1
    denom = 1
    for i in range(r):
        denom = (denom * (i+1)) % mod
        num = (num * (n-i)) % mod
    return num*pow(denom, mod-2, mod)

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

mod = 10**9 + 7

sum = pow(2, n, mod) - 1
sum -= comb(n, a, mod)
sum -= comb(n, b, mod)

print(int(sum % mod))

Buggy submission (verdict: Runtime Error):
import math
from scipy.special import comb

def comb(n, r, mod):
    num = 1
    denom = 1
    for i in range(r):
        denom = (denom * (i+1)) % mod
        num = (num * (n-i)) % mod
    return num*pow(denom, mod-2, mod)

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

mod = 10**9 + 7

sum = pow(2, n, mod) - 1
sum -= comb(n, a, mod)
sum -= comb(n, b, mod)

print(int(sum % mod))
Problem p02783 (python)

Fixed submission:
import math
h, a = map(int,input().split())
num = math.ceil(h/a)

print(num)

Buggy submission (verdict: Runtime Error):
import math

h, n = map(int,input().split())
a = list(map(int,input().split()))
sum = 0
for i in range(n):
    sum += a[i]

if sum >= h:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
h, n = map(int,input().split())
a = list(map(int,input().split()))
sum = 0
for i in range(n):
    sum += a[i]

if sum >= h:
    print('Yes')
else:
    print('No')
Problem p03103 (python)

Fixed submission:
import numpy as np
n, m = map(int, input().split())

a = np.zeros((n,2))


for i in range(n):
    a[i] = list(map(int, input().split()))


aSorted = sorted(a, key=lambda ai: ai[0])

mc = 0
ans = 0
for ai, bi in aSorted:
    if mc + bi <= m:
        mc += bi
        ans += bi * ai
    else:
        mm = m - mc
        ans += mm * ai
        break
print(int(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np
n, m = map(int, input().split())

v = np.zeros((n, m))
a = np.zeros((n,2))


for i in range(n):
    a[i] = list(map(int, input().split()))


aSorted = sorted(a, key=lambda ai: ai[0])

mc = 0
ans = 0
for ai, bi in aSorted:
    if mc + bi <= m:
        mc += bi
        ans += bi * ai
    else:
        mm = m - mc
        ans += mm * ai
        break
print(int(ans))
Problem p02765 (python)

Fixed submission:
n,k = map(int,input().split())
if n >= 10:
    print(k)
else :
    print(k+100*(10-n))

Buggy submission (verdict: Runtime Error):
n,k = int(input().split())
if n >= 10:
    print(k)
else :
    print(k+100*(10-n))
Problem p02772 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
for i in a:
    if i%2==0:
        if i%3 !=0 and i%5 !=0:
            print('DENIED')
            exit()
print('APPROVED')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
for i in range(a):
    if i%2==0:
        if i%3 !=0 and i%5 !=0:
            print('DENIED')
            exit()
print('APPROVED')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
for i in range(a):
    if i%2==0:
        if i%3 !=0 or i%5 !=0:
            print('DENIED')
print('APPROVED')
Problem p02783 (python)

Fixed submission:
import math
h,a = map(int,input().split())
print(math.ceil(h/a))

Buggy submission (verdict: Runtime Error):
h,a = map(int,input().split())
print(h\\a)
Problem p03136 (python)

Fixed submission:
n = int(input())
s = list(map(int,input().split()))
print( 'Yes' if max(s) < sum(s)-max(s) else 'No')

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [int(input()).split() for i range(n)]
print( 'Yes' if max(s) < sum(s)-max(s) else 'No')
Problem p03369 (python)

Fixed submission:
n = input()
print(700 +100*n.count('o'))

Buggy submission (verdict: Runtime Error):
n = input()
print(700 + (n.count('o')*100)
Problem p03447 (python)

Fixed submission:
a,b,c = [int(input()) for i in range(3)]
n = a-b
print(n%c)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
n = a-b
print(n%c)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
n = a-b
print(n%b)
Problem p03455 (python)

Fixed submission:
a,b = map(int,input().split())
c = a*b
if c%2 == 0:
    print('Even')
else :
    print('Odd')

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
c = a*b
if c%2 = 0:
    print('Even')
else :
    print('Odd')
Problem p03493 (python)

Fixed submission:
a=input()
print(a.count("1"))

Buggy submission (verdict: Runtime Error):
a=int(input())
print(a.count("1"))
Problem p03502 (python)

Fixed submission:
n = input()
x = sum(map(int,n))
print('Yes' if int(n)%x == 0 else 'No')

Buggy submission (verdict: Runtime Error):
n = input()
x = sum(map(int,n))
print('Yes' if n%x == 0 else 'No')
Problem p03556 (python)

Fixed submission:
n = int(input())
print(int(n**.5)**2)

Buggy submission (verdict: Runtime Error):
n = int(input())
print(int(n**.5)
Problem p03605 (python)

Fixed submission:
n = input()
if '9' in n:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = (input)
if 9 in n:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
if '9' in n:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
if 9 in n:
    print('Yes')
else:
    print('No')
Problem p03671 (python)

Fixed submission:
n = list(map(int,input().split()))
m = sorted(n)
print(m[0]+m[1])

Buggy submission (verdict: Runtime Error):
n = list[input().split()]
m = sorted(n)
print(m[0]+m[1])
Problem p03719 (python)

Fixed submission:
a,b,c = map(int,input().split())
print('Yes' if a<=c<=b else 'No')

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=[list(map(int,input().split())) for _ in range(M)]
 
ans=[0]
for a in A:
    ans[a[0]-1]+=1
    ans[a[1]-1]+=1
 
for a in ans:
    print(a)
Problem p03720 (python)

Fixed submission:
N,M =map(int,input().split())
c = []
for i in range(M):
    a,b = map(int,input().split())
    c.append(a)
    c.append(b)
for j in range(N):
    print(c.count(j+1))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=[list(map(int,input().split())) for _ in range(M)]
 
ans=[0]
for a in A:
    ans[a[0]-1]+=1
    ans[a[1]-1]+=1
 
for a in ans:
    print(a)
Problem p03773 (python)

Fixed submission:
a,b = map(int,input().split())
if a+b <= 23:
    print(a+b)
else:
    print(a+b-24)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a+b =< 23:
    print(a+b)
else:
    print(a+b-24)
Problem p03796 (python)

Fixed submission:
import math 
n=int(input())
n =math.factorial(n)
m = (10**9) + 7
print(n%m)

Buggy submission (verdict: Runtime Error):
import math 
n=int(input())
n =math.factorial(n)
m = (10**9) + 7
if n < m:
    prtint(n)
else :
    print(n%m)
Problem p03852 (python)

Fixed submission:
n = input()
if n in 'aiueo':
    print('vowel')
else:
    print('consonant')

Buggy submission (verdict: Runtime Error):
n = input()
if 'n' in 'aiueo'
    print('vowel')
else:
    print('consonant')

Buggy submission (verdict: Runtime Error):
n = input()
List = [a,i,u,e,o]
if 'n' in List:
    print('vowel')
else:
    print('consonant')

Buggy submission (verdict: Runtime Error):
n = input()
List = [a,i,u,e,o]
if n in List:
    print('vowel')
else:
    print('consonant')
Problem p03943 (python)

Fixed submission:
List = sorted(list(map(int,input().split())))
print('Yes' if List[0] + List[1] == List[2] else 'No')

Buggy submission (verdict: Runtime Error):
List = list(map(int,input().split()))
List2 = sorted(List)
print('Yes' if List2[0] + List2[1] == List2[2] else 'No') )

Buggy submission (verdict: Runtime Error):
List = list(map(int,input().split()))
List2 = sorted(List)
print('Yes' if List2[0] + List2[1] == List2[3] else 'No')

Buggy submission (verdict: Runtime Error):
List = list(map,input().split())
List2 = sorted(List)
print('Yes' if List2[0] + List2[1] == List2[3] else 'No')

Buggy submission (verdict: Runtime Error):
List = list[input().split()]
List2 = sorted(List)
print('Yes' if List2[0] + List2[1] == List2[3] else 'No')
Problem p02755 (python)

Fixed submission:
a,b = map(int, input().split())
ans = -1
for i in range(1001) :
  a1 = int(i*0.08)
  b1 = int(i*0.1)
  if a1 == a and b1 == b :
    ans = i
    break
print(ans)

Buggy submission (verdict: Runtime Error):
a , b = map(int, input().split())
for i in range(1 , 10100) :
  a1 = int(i*0.08)
  b1 = int(i*0.10)
  if a1 = a and b1 = b :
    print(i)
  else :
    print(-1)
Problem p02909 (python)

Fixed submission:
s = input()
if s == "Sunny" :
  print("Cloudy")
elif s == "Cloudy":
  print("Rainy")
else :
  print("Sunny")

Buggy submission (verdict: Runtime Error):
s = input()
if s == "Sunny" :
  print("Cloudy")
elif s = "Cloudy":
  print("Rainy")
else :
  print("Sunny")
Problem p03067 (python)

Fixed submission:
a ,b ,c = map(int,input().split())
if a > c> b or b > c > a :
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
s_list = list(s) 
for i in range(0 , n) :
    if s_list[i] == s_list[k] :
        s_list[i] = "*"
print(s_list)

Buggy submission (verdict: Runtime Error):
7 3 1

Buggy submission (verdict: Runtime Error):
7 3 1
Problem p03068 (python)

Fixed submission:
n = int(input())
s = input()
k = int(input())
s_list = list(s) 
for i in range(0 , n) :
    if s_list[i] != s_list[k-1] :
        s_list[i] = "*"
a = "".join(s_list)
print(a)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
s_list = list(s) 
for i in range(0 , n) :
    if s_list[i] == s_list[k] :
        s_list[i] = "*"
a = "".join(s_list)
print(a)
Problem p03106 (python)

Fixed submission:
a,b,k = map(int,input().split())
d = []
for i in range(1 ,101) :
  if a % i == 0 and b % i == 0 :
    d.append(i)
d.sort(reverse = True)
print(d[k-1])

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
d = []
for i in range(100) :
  if a % i == 0 and b % i == 0 :
    d.append(i)
d.sort(reverse = True)
print(d[k-1])
Problem p03109 (python)

Fixed submission:
a = input()
date = list(a)
year = int(date[0])*1000 + int(date[1])*100 + int(date[2])*10 + int(date[3])
mon = int(date[5])*10 + int(date[6])
day = int(date[8])*10 + int(date[9])
if year < 2019 or mon < 5 :
  print("Heisei")
else :
  print("TBD")

Buggy submission (verdict: Runtime Error):
a = input()
date = list(a)
year = int(date[0])*1000 + int(date[1])*100 + int(date[2])*10 + int(date[3])
mon = int(date[4])*10 + int(date[5])
day = int(date[6])*10 + int(date[7])
if year < 2019 and mon < 5 :
  print("Heise")
else :
  print("TBD")
Problem p03129 (python)

Fixed submission:
n,k = map(int,input().split())
m = int(n/2)+n%2
ans = 'YES' if m>=k else 'NO'
print(ans)

Buggy submission (verdict: Runtime Error):
k,a,b = map(int,input().split())
if b-a <= 2:
  print(k+1)
elif  a+1 >= k:
  print(k+1)
else:
  print(a+int((k+1-a)/2)*max(2,(b-a))+(k+1-a)%2)
Problem p03238 (python)

Fixed submission:
n = int(input())

if n ==1:
    print('Hello World')

else:
    ab = [int(input()) for i in range(2)]
    print(ab[0]+ab[1])

Buggy submission (verdict: Runtime Error):
n = [int(input()) for i in range(3)]

if n[0] ==1:
    print('Hello World')

else:
    print(n[1]+n[2])
Problem p03361 (python)

Fixed submission:
h,w = map(int, input().split())
k = [list(input()) for i in range(h)]

ans = True
for i in range(1,h-2):
    for j in range(1,w-2):
        if k[i][j] == "#" and k[i-1][j] =="." and k[i][j-1] =="." and k[i+1][j] =="." and k[i][j+1] =="." :
            ans = False

if ans:
    print('Yes')

else:
    print('No')

Buggy submission (verdict: Runtime Error):
h,w = map(int, input().split())
k = [list(input()) for i in range(h)]

ans = True
for i in range(1,h):
    for j in range(1,w):
        if k[i][j] == "#" and k[i-1][j] =="." and k[i][j-1] =="." and k[i+1][j] =="." and k[i][j+1] =="." :
            ans = True

if ans:
    print('Yes')

else:
    print('No')

Buggy submission (verdict: Runtime Error):
h,w = map(int, input().split())
k = [list(input()) for i in range(h)]

ans = True
for i in range(h):
    for j in range(w):
        if k[i][j] == "#" and k[i-1][j] =="." and k[i][j-1] =="." and k[i+1][j] =="." and k[i][j+1] =="." :
            ans = True

if ans:
    print('Yes')

else:
    print('No')
Problem p03693 (python)

Fixed submission:
rgb = input().split()
ans = "".join(rgb)
ans = int(ans)
if ans%4 == 0:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
col = [0 for i in range(n)]
cnt = 0
for i in range(n):
    if 1 <= a[i] <=399:
        col[i] = "b"
    elif 400<= a[i]<=799:
        col[i] = "c"
    elif 800<= a[i]<=1199:
        col[i] = "d"
    elif 1200<= a[i]<=1599:
        col[i] = "e"
    elif 1600<= a[i]<=1999:
        col[i] = "f"
    elif 2000<= a[i]<=2399:
        col[i] = "g"
    elif 2400<= a[i]<=2799:
        col[i] = "h"
    elif 2800<= a[i]<=3199:
        col[i] = "j"
    else:
        col[i] = "k"
        cnt += 1
colv = list(set(col))
mn =mx = len(colv)
if "k" in colv:
        mn -=1
        mx += cnt-1
        if mn == 0:
            mn =1
        
print(str(mn)+" "+str(mx))
Problem p03037 (python)

Fixed submission:
n, m = map(int, input().split())
l, r = 0, 100001
for i in range(m):
    x, y = map(int, input().split())
    if l <= x:
        l = x
    if r >= y:
        r = y
print(len([x for x in range(l, r+1)]))

Buggy submission (verdict: Runtime Error):
100000 1
1 100000
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())

if (a*b)%2 == 0:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())

if aBb%2 == 0:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())

if aBb%2 == 0:
  print('even')
else:
  print('odd')
Problem p03493 (python)

Fixed submission:
s = input()
count = 0

for i in range(3):
  if s[i] == '1':
    count += 1
    
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
numbers = list(map(int, input().split()))
count = [0]*n

for i in range(n):
  while True:
    if numbers[i]%2 == 1:
  	  break
    numbers[i] = numbers[i]/2
    count[i] += 1
  
print(min(count))

Buggy submission (verdict: Runtime Error):
n = int(input())
numbers = list(map(int, input().split()))
count = [0]*n

for i in range(n):
  if numbers[i]%2 == 1:
    continue
  numbers[i] = numbers[i]/2
  count[i] += 1
  
print(min(count))

Buggy submission (verdict: Runtime Error):
n = int(input())
numbers = list(map(int, input().split()))

res = 0

for i in range(n):
  count = 0
  while True:
    if numbers[i]%2 == 1:
      break
    numbers[i] = numbers[i]/2 
    count += 1
  
  if count > res:
    res = count

print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
numbers = list(map(int, input().split()))

res = 0

for i in range(n):
  count = 0
  while True:
    if numbers[i]%2 == 1:
      break
    else:
      count += 1
  
  if count > res:
    res = count

print(res)
Problem p02801 (python)

Fixed submission:
C = input()
alpha_list = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(alpha_list)-1):
  if C == alpha_list[i]:
    print(alpha_list[i+1])

Buggy submission (verdict: Runtime Error):
C = input()
alpha_list = 'abcdefghijklmnopqrstuvwxyz'
if C == alpha_list[i]:
  print(alpha_list[i+1])

Buggy submission (verdict: Runtime Error):
C = input()
alpha_list = [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
i = alpha_list.index(C)
print(alpha_list[i+1])
Problem p02802 (python)

Fixed submission:
N,M = map(int,input().split())
check = [0]*N
ac = 0
penalty = 0
for i in range(M):
  pi, si = input().split()
  pi = int(pi)
  if check[pi-1] == -1:
    continue
  if si == 'WA':
    check[pi-1] += 1
  else:
    ac += 1
    penalty += check[pi-1]
    check[pi-1] = -1
print(ac,penalty)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
check = [0]*(N+1)
ac = 0
penalty = 0
for i in range(M):
  pi, si = input().split()
  pi = int(pi)
  if check[pi] == -1:
    continue
  if si == 'WA':
    check[pi] += 1
  else:
    ac += 1
    penalty += check[pi]
    check[pi] = -1
print(ac,wa)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
check = [0]*N
ac = 0
penalty = 0
for i in range(M):
  pi, si = input().split()
  pi = int(pi)
  if check[pi-1] == -1:
    continue
  if si == 'WA':
    check[pi-1] += 1
  else:
    ac += 1
    penalty += check[pi-1]
    check[pi-1] = -1
print(ac,wa)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
penalty =0
check = [0]*N
ac = 0
wa = 0
for i in range(M):
  pi, si = input().split()
  pi = int(pi)
  if check[pi] == -1:
    continue
  if si = 'WA':
    check[pi] += 1
  else:
    ac += 1
    wa += check[pi]
    check[pi] = -1
print(ac,wa)
Problem p02823 (python)

Fixed submission:
N,A,B = map(int,input().split())
if (B-A)%2 == 0:
  print((B-A)//2)
else:
  print( (B-A)//2 + 1 +min(A-1,N-B) )

Buggy submission (verdict: Runtime Error):
N,M,V,P = map(int, input().split())
A = list(map(int,input().split()))
A.sort(reverse=True)
count = 0
for i in range (N):
  if i <= P:
    count += 1
  elif A[i] + M < A[P-1]:
    continue
  else:
    sum = M*(P-1) + M*(N-(i+1)) 
    for j in range (P,i-1):
      sum += A[P-1]+M -A[j]
    if sum >= M*V:
      count +=1
print(count)
Problem p02981 (python)

Fixed submission:
a,b,c = map(int,input().split())
train =a*b
if train > c:
  print(c)
else:
  print(train)

Buggy submission (verdict: Runtime Error):
l,r = map(int, input().split())
if r-l+1>2019:
  print(0)
  exit()
L = []
for i in range(l,r):
  for j in range(i+1,r):
    a = i*j
    b = a%2019
    L.append(b)
print(min(L))
Problem p02982 (python)

Fixed submission:
import numpy as np
n,d = map(int, input().split())
l=[]
for i in range(n):
  l.append(list(map(int, input().split())))
count = 0
for i in range(n):
  for j in range(i+1,n):
    distance_a = 0
    for k in range(d):
      distance_k= l[i][k]-l[j][k]
      distance_a +=distance_k**2
    distance = np.sqrt(distance_a)
    distance_int =int(distance)
    if distance == distance_int:
      count += 1
print(count)

Buggy submission (verdict: Runtime Error):
import numpy as np
n,d = map(int, input().split())
l=[]
for i in range(n):
  l.append(list(map(int, input().split())))
count = 0
for i in range(n):
  for j in range(i+1,n):
    distance_a = 0
    for k in range(d):
      distance_k= l[i][k]-l[j][k]
      distance_a +=distance_k**2
    distance = np.sqrt(distance_a)
    if distance = int:
      count += 1
print(count)
Problem p02983 (python)

Fixed submission:
l,r = map(int, input().split())
if r-l+1>2019:
  print(0)
  exit()
L = []
for i in range(l,r):
  for j in range(i+1,r+1):
    a = i*j
    b = a%2019
    L.append(b)
print(min(L))

Buggy submission (verdict: Runtime Error):
l,r = map(int, input().split())
if r-l+1>2019:
  print(0)
  exit()
L = []
for i in range(l,r-1):
  for j in range(i+1,r):
    a = i*j
    b = a%2019
    L.append(b)
print(min(L))

Buggy submission (verdict: Runtime Error):
l,r = map(int, input().split())
L = []
for i in range(l,r-1):
  for j in range(i+1,r):
    a = i*j
    b = a%2019
    L.append(b)
print(min(L))

Buggy submission (verdict: Runtime Error):
l,r = map(int, input().split())
L = []
for i in range(l,r-1):
  for j in range(i+1,r):
    a = i*j
    b = a%2019
    l.append(b)
print(min(l))
Problem p02909 (python)

Fixed submission:
S = input()

if S == 'Sunny':
    print('Cloudy')
elif S == 'Cloudy':
    print('Rainy')
else:
    print('Sunny')

Buggy submission (verdict: Runtime Error):
S = input()

if S == 'Sunny':
    print('Cloudy')
elif S == 'Cloudy':
    print('Rainy')
else:
    print(Sunny)
Problem p02755 (python)

Fixed submission:
import math

tmp = input().split()
A = int(tmp[0])
B = int(tmp[1])
eight_list = []
ten_list = []
eight_min = math.ceil(A/0.08)
ten_min = math.ceil(B/0.10)
eight_list.append(eight_min)
ten_list.append(ten_min)

eight_min += 1
while(math.floor(eight_min*0.08)==A):
    eight_list.append(eight_min)
    eight_min += 1

ten_min += 1
while(math.floor(ten_min*0.10)==B):
    ten_list.append(ten_min)
    ten_min += 1

#print(eight_list)
#print(ten_list)
try:
    print(min(set(eight_list)&set(ten_list)))
except ValueError:
    print(-1)

Buggy submission (verdict: Runtime Error):
import math

tmp = input().split()
A = int(tmp[0])
B = int(tmp[1])
eight_list = []
ten_list = []
eight_min = math.ceil(A/0.08)
ten_min = math.ceil(B/0.10)
eight_list.append(eight_min)
ten_list.append(ten_min)

eight_min += 1
while(math.floor(eight_min*0.08)==A):
    eight_list.append(eight_min)
    eight_min += 1

ten_min += 1
while(math.floor(ten_min*0.10)==B):
    ten_list.append(ten_min)
    ten_min += 1

#print(eight_list)
#print(ten_list)

print(min(set(eight_list)&set(ten_list)))