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

Fixed submission:
import math

n=int(input())
m=int(math.sqrt(n))
for i in reversed(range(1,m+1)):
	if n%i==0:
		print(int(i+n/i-2))
		break

Buggy submission (verdict: Runtime Error):
import math

n=int(input())
m=int(math.sqrt(n))
for i in reverse(range(1,m+1)):
	if n%i==0:
		print(int(i+n/i-2))
		break
Problem p02951 (python)

Fixed submission:
[a,b,c]=list(map(int, input().split()))
nokori=c-a+b
if nokori<0:
	nokori=0
print(nokori)

Buggy submission (verdict: Runtime Error):
n=int(input())
hlist=input().split()
hlist=list(map(int, hlist))
counter=0
counter2=0
counter3=0
hantei=0
for i in range(n-1): #そもそも単調増加
	if hlist[i]<=hlist[i+1]:
		counter=counter+1
		
for i in range(n): #全部一緒にできる
	if hlist[i]==hlist[0] or hlist[0]+1:
		#counter2=counter2+1

for i in range(n): #全部一緒にできる
	if hlist[i]==hlist[0] or hlist[0]-1:
		counter3=counter3+1


		
if counter==n-1 or counter2==n or counter3==n:
	hantei=1
	
if hantei==1:
	print("Yes")
else:print("No")
Problem p03835 (python)

Fixed submission:
[k,s]=list(map(int,input().split()))
counter=0
imax=min(s+1,k+1)
for i in range(imax):
	jmax=min(s-i+1,k+1)
	for j in range(0,jmax):
		if i<=k and j<=k and s-i-j<=k:
			counter+=1
print(counter)

Buggy submission (verdict: Runtime Error):
[k,s]=list(map(int,input().split()))
counter=0
imax=min(s+1,k+1)
jmax=min(s-i+1,k+1)
for i in range(imax):
	for j in range(0,jmax):
		if i<=k and j<=k and s-i-j<=k:
			counter+=1
print(counter)
Problem p02623 (python)

Fixed submission:
import itertools
import numpy as np 
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# -------------------
n, m, k = map(int, readline().split())
#print(n)
a = list(map(int, readline().split()))
b = list(map(int, readline().split()))
a = [0] + a
b = [0] + b
acc = list(itertools.accumulate(a))
bcc = list(itertools.accumulate(b))

#acc = np.array(acc)
#print(acc)
#bcc = np.array(bcc)

ans = 0
j = m
for i, val in enumerate(acc):
  if (val > k):
    break
  else:
    rest = k - val
    #print(rest)
    #j = m
    #一ループ目がJの最大になるので、外側に置いてOK
    while (bcc[j] > rest):
      j -= 1

    ans = max(ans, j + i)


print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
import numpy as np 
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
acc = list(itertools.accumulate(a))
bcc = list(itertools.accumulate(b))

acc = np.array(acc)
#print(acc)
bcc = np.array(bcc)

checkA = np.where(acc <= k)
chA = checkA[0]
checkB = np.where(bcc <= k)
chB = checkB[0]

if (len(chA) > len(chB)):
  a1 = chA
  b1 = chB
else:
  a1 = chB
  b1 = chA

if (len(a1) == 0):
  print(0)
  exit()

ans = 0

for i in range(len(a1) -1, -1, -1):
  #print(i, acc[a1[i]])
  rest = k - acc[a1[i]]
  tar = np.where(bcc <= rest)
  if (len(tar[0]) == 0):
    num = 0
  else:
    num = tar[0][-1]

  #print('num', num)
  ans = max(num + i + 2, ans)
    

print(ans)
Problem p02659 (python)

Fixed submission:
#import math
from decimal import *
# 小数を制御

a, b = map(str, input().split())
a = int(a)
b = Decimal(b)
#ans = math.floor(a * b)
ans = a * b
ans1 = int(ans)
print(ans1)

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
ans = math.floor(a * b)
print(ans)
Problem p02699 (python)

Fixed submission:
A, B = map(int, input().split())

if (A > B):
    print('safe')
else:
    print('unsafe')

Buggy submission (verdict: Runtime Error):
A, B = map(int.input().split())

if (A > B):
    print('safe')
else:
    print('unsafe')
Problem p02771 (python)

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

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if (a==b) and (b!=c):
  print('Yes")
elif (b==c) and (c!=a):
  print('Yes")
elif (a==c) and (c!=b):
  print('Yes")
else:
  print('No')
Problem p02912 (python)

Fixed submission:
#import numpy as np
#import math
import heapq

n, m = map(int, input().split())
#a = list(map(int, input().split()))
a = list(map(lambda x: int(x) * (-1), input().split()))
heapq.heapify(a)  # aを優先度付きキューに

for _ in range(m):
    MAX = heapq.heappop(a)  # −１かけたリストのMin　＞Max
    heapq.heappush(a, (-1) * (-MAX // 2))

ans = (sum(a)) * (-1)  # そのままリストでOK
print(ans)

Buggy submission (verdict: Runtime Error):
#import numpy as np
#import math
import heapq

n, m = map(int, input().split())
#a = list(map(int, input().split()))
a = list(map(lambda x: int(x) * (-1), input().split()))
heapq.heapify(a)  # aを優先度付きキューに

for _ in range(m):
    MAX = heapq.heappop(a)  # −１かけたリストのMin　＞Max
    heapq.heappush(a, (-1) * (-MAX // 2))
    print(a)

ans = (sum(a)) * (-1)  # そのままリストでOK
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
n, m = map(int, input().split())
#a = list(map(int, input().split()))
a = list(map(lambda x: int(x) * (-1), input().split()))
heapq.heapify(a)  # aを優先度付きキューに

for _ in range(m):
    MAX = heapq.heappop(a)  # −１かけたリストのMin　＞Max
    heapq.heappush(a, (-1) * (-MAX // 2))

ans = (sum(a)) * (-1)  # そのままリストでOK
print(ans)
Problem p02959 (python)

Fixed submission:
N = int(input())
mons = list(map(int, input().split()))
yush = list(map(int, input().split()))

temp = sum(mons)

for i, yu in enumerate(yush):
    mo = mons[i]
    if (yu >= mo):
        mons[i] = 0
        yush[i] = yu - mo
        
        if (mons[i + 1] > yush[i]):
            mons[i + 1] -= yush[i]
        else:
            mons[i + 1] = 0
        
    else:
        mons[i] = mo - yu
ans = temp - sum(mons)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
mons = list(map(int, input().split()))
yush = list(map(int, input().split()))

temp = sum(mons)

for i, yu in enumerate(yush):
    mo = mons[i]
    if (yu >= mo):
        mons[i] = 0
        yush[i] = yu - mo
        
        if (mons[i + 1] > yush[i]):
            mons[i + 1] -= yush[i]
        else:
            monx[i + 1] = 0
        
    else:
        mons[i] = mo - yu
        yush[i] = 0
ans = temp - sum(mons)
print(ans)
Problem p02989 (python)

Fixed submission:
n = int(input())
d = list(map(int, input().split()))
d = sorted(d)
tar = int(n/2) - 1


left = d[tar]
right = d[tar + 1]
#print(left, right)
diff = right - left
if (diff == 0):
    ans = 0
else:
    ans = diff

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = list(map(int, input().split()))
d = sorted(d)
tar = int(n/2) - 1


left = d[tar]
right = d[tar + 1]
p#rint(left, right)
diff = right - left
if (diff == 0):
    ans = 0
else:
    ans = diff

print(ans)
Problem p03013 (python)

Fixed submission:
n, m = map(int, input().split())
a = set([int(input()) for _ in range(m)])
'''
a = [0] * (10 ** 5)
for i in range(m):
    a[int(input())] = 1
'''

MOD = 10 ** 9 + 7
# ---------------------------
dp = [0] * (n + 1)
dp[0] = 1
if (1 in a):
    # if (a[1] == 1):
    dp[1] = 0
else:
    dp[1] = 1
# dp approach

for i in range(2, n + 1):
    if (i in a):
        # if (a[i] == 1):
        # (x in list)で探索すると、時間がかかるっぽい
        #dp[i] = 0
        continue
    elif (dp[i - 1] == 0 and dp[i - 2] == 0):
        print(0)
        exit()
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD


#print(dp[n] % MOD)
print(dp[n])

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
#a = [int(input()) for _ in range(m)]
a = [0] * (10 ** 5)
for i in range(m):
    a[int(input())] = 1


MOD = 10 ** 9 + 7
# ---------------------------
dp = [0] * (n + 1)
dp[0] = 1
# if (1 in a):
if (a[1] == 1):
    dp[1] = 0
else:
    dp[1] = 1
# dp approach

for i in range(2, n + 1):
    # if (i in a):
    if (a[i] == 1):
        # (x in list)で探索すると、時間がかかるっぽい
        #dp[i] = 0
        continue
    elif (dp[i - 1] == 0 and dp[i - 2] == 0):
        print(0)
        exit()
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD


#print(dp[n] % MOD)
print(dp[n])

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [0] * m
MOD = 10 ** 9 + 7

for i in range(m):
    a[i] = int(input())

dp = [0] * (n + 1)

for i in range(1, 3):
    if (i not in a):
        dp[i] = dp[i-1] + 1
    else:
        pass

flag = True

for i in range(3, n + 1):
    if (i not in a):
        if (dp[i - 1] == 0 and dp[i - 2] == 0):
            flag = False
            break
        else:
            dp[i] = dp[i - 1] + dp[i - 2]

    else:
        pass


if (flag is True):
    ans = dp[n] % MOD
else:
    ans = 0


#ans %= 10 ** 9 + 7
print(ans)
Problem p03137 (python)

Fixed submission:
n, m = map(int, input().split())
x = list(map(int, input().split()))

xSort = sorted(x)

dif = [0] * (m - 1)
for i in range(m - 1):
    dif[i] = xSort[i + 1] - xSort[i]
ans = sum(dif)

if (n == 1 or m == 1):
    print(ans)

elif (n >= m):
    print('0')
else:
    tar = len(dif) - n + 1
    difSort = sorted(dif)
    difS_2 = difSort[:tar]
    ans = sum(difS_2)
    print(ans)
'''  
    for j in range(n - 1):
        tar = j + 1
        tarInd = tar * -1
        tarVal = sorted(dif)[tarInd]
        ans -= tarVal
'''
# print(ans)
# >>>TLE
#
# n番目の要素を取得
# sorted(list)[-1] > 1番大きい
# sorted(list)[-２] > 2番大きい
'''
  import numpy as np
  difArray = np.array(dif)
  difIndex = difArray.argsort()

  for i in range(n - 1):
    tar = m - i
    maxIndex = difIndex[tar]
    maxVal = diff
'''

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

xSort = sorted(x)

dif = [0] * (m - 1)
for i in range(m - 1):
    dif[i] = xSort[i + 1] - xSort[i]
ans = sum(dif)

if (n == 1):
    print(ans)
else:
    for j in range(n - 1):
        tar = j + 1
        tarInd = tar * -1
        tarVal = sorted(dif)[tarInd]
        ans -= tarVal

    print(ans)
# n番目の要素を取得
# sorted(list)[-1] > 1番大きい
# sorted(list)[-２] > 2番大きい
# or
# array.argsort()
# > array ([1,0,2,4,3]) みたいな
'''
  import numpy as np
  difArray = np.array(dif)
  difIndex = difArray.argsort()

  for i in range(n - 1):
    tar = m - i
    maxIndex = difIndex[tar]
    maxVal = diff
'''
Problem p03775 (python)

Fixed submission:
n = int(input())
# 約数は、常にペアになる。


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors


org = make_divisors(n)
div = sorted(org)

divNum = len(div)


if (divNum % 2 == 0):
    indA = int(divNum / 2) - 1
    indB = int(divNum / 2)
else:
    indA = int((divNum - 1) / 2)
    indB = indA

# print(div[indA])

A = len(str(div[indA]))
B = len(str(div[indB]))

ans = max(A, B)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
# 約数は、常にペアになる。


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors


org = make_divisors(n)
div = sorted(org)

divNum = len(div)


if (divNum % 2 == 0):
    indA = int(divNum / 2) - 1
    indB = int(divNum / 2)
else:
    indA = int((divNum - 1) / 2)
    indB = indA

# print(div[indA])

A = len(str(div[indA]))
B = len(str(div[indB]))

ans = max(A, B)
print(ans)a
Problem p03835 (python)

Fixed submission:
import itertools
k, s = map(int, input().split())

#data = [i for i in range(k + 1)]
# print(data)
#dd = itertools.product(data, repeat=3)
# print(dd)
#dd = list(dd)
#target = s / 3
ans = 0
if (k * 3 < s):

    pass
else:
    for x in range(0, k + 1):
        #temp = s - x
        # 2なら、（０、２）（１、１）（２、０）
        for y in range(0, k + 1):
            if (0 <= s - (x + y) <= k):
                ans += 1

print(ans)

'''
ans = 0
for i in dd:
    #print(sum(i))
    if (sum(i) == s):
        ans += 1

print(ans)
'''

Buggy submission (verdict: Runtime Error):
import itertools
k, s = map(int, input().split())

#data = [i for i in range(k + 1)]
# print(data)
#dd = itertools.product(data, repeat=3)
# print(dd)
#dd = list(dd)
target = s / 3
ans = 0
if (target < k):
    pass
elif:
    for x in range(0, k + 1):
        #temp = s - x
        # 2なら、（０、２）（１、１）（２、０）
        for y in range(0, k + 1):
            if (0 <= s - (x + y) <= k):
                ans += 1


print(ans)

'''
ans = 0
for i in dd:
    #print(sum(i))
    if (sum(i) == s):
        ans += 1

print(ans)
'''
Problem p02580 (python)

Fixed submission:
#!/usr/bin/env python3

# from typing import Optional
from typing import List

# from typing import Dict
from typing import Tuple
from typing import Set

# from typing import Sequence

Cod = Tuple[int, int]


def main():
    args = input().split()
    H = int(args[0])
    W = int(args[1])
    M = int(args[2])

    codList = {}
    columnSumList: List[int] = [0] * W
    rowSumList: List[int] = [0] * H
    for i in range(M):
        h, w = map(lambda x: int(x), input().split())
        item = (h, w)
        codList.setdefault(h, {})
        codList[h][w] = item
        columnSumList[w - 1] += 1
        rowSumList[h - 1] += 1

    maxColumnSum = max(columnSumList)
    maxColumIndexList = [i for i, x in enumerate(columnSumList) if x == maxColumnSum]
    maxRowSum = max(rowSumList)
    maxRowIndexList = [i for i, x in enumerate(rowSumList) if x == maxRowSum]

    result = maxColumnSum + maxRowSum
    for row in maxRowIndexList:
        for column in maxColumIndexList:
            if row + 1 in codList and column + 1 in codList[row + 1]:
                continue
            else:
                print(result)
                return

    print(result - 1)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

# from typing import Optional
from typing import List

# from typing import Dict
from typing import Tuple

# from typing import Sequence

Cod = Tuple[int, int]


def main():
    args = input().split()
    H = int(args[0])
    W = int(args[1])
    M = int(args[2])

    codList: List[Cod] = []
    for i in range(M):
        args = input().split()
        codList.append((int(args[0]), int(args[1])))

    columnSumList: List[int] = [0] * (H + 1)
    rowSumList: List[int] = [0] * (W + 1)

    for item in codList:
        columnSumList[item[1] - 1] += 1
        rowSumList[item[0] - 1] += 1

    maxColumnSum = max(columnSumList)
    maxColumIndexList = [i for i, x in enumerate(columnSumList) if x == maxColumnSum]
    maxRowSum = max(rowSumList)
    maxRowIndexList = [i for i, x in enumerate(rowSumList) if x == maxRowSum]

    result = maxColumnSum + maxRowSum
    for row in maxRowIndexList:
        for column in maxColumIndexList:
            if (row + 1, column + 1) in codList:
                continue
            else:
                print(result)
                return

    print(result - 1)


if __name__ == "__main__":
    main()
Problem p02577 (python)

Fixed submission:
x=int(input())
  
if x%9==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
def fun(x):
  sum=0
  while(x):
    sum=sum+ x%10
    x=x/10
  return sum
n=int(input())
x=n;
while(x>=10):
  x=fun(x)
  
if x%9==0:
  print("Yes")
else:
  print("No")
Problem p02754 (python)

Fixed submission:
N, A, B = map(int, input().split())
q = N // (A + B)
r = N % (A + B)

if 0 <= r <= A:
  blue = q * A + r
else:
  blue = q * A + A
  
print(blue)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
q = N // (A + B)
r = N % (A + B)

if 0 <= r <= A:
  blue = q * A + r
else:
  blue = a * A + A
  
print(blue)
Problem p02771 (python)

Fixed submission:
a,b,c = map(int,input().split())
P = set([a,b,c])
if len(P) == 2:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split)
P = set([a,b,c])
if len(P) == 2:
  print('Yes')
else:
  print('No')
Problem p03036 (python)

Fixed submission:
r, D, x = map(int, input().split())
for i in range(10):
  x = r * x - D
  print(x)

Buggy submission (verdict: Runtime Error):
r D x = map(int, input.split())
for i in range(10):
  x = r * x - D
  print(x)
Problem p03038 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))
B = []
for i in range(M):
  b = list(map(int, input().split()))
  B.append(b)
  
B.sort(reverse = True, key = lambda x : x[1])
A.sort()
count = 0

for x in B:
  i = x[0] - 1
  c = x[1]
  if count + i >= N:
    if A[-1] > c:
      for j in range(count,N):
        if A[j] < c:
          A[j] = c
      break
    else:
      A[count:] = [c] * (N - count)
      break
    
  elif A[count + i] > c:
    for j in range(i):
      if A[count + j] < c:
        A[count + j] = c
    break
  else:
    A[count:count + i + 1] = [c] * (i + 1)
    count += i + 1

print(sum(A))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
B = []
for i in range(M):
  b = list(map(int, input().split()))
  B.append(b)
  
B.sort(reverse = True, key = lambda x : x[1])
A.sort()
count = 0

for x in B:
  i = x[0] - 1
  c = x[1]
  if A[count + i] > c:
    for j in range(i):
      if A[count + j] < c:
        A[count + j] = c
    break
  else:
    A[count:count + i + 1] = [c] * (i + 1)
    count += i + 1

print(sum(A))
Problem p03073 (python)

Fixed submission:
s = [int(x) for x in list(input())]
a = [x%2 for x in range(len(s))]
b = [(1 - x%2) for x in range(len(s))]
c1=0
c2=0
for i in range(len(s)):
    if a[i] != s[i]:
        c1 += 1
    if b[i] != s[i]:
        c2 += 1

print(min([c1,c2]))

Buggy submission (verdict: Runtime Error):
s = [int(x) for x in list(input())]
a = [x%2 for x in range(len(s))]
b = [(1 - x%2) for x in range(len(s))]
c1=0
c2=0
for i in range(len(s)):
    if a[i] != s[i]:
        c1 += 1
    if b[i] != s[i]:
        c2 += 1

p
Problem p02572 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
mod = 1000000007
res = 0
a_sum = sum(a)

for i in range(n - 1):
    main = a[i]
    a_sum = a_sum - main
    res =  (res + main * a_sum % mod) % mod
print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = set(list(map(int, input().split())))
mod = 1000000007
res = 0


for i in range(n - 1):
    main = a.pop(0)
    res =  (res + main * sum(a) % mod) % mod
print(res)
Problem p02781 (python)

Fixed submission:
from functools import lru_cache
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, K = map(int,read().split())

@lru_cache(None)
def F(N, K):
    if N < 10:
        if K == 0:
            return 1
        if K == 1:
            return N
        return 0
    q, r = divmod(N, 10)
    ret = 0
    if K >= 1:
        ret += F(q, K-1) * r
        ret += F(q-1, K-1) * (9-r)
    ret += F(q, K)
    return ret

print(F(N, K))

Buggy submission (verdict: Runtime Error):
N = input()
K = int(input())

def F(N, K):
    if N < 10:
        if K == 0:
            return 1
        if K == 1:
            return N
        return 0
    q, r = divmod(N, 10)
    ret = 0
    if K >= 1:
        ret += F(q, K-1) * r
        ret += F(q-1, K-1) * (9-r)
    ret += F(q, K)
    return ret

print(F(N, K))
Problem p02570 (python)

Fixed submission:
d,t,s = map(int,input().split())

if t*s >= d:
    print("Yes")

else:
    print("No")

Buggy submission (verdict: Runtime Error):
d,t,s = map(int,input().split())

if t*s >= D:
    prrint("Yes")

else:
    print("No")
Problem p02570 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if b*c>=d:
  print("Yes")
else:
  print("No")
Problem p02595 (python)

Fixed submission:
import math as m
n,d=map(int,input().split())
cnt = 0
for _ in range(n):
    x,y = map(int,input().split())
    if(m.sqrt((x**2) + (y**2))<=d):
        cnt +=1 
print(cnt)

Buggy submission (verdict: Runtime Error):

n,d=map(int,input().split())
cnt = 0
for _ in range(n):
    x,y = map(int,input().split())
    if(sqrt((x**2) + (y**2))<=d):
        cnt +=1 
print(cnt)
Problem p02753 (python)

Fixed submission:
code = input()
if (len(set(list(code))) != 1):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a, b = [int(c) for c in input().split(" ")]
S = input()
count = 0
for i in range(1, a):
  for j in range(0, a):
      if (j+i <= a+1):
          subStr = S[j:j+i]
          if (len(subStr) == i):
            if (int(subStr) % b == 0):
                count+=1
if (int(S) % b == 0):
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
from math import ceil, floor
 
a, b = [int(c) for c in input().split(" ")]
A = ceil(a / 0.08)
B = ceil(b/ 0.1)
 
if (A < B):
  if (floor(B * 0.08) == a):
    print(B)
  else:
    print(-1)
elif (B < A):
  if (floor(A*0.1) == b):
    print(A)
  else:
    print(-1)
else:
  print(-1);

Buggy submission (verdict: Runtime Error):
from math import ceil, floor

a, b = [int(c) for c in input()]
A = ceil(a / 0.08)
B = ceil(b/ 0.1)
 
if (A < B):
  if (floor(B * 0.08) == a):
    print(B)
  else:
    print(-1)
elif (B < A):
  if (floor(A*0.1) == b):
    print(A)
  else:
    print(-1)
else:
  print(-1);

Buggy submission (verdict: Runtime Error):
code = input()
return len(set(list(code))) != 1;
Problem p02676 (python)

Fixed submission:
k=int(input())
s=input()
if int(len(s))<=k:
  print(s)
else:
  print(s[0:k]+'...')

Buggy submission (verdict: Runtime Error):
k=int(input())
s=input()
if len(s)<=k
    print('s')
else:
  print('s[:k+1]'+'...')
Problem p02693 (python)

Fixed submission:
ｋ = int(input())
a,b = map(int,input().split())
n=0
while True:
    n+=k
    if n>=a and n<=b:
        print('OK')
        break
    if n>b:
        print('NG')
        break

Buggy submission (verdict: Runtime Error):
ｋ = int(input())
a,b = map(int,input().split())
n=0
while True:
    n+=k
    if n>=a and n=<b:
        print('OK')
        break
    if n>b:
        print('NG')
Problem p02711 (python)

Fixed submission:
N=input()
if N[0]!='7' and N[1]!='7' and N[2]!='7':
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
N=int(input())
if N[0]!=7 and N[1]!=7 and N[2]!=7:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
N=int(input())
if '7'in N:
    print('Yes')
else:
    print('No')
Problem p02723 (python)

Fixed submission:
S=input()
if S[2]==S[3] and S[4]==S[5]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
S=input()
if S[2]==s[3] and S[4]==s[5]:
    print('Yes')
else:
    print('No')
Problem p02729 (python)

Fixed submission:
n,m=map(int,input().split())
if n==0: 
    print(int(m*(m-1)/2))
elif m==0:
    print(int(n*(n-1)/2))
else:
    print(int(n*(n-1)/2+m*(m-1)/2))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
if n==0: 
    print(int(n*(n-1)/2))
elif m==0:
    print(iint(m*(m-1)/2))
else:
    print(int(n*(n-1)/2+m*(m-1)/2))
Problem p02759 (python)

Fixed submission:
import math
N=int(input())
a=N/2
print(math.ceil(a))

Buggy submission (verdict: Runtime Error):
import math
N=map(int,input().split())
a=N/2
print(math.ceil(a))

Buggy submission (verdict: Runtime Error):
import math
a=int,input()
print(math.ceil(a//2))

Buggy submission (verdict: Runtime Error):
import math
a=int,input()
print(math.ceil(a/2))