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

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

print(a*b)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())

print(a*b)
Problem p02713 (python)

Fixed submission:
# coding: utf-8
 
N  = int(input())
sum = 0
 
import math
from functools import reduce
 
def gcd(*numbers):
    return reduce(math.gcd, numbers)
 
for i in range (N):
    for j in range(N):
        for k in range(N):
            sum += gcd(*[i+1, j+1, k+1])
 
print(sum)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
N  = int(input())
sum_pre = 0
sum = 1
 
import math
from functools import reduce
 
def gcd(*numbers):
    return reduce(math.gcd, numbers)
 
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
 
for x in range(N):  
    for i in range (N):
        for j in range(N):
            for k in range(N):
                sum_pre += gcd(*[i, j, k])
     sum += sum_pre
 
print(sum)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
N  = int(input())
sum_pre = 0
sum = 1
 
import math
from functools import reduce
 
def gcd(*numbers):
    return reduce(math.gcd, numbers)
 
def gcd_list(numbers):
    return reduce(math.gcd, numbers)

for x in range(N):  
    for i in range (N):
        for j in range(N):
            for k in range(N):
                sum_pre += gcd([i, j, k])
     sum += sum_pre

print(sum)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
N  = int(input())
sum = 0

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

for i in range (N):
    for j in range(N):
        for k in range(N):
            sum += gcd([i, j, k])

print(sum)
Problem p02718 (python)

Fixed submission:
# coding: utf-8
 
a=list(map(int,input().split()))
#読み込み
N = a[0]
M = a[1]
 
b=list(map(int,input().split()))
#総得票数
Sum_vote = sum(b)
list.sort(b, reverse=True)

if b[M-1] < (Sum_vote /( 4 * M)):
    print("No")
else :
    print("Yes")

Buggy submission (verdict: Runtime Error):
# coding: utf-8

a=list(map(int,input().split()))
#読み込み
N = a[0]
M = a[1]
b=list(map(int,input().split()))
#総得票数
Sum_vote = sum(b)
list.sort(b, reverse=True)

if b[M] < (Sum_vote / 4 * M):
    print("No")
else :
    print("Yes")
Problem p02922 (python)

Fixed submission:
# coding: utf-8
 
a,b=list(map(int,input().split()))
 
mouse_tot = 1
mouse_cnt = 0
add_mouse = a-1
 
while mouse_tot <  b:
    mouse_tot += add_mouse
    mouse_cnt += 1
 
if b==0:
    mouse_cnt = 0
 
print(mouse_cnt)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
a,b=list(map(int,input().split()))
 
mouse_tot = a
mouse_cnt = 1
wa = a-1
 
while True:
    if mouse_tot = b:
        break
    elif mouse_tot < b:
        mouse_tot += wa
        mouse_cnt += 1
 
print(mouse_cnt)
Problem p03161 (python)

Fixed submission:
N,K=map(int,input().split())
h=list(map(int,input().split()))
cost=[0,abs(h[1]-h[0])]

for i in range(2,N):
    cand=10**10
    for j in range(K):
        if j==i:
            break
        cand=min(cand,cost[i-j-1]+abs(h[i]-h[i-j-1]))
    cost.append(cand)
print(cost[-1])

Buggy submission (verdict: Runtime Error):
N,k = map(int, input().split())
a =  list(map(int,input().split()))
b = [0, abs(a[1]-a[0])]
c = []
for i in range(2,N):
    for j in range(k):
        c[j] = b[i-j]+abs(a[i]-a[i-j]),b[i-j]+abs(a[i]-a[i-j]))
    b.append(min(c))
    

print(b[-1])
Problem p03971 (python)

Fixed submission:
N, A, B = map(int, input().split())
S = input()
count = 0
count2 = 0


for i in range(N):
    if S[i] == "c":
        print("No")
    elif S[i] == "a":
        
        if count < A+B:
            print("Yes")
            count += 1
        else:
            print("No")
    elif S[i] == "b":
        
        if count < A+B and count2 < B:
            print("Yes")
            count += 1
            count2 += 1
        else:
            print("No")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
As = list(input().rstrip().split(" "))
N = int(As[0])
A = int(As[1])
B = int(As[2])
 S  = input()
cnt = 1
 
for i in range(N):
    if S[i] == "c":
        print("No")
 
    elif S[i] == "a":
        if cnt < A+B:
            print("Yes")
            cnt +=1
        else:
            print("No")
 
    elif S[i] == "b":
        if cnt < B:
            print("Yes")
            cnt +=1
        else:
            print("No")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
N,A,B=list(map(int,input().split()))
 S  = input()
cnt = 1
 
for i in range(N):
    if S[i] == "c":
        print("No")
 
    elif S[i] == "a":
        if cnt < A+B:
            print("Yes")
            cnt +=1
        else:
            print("No")

    elif S[i] == "b":
        if cnt < B:
            print("Yes")
            cnt +=1
        else:
            print("No")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
As = list(input().rstrip().split(" "))
N = As[0]
A = As[1]
B = As[2]
 
S  = input()
 
for i in range(N):
    if S[i] == "c":
        print("No")
    elif S[i] == "a":
        if i < A+B:
            print("Yes")
        else:
            print("No")
    elif S[i] == "b":
        if i < B:
            print("Yes")
        else:
            print("No")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
pre_list = list(input().rstrip().split(" "))
N = pre_list[0]
A = pre_list[1]
N = pre_list[2]
 
S  = input()
 
for i in range(N):
    if S[i] == "c":
        print("No")
    elif S[i] == "a":
        if i < A+B:
            print("Yes")
        else:
            print("No")
    elif S[i] == "b":
        if i < B:
            print("Yes")
        else:
            print("No")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
pre_list = list(input().rstrip().split(""))
N = pre_list[0]
A = pre_list[1]
N = pre_list[2]

S  = input()
 
for i in range(N):
    if S[i] == "c":
        print("No")
    elif S[i] == "a":
        if i < A+B:
            print("Yes")
        else:
            print("No")
    elif S[i] == "b":
        if i < B:
            print("Yes")
        else:
            print("No")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
 
N,A,B=list(map(int,input().split()))
 S  = input()

for i in range(N):
    if S[i] == "c":
        print("No")
    elif S[i] == "a":
        if i < A+B:
            print("Yes")
        else:
            print("No")
    elif S[i] == "b":
        if i < B:
            print("Yes")
        else:
            print("No")
Problem p02600 (python)

Fixed submission:
#for _ in range(int(input())):
n=int(input())
if n>=400 and n<=599:print(8)
elif n>=600 and n<=799:print(7)
elif n>=800 and n<=999:print(6)
elif n>=1000 and n<=1199:print(5)
elif n>=1200 and n<=1399:print(4)
elif n>=1400 and n<=1599:print(3)
elif n>=1600 and n<=1799:print(2)
elif n>=1800 and n<=1999:print(1)

Buggy submission (verdict: Runtime Error):
#for _ in range(int(input())):
def zeroPad(numberString, zeros, left = True):
    """Return the string with zeros added to the left or right."""
    for i in range(zeros):
        if left:
            numberString = '0' + numberString
        else:
            numberString = numberString + '0'
    return numberString
def karatsubaMultiplication(x ,y):
    """Multiply two integers using Karatsuba's algorithm."""
    #convert to strings for easy access to digits
    x = str(x)
    y = str(y)
    #base case for recursion
    if len(x) == 1 and len(y) == 1:
        return int(x) * int(y)
    if len(x) < len(y):
        x = zeroPad(x, len(y) - len(x))
    elif len(y) < len(x):
        y = zeroPad(y, len(x) - len(y))
    n = len(x)
    j = n//2
    #for odd digit integers
    if (n % 2) != 0:
        j += 1    
    BZeroPadding = n - j
    AZeroPadding = BZeroPadding * 2
    a = int(x[:j])
    b = int(x[j:])
    c = int(y[:j])
    d = int(y[j:])
    #recursively calculate
    ac = karatsubaMultiplication(a, c)
    bd = karatsubaMultiplication(b, d)
    k = karatsubaMultiplication(a + b, c + d)
    A = int(zeroPad(str(ac), AZeroPadding, False))
    B = int(zeroPad(str(k - ac - bd), BZeroPadding, False))
    return A + B + bd
n,k=map(int,input().split())
x=[int(x) for x in input().split()]
ans=[1]*n
ans[0]=x[0]
for i in range(1,k):
  ans[i]=ans[i-1]*x[i]
c=0
for i in range(k,n):
  ans[i]=karatsubaMultiplication(ans[i-1],x[i])/x[c]
  if ans[i]>ans[i-1]:
    print('Yes')
  else:print('No')
  c+=1
Problem p02621 (python)

Fixed submission:
n=int(input())
print(n+n**2+n**3)

Buggy submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
x=[int(x) for x in input().split()]
y=[int(x) for x in input().split()]
c=0
cost=0
f,t=0,0
x.sort()
y.sort()
for i in range(n):
    if i<n and cost<k and cost+x[i]<=k and f==0:
        cost+=x[i]
        c+=1
    else:f=1
    if i<m and  cost<k and cost+y[i]<=k and t==0:
        cost+=y[i]
        c+=1
    else:t=1
i+=1
if m>n and t==0:
    while(i<(m)):
        if cost+y[i]<=k and cost<k:
            cost+=y[i]
            c+=1
        i+=1
c1=0
cost=0
for i in range(n):
    if cost+x[i]<=k:
        cost+=x[i]
        c1+=1
c2=0
cost=0
for i in range(m):
    if cost+y[i]<=k:
        cost+=y[i]
        c2+=1
print(max(c1,c2,c))
Problem p02706 (python)

Fixed submission:
n,m=map(int,input().split())
a=[int(x) for x in input().split()]
if n-sum(a)<0:
  print(-1)
else:
  print(n-sum(a))

Buggy submission (verdict: Runtime Error):
m=map(int,input().split())
a=[int(x) for x  in input().split()]
if sum(a)-n<0:
  print(-1)
else:
  print(sum(a)-n)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[int(x) for x i in input().split()]
if sum(a)-n<0:
  print(-1)
else:
  print(sum(a)-n)
Problem p02909 (python)

Fixed submission:
w = input()

if w=='Sunny':
    print('Cloudy')
elif w=='Rainy':
    print('Sunny')
elif w=='Cloudy':
    print('Rainy')

Buggy submission (verdict: Runtime Error):
str_list = input().split(' ')
int_list = [int(x) for x in str_list]
N, K, Q = int_list[0], int_list[1], int_list[2]
A = []
for _ in range(Q):
    A.append( int(input()) )
point = [int(K)]*N
import numpy as np
point = np.array(point)
for ii in range(Q):
    point[A[ii]-1] += 1
point -= Q
for ii in range(N):
    if point[ii] <= 0:
        print('No')
    else:
        print('Yes')
Problem p02640 (python)

Fixed submission:
import os

def main():
  args = list(map(int, input().split()))
  nb = args[0]
  nl = args[1]
  if nb == 0 or (nl % 2 == 1) or nl == 0 or nb > nl or (nl / 4.0) > nb:
    print('No')
    return
  for i in range(nb + 1):
    if ((nb - i) * 4 + i * 2) == nl:
      print('Yes')
      return
  print('No')

if __name__ == '__main__':
  main()

Buggy submission (verdict: Runtime Error):
import os

def main():
  args = list(map(int, input().split()))
  nb = args[0]
  nl = args[1]
  if nb == 0 or (nl % 2 == 1):
    print('No')
    return
  if (nl / 4.0) > nb:
    print('No')
    return
  if (nl % ((nb - 1) * 2)) % 2 == 0:
    print('Yes')
  else:
    print('No')

if __name__ == '__main__':
  main()
Problem p02645 (python)

Fixed submission:
import sys

args = input()
print(args[:3])

Buggy submission (verdict: Runtime Error):
import argparse

parser = argparse.ArgumentParser()
parser.add_argument("name")
arg = parser.parse_args()
print(arg.name[:3])

Buggy submission (verdict: Runtime Error):
import argparse

parser = argparse.ArgumentParser()
parser.add_argument("name")
arg = parser.parse_args()
print(arg.name[:3])

Buggy submission (verdict: Runtime Error):
import argparse

parser = argparse.ArgumentParser()
parser.add_argument("name")
arg = parser.parse_args()
print(arg[:3])
Problem p02730 (python)

Fixed submission:
S = list(input())
S_rev = list(reversed(S))
N = len(S)
if S != S_rev:
  print('No')
else:
  S1 = S[:int((N-1)/2)]
  S2 = S[int((N+1)/2):]
  S1_rev = list(reversed(S1))
  S2_rev = list(reversed(S2))
  if S1==S1_rev and S2 == S2_rev:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
S = input().split()
S_rev = list(reversed(S))
N = len(S)

if S != S_rev:
  print('No')
else:
  S1 = S[:(N-3)/2]
  S2 = S[(N-3)/2:]
  S1_rev = list(reversed(S1_rev))
  S2_rev = list(reversed(S2_rev))
  
  if S1==S1_rev and S2 == S2_rev:
    print('Yes')
  else:
    print('No')
Problem p02732 (python)

Fixed submission:
from collections import Counter
from scipy.misc import comb

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

num = 0
for v in c.values():
  if v > 1:
      num += comb(v, 2,exact=True)
for k in range(N):
  print(int(num - (c[A[k]]-1)))

Buggy submission (verdict: Runtime Error):
from collections import Counter

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

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


def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

for k in range(N):
  sum_k = 0
  temp_c = c.copy()
  temp_c[A[k]] -= 1
  for v in temp_c.values():
    if v > 1:
      sum_k += cmb(v,2)
  print(int(sum_k))

Buggy submission (verdict: Runtime Error):
from collections import Counter
from math import factorial

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

for k in range(N):
  sum_k = 0
  temp_c = c.copy()
  temp_c[A[k]] -= 1
  for v in temp_c.values():
    if v > 1:
      sum_k += factorial(v) / 2 / factorial(v - 2)
  print(int(sum_k))

Buggy submission (verdict: Runtime Error):
from collections import Counter
from math import factorial

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

for k in range(N):
  sum_k = 0
  temp_c = c.copy()
  temp_c[A[k]] -= 1
  for v in temp_c.values():
    if v > 1:
      sum_k += factorial(v) / 2 / factorial(v - 2)
  print(int(sum_k))
Problem p02744 (python)

Fixed submission:
from collections import Counter

N = int(input())
alpha = [chr(i) for i in range(97, 97+26)]
temp = ['a']
result = ['a']
if N >= 2:
  for n in range(2,N+1):
    result = []
    for i in temp:
      temp_list = list(i)
      type = len(Counter(temp_list))
      for j in range(type+1):
        a = i + alpha[j]
        result.append(a)
    temp = result.copy()
print('\n'.join(result))

Buggy submission (verdict: Runtime Error):
from collections import Counter

N = int(input())
alpha = [chr(i) for i in range(97, 97+26)]

temp = []
for n in range(N):
  result = []
	for i in temp:
    	temp_list = list(i)
  		type = len(Counter(temp_list))
  
  			for j in range(type):
    			result.append(i + alpha[j])
	temp = result.copy()
    
print('\n'.join(result))
Problem p02747 (python)

Fixed submission:
import re

S = input() 

if re.match(r'^(hi)+$',S):
  print('Yes')

else:
  print('No')

Buggy submission (verdict: Runtime Error):
import re
 
if re.match(r'^(hi)+$',S):
  print('Yes')

else:
  print('No')

Buggy submission (verdict: Runtime Error):
import re

if re.match(r'^(hi)+$'):
  print('Yes')

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

Fixed submission:
import sys
N = int(input())
A = list(map(int, input().split()))

money = 1000
kabu = 0 

for i in range(N-1):
  if A [i] < A[i + 1] and kabu == 0 :
    kabu = money // A[i]
    money = money - kabu*A[i]
  elif A[i] > A[i + 1] and kabu > 0:
    money = money + kabu*A[i]
    kabu = 0
    
if kabu > 0 :
  print(money + kabu*A[N-1])
else :
  print(money)

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
A = list(map(int, input().split()))

money = 1000
urine = 0
kabu = 0 
n = 0
mode = ""

if N == 2 and A[0] == A[1] :
  print("1000")
  sys.exit()

if A[0] < A[1] :
  mode = "up"
  urine = A[0]
  kabu = money // urine
  money = money - kabu*urine
elif A[0] > A[1] :
  mode = "down"
else :
  while A[n] == A[n + 1]:
    if n + 2 > N :
      print("1000")
      sys.exit()
      
    if A[n + 1] < A[n + 2]:
      mode = "up"
      urine = A[n + 1]
      kabu = money // urine
      money = money - kabu*urine
      break
    elif A[n + 1] > A[n + 2]:
      mode ="down"
      break
    
    n += 1  

for i in range(N-1):
  if mode == "up" :
    if A[i] <= A[i + 1] :
      next
    elif A[i] > A[i +1] :
      mode = "down"
      money = money + kabu*A[i]

  elif mode == "down":
    if A[i] >= A[i + 1] :
      next
    elif A[i] < A[i +1] :
      mode = "up"
      urine = A[i]
      kabu = money // urine
      money = money - kabu * urine
      
if mode == "up" :
  print(money + A[N-1]*kabu)
else :
  print(money)
Problem p02690 (python)

Fixed submission:
import sys
N = int(input())

for A in range(-118, 120) :
  for B in range(-119, 119) :
    if A ** 5 - B ** 5 == N :
      print(A, B)
      sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
num = []
nn = -1

while nn ** 5 < N :
  nn += 1
  A = nn ** 5 - N
  if A in num:
    print(nn, index(A))
    exit()
  num.append(nn ** 5) 
  
An = -1
Bn = -1
A = 0
B = 0
while True :
  An += 1
  Bn = An
  A = 0
  B = 0
  while A + B < N :
    Bn += 1
    A = An ** 5
    B = Bn ** 5
    if A + B == N:
      print(An, Bn * -1)
      sys.exit()
Problem p02761 (python)

Fixed submission:
import sys
N, M = map(int, input().split())

num = []
for i in range(N) :
  num.append([0])

sc = []
for i in range(M) :
  sc.append(list(map(int, input().split()))) 

ans = ""

for n in sc :
  if n[1] not in num[n[0]-1] :
    num[n[0]-1].append(n[1])

if N >= 2 and [1, 0] in sc :
  print('-1')
  sys.exit()
elif N == 1 and num[0] == [0] :
  print('0')
  sys.exit()  
elif N >= 2 and num[0] == [0] :
  num[0].append(1)

for m in num :
  if len(m) >= 3 :
    print('-1')
    sys.exit()

if len(num[0]) == 1 :
  print('-1')
  sys.exit()
else :
  for l in range(N) :
    ans = ans + str(max(num[l]))

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
N, M = map(int, input().split())

num = []
for i in range(N) :
  num.append([0])

sc = []
for i in range(M) :
  sc.append(list(map(int, input().split()))) 

ans = ""

for n in sc :
  if n[1] not in num[n[0]-1] :
    num[n[0]-1].append(n[1])

if N >= and [1, 0] in sc :
  print('-1')
  sys.exit()
elif N >= 2 and num[0] == [0] :
  num[0].append(1)

for m in num :
  if len(m) >= 3 :
    print('-1')
    sys.exit()

if len(num[0]) == 1 :
  print('-1')
  sys.exit()
else :
  for l in range(N) :
    ans = ans + str(max(num[l]))

print(ans)
Problem p03001 (python)

Fixed submission:
W, H, x, y = map(int, input().split())

S = W * H / 2

if x == W / 2 :
  if y == H / 2 :
    n = 1
  else : 
    n = 0
else :
  n = 0
  
ans = str(S) + " " + str(n)
print(ans)

Buggy submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())

print(W * H / 2, end="")
print("" end="")

if x == W / 2 :
  if y == H / 2 :
    ans = 1
  else : 
    ans = 0
else :
  ans = 0
  
print(ans)
Problem p03059 (python)

Fixed submission:
str = input().split()
A = int(str[0])
B = int(str[1])
T = int(str[2])

time = T + 0.5
biscuits = (time //   A) * B

print(int(biscuits))

Buggy submission (verdict: Runtime Error):
time = T + 0.5
bisckets = (time //   A) * B

print(bisckets)
Problem p02818 (python)

Fixed submission:
import sys

a,b,k = map(int,input().split())
a1 = k-a
if a1 >=1:
  a2=b-a1
  if a2 <=0:
    a2 = 0
  a1=0
else:
  a1=a-k
  a2=b
print(a1,a2)

Buggy submission (verdict: Runtime Error):
import sys

a,b,k = map(int,input().split())
a1 = k-a
if a1 >=1:
  a2=b-a1
  if a2 <=0:
    a2 = 0
  a1=0
else:
  a1=a-k
  a2=b
print(f'{a1} {a2}')

Buggy submission (verdict: Runtime Error):
import sys

a,b,k = map(int,input().split())
a1 = k-a
if a1 >=1:
  a2=b-a1
  a1=0
else:
  a1=a-k
  a2=b
print(f'{a1} {a2}')
Problem p02843 (python)

Fixed submission:
import sys
x = input()
x1 = list(x)
h = len(x)
x = int(x)

if x>2000:
  print('1')
  sys.exit()

a1 = int(x1[h-1])
a2 = int(x1[h-2])

if 0 < a1 <= 5:
  c1 = 1
elif a1 == 0:
  c1 = 0
else:
  c1 = 2

c2 = a2*2
#print(x1[0],x1[1])
if h>3:
  if 10*int(x1[0])+int(x1[1]) < c1+c2:
    print('0')
  else:
    print('1')
else:
  if int(x1[0]) < c1+c2:
    print('0')
  else:
    print('1')

Buggy submission (verdict: Runtime Error):
import sys
x = input()
x1 = list(x)
h = len(x)
x = int(x)

if x>2000:
  print('1')
  sys.exit()

a1 = int(x1[h-1])
a2 = int(x1[h-2])

if 0 < a1 < 5:
  c1 = 1
elif a1 == 0:
  c1 = 0
else:
  c1 = 2

c2 = a2*2
if int(x1[0])+int(x1[1]) < c1+c2:
  print('0')
else:
  print('1')

Buggy submission (verdict: Runtime Error):
import sys
x = input()
x1 = list(x)
h = len(x)
x = int(x)

if x>2000:
  print('1')
  sys.exit()

a1 = int(x1[h-1])
a2 = int(x1[h-2])

if 1<=a1<=5:
  c1 = 1
elif:
  c1 = 0
else:
  c1 = 2

c2 = a2*2
if int(x1[0])+int(x1[1]) < c1+c2:
  print('0')
else:
  print('1')

Buggy submission (verdict: Runtime Error):
import sys
x = input()
x1 = list(x)
h = len(x)
x = int(x)

if x>2000:
  print('1')
  sys.exit()

a1 = int(x1[h-1])
a2 = int(x1[h-2])

if a1<=5:
  c1 = 1
else:
  c1 = 2

c2 = a2*2
if int(x1[0])+int(x1[1]) < c1+c2:
  print('0')
else:
  print('1')
Problem p02981 (python)

Fixed submission:
a,b,c=map(int,input().split())
m = a*b
n = c
if m<=n:
  print(m)
  
else:
  print(n)

Buggy submission (verdict: Runtime Error):
import math
import itertools

a,b=map(int,input().split())
X = [[int(i) for i in input().split()] for i in range(a)] 
#for i in range():
c = list(itertools.combinations(X, 2))


ans = 0

for i in range(len(c)):
  d = 0
  for j in range(b):
    d += (c[i][0][j]-c[i][1][j])**2
    if j == b-1:
      d = math.sqrt(d)
      if d.is_integer():
        ans = ans+1

print(ans)
Problem p02982 (python)

Fixed submission:
import math
import itertools

a,b=map(int,input().split())
X = [[int(i) for i in input().split()] for i in range(a)] 
#for i in range():
c = list(itertools.combinations(X, 2))


ans = 0

for i in range(len(c)):
  d = 0
  for j in range(b):
    d += (c[i][0][j]-c[i][1][j])**2
    if j == b-1:
      d = math.sqrt(d)
      if d.is_integer():
        ans = ans+1

print(ans)

Buggy submission (verdict: Runtime Error):
import math
import itertools

a,b=map(int,input().split())
X = [[int(i) for i in input().split()] for i in range(a)] 
#for i in range():
c = list(itertools.combinations(X, 2))


def get_distance(x1, y1, x2, y2):
    d = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
    return d

ans = 0
for i in range(len(c)):
  C_x1 = c[i][0][0]
  C_x2 = c[i][1][0]
  C_y1 = c[i][0][1]
  C_y2 = c[i][1][1]
  d = get_distance(C_x1,C_y1,C_x2,C_y2)
  if d.is_integer():
    ans = ans+1

print(ans)

Buggy submission (verdict: Runtime Error):
import math
import itertools

a,b=map(int,input().split())
X = [[int(i) for i in input().split()] for i in range(a)] 
#for i in range():
c = list(itertools.combinations(X, 2))


def get_distance(x1, y1, x2, y2):
    d = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
    return d

ans = 0
for i in range(len(c)):
  C_x1 = c[i][0][0]
  C_x2 = c[i][1][0]
  C_y1 = c[i][0][1]
  C_y2 = c[i][1][1]
  d = get_distance(C_x1,C_y1,C_x2,C_y2)
  if type(d):
    ans = ans+1

print(ans)
Problem p03145 (python)

Fixed submission:
a = [int(i) for i in input().split()]
menseki = int(a[0]*a[1]/2)
print(menseki)

Buggy submission (verdict: Runtime Error):
a = [[int(i) for i in input().split()] for i in range(N)]
menseki = a[0]*a[1]/2
print(menseki)