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

Fixed submission:
a, b, c, k =map(int, input().split())
if k <= a:
    print (k)
elif k > a:
    if k <= (a + b):
        print(a) 
    elif k > (a + b):
        print(a - (k - (a + b)))

Buggy submission (verdict: Runtime Error):
a, b, c, k =map(int, input().split())
if k <= a:
    print (a)
elif k > a:
    if k <= (a + b):
        print(a) 
    elif k > (a + b):
        print(a - (k - (a + b))

Buggy submission (verdict: Runtime Error):
a, b, c, k =map(int, input().split())
if k <= a:
    print a
elif k > a:
    if k <= (a + b):
        print a 
    elif k > (a + b):
        print a - (k - a)
Problem p02693 (python)

Fixed submission:
import numpy as np
s= int(input())
List = list(map(int, input().split()))
array = list()
for i in range(List[0],List[1]+1):
    if s == 1:
        array.append("OK")
        break
    if i % s == 0:
        array.append("OK")
        break
if ('OK' in array):
    print("OK")
else:
    print("NG")

Buggy submission (verdict: Runtime Error):
A, B = int(input())
s = int(input().split())
if s == 1:
    print("OK")
if s < A:
    print("NG")
if s > B:
    print("NG")
print("OK")
Problem p02699 (python)

Fixed submission:
sw = list(map(int, input().split()))
if sw[0] <= sw[1]:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
nm = list(map(int, input().split()))
if (nm[0] =< nm[1]):
    print("unsafe")
else print("safe")
Problem p02707 (python)

Fixed submission:
import numpy as np
n = int(input())
jousi = list(map(int, input().split()))
a = np.zeros(n)
for i in range(len(jousi)) :
    a[jousi[i] - 1] += 1
for i in range(len(a)):
    print(int(a[i]))

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
jousi = list(map(int, input().split()))
a = np.zeros(n)
for i in range(len(jousi)) :
    a[jousi[i] - 1] += 1
for i in range(len(a)):
print(int(a[i]))

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
jousi = list(map(int, input().split()))
a = np.zeros(n)
for i in range(len(jousi)) :
    a[jousi[i] - 1] += 1
    for i in range(len(a)):
    print(int(a[i]))

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
jousi = list(map(int, input().split()))
a = np.zeros(n)
for i in jousi :
    a[jousi[i] -1] += 1
for i in range(len(a)):
    print(int(a[i]))

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
jousi = list(map(int, input().split()))
a = np.zeros(n)
for i in jousi :
    a[jousi[i] -1] += 1
    print(int(a[jousi[i] - 1]))
Problem p03327 (python)

Fixed submission:
N = int(input())
if N > 999:
    print('ABD')
elif N <= 999:
    print('ABC')

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
X = b - a 
s = int((X*(X+1))/2 - b)
print(s)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
X = b - a 
s = int((X*(X+1))/2 - b)
print(s)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
X = b - a 
s = (X*(X+1))/2 - b
print(s)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
X = b - a 
s = (X*(X+1))/2 - b
print(s)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
X = b - a 
s = (X*(X + 1))/2 - b
print(s)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
X = b - a 
s = (X*(X + 1))/2 - b

Buggy submission (verdict: Runtime Error):
N = input()
if N > 999:
    print('ABD')
elif N <= 999:
    print('ABC')
Problem p02711 (python)

Fixed submission:
n = input()

if "7" in n:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = input()
  
if n[0]=="7" or n[1]=="7" or n[2]=="7":
	print(Yes)
else:
	print("No")
Problem p02753 (python)

Fixed submission:
s = input()

if s[0]==s[1]==s[2]:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
s = input()
s = split(s)
if s[0]==s[1]==s[2]:
  print("No")
else:
  print("Yes")
Problem p02790 (python)

Fixed submission:
li = input().split()

if li[0]>=li[1]:
  print(li[1] *int(li[0]))
else:
  print(li[0] *int(li[1]))

Buggy submission (verdict: Runtime Error):
li = input().split()

if li[0]>=li[1]:
  print(li[1]＊int(li[0]))
else:
  print(li[0]＊int(li[1]))

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

if a>=b:
  print(b＊int(a))
else:
  print(a＊int(b))

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

if a>=b:
  print(b1)
elif a<b:
  print(a1)
Problem p02792 (python)

Fixed submission:
n = int(input())

count = [[0]*10 for i in range(10)]

for i in range(1,n+1):
    first = int(str(i)[0])
    last = int(str(i)[-1])

    if first == 0 or last == 0:
        continue
    else:
        count[first][last] += 1

ans = 0
for first in range(1,10):
  for last in range(1,10):
    ans += count[first][last] * count[last][first]
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())

count = [0*[10] for i in range(10)]

for i in range(1,n+1):
    first = int(str(i)[0])
    last = int(str(i)[-1])

    if first == 0 or last == 0:
        continue
    else:
        count[first][last] += 1

ans = 0
for first in range(1,10):
    ans += count[first][last] * count[last][first]

print(ans)
Problem p02819 (python)

Fixed submission:
x = int(input())

import bisect

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

primess = primes(100010)
idx = bisect.bisect_left(primess,x)
print(primess[idx])

Buggy submission (verdict: Runtime Error):
x = int(input())

import bisect

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

primess = primes(x)
index = bisect.bisect_left(primess,x)
print(primess[index])

Buggy submission (verdict: Runtime Error):
x = int(input())

from bitarray import bitarray
import bisect

def index_to_number(i): return 2*i+3
def number_to_index(n): return (n-3)//2

LIMIT_NUMBER = 50
LIMIT_INDEX = number_to_index(LIMIT_NUMBER)+1

odd_primes = bitarray(LIMIT_INDEX)
# index  0 1 2 3
# number 3 5 7 9

odd_primes.setall(True)

for i in range(LIMIT_INDEX):
    if odd_primes[i] is False:
        continue
    n = index_to_number(i)
    for m in range(n**2, LIMIT_NUMBER, 2*n):
        odd_primes[number_to_index(m)] = False

primes = [index_to_number(i) for i in range(LIMIT_INDEX)
          if odd_primes[i] is True]
primes.insert(0,2)

index = bisect.bisect_left(primes,x)
print(primes[index])
Problem p02832 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
k = 1

for i in a:
    if k == i:
        k += 1

if k == 1:
    print(-1)
else:
    print(n-k+1)

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

i = 1
ind = 0
if 1 in a:
    while i in a[ind:]:
    ind = a.index(i)
    i += 1
    print(n-i+1)
else:
    print(-1)

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

i = 1
if 1 in a:
    while i in a:
    del a[:a.index(i)]
    i += 1
    print(n-i+1)
else:
    print(-1)
Problem p02847 (python)

Fixed submission:
s = input()
if s == "SUN":
    print(7)
elif s == "MON":
    print(6)
elif s == "TUE":
    print(5)
elif s == "WED":
    print(4)
elif s == "THU":
    print(3)
elif s == "FRI":
    print(2)
elif s == "SAT":
    print(1)

Buggy submission (verdict: Runtime Error):
s = input(S)
if s = "SUN":
    print("7")
elif s = "NON":
    print(6)
elif s = "TUE":
    print(5)
elif s = "WED":
    print(4)
elif s = "THU":
    print(3)
elif s = "FRI":
    print(2)
elif s = "SAT":
    print(1)
Problem p02881 (python)

Fixed submission:
n = int(input())
factor = []

for i in range(1,int(n**0.5)+1):
    if n%i == 0:
        factor.append(i + n//i)

factor.sort()
print(factor[0]-2)

Buggy submission (verdict: Runtime Error):
n = int(input())
factor = []

for i in range(1,int(n**1/2)):
    if n%i == 0:
        factor.append(i + n//i -2)
    else:
        continue

print(min(factor))
Problem p02897 (python)

Fixed submission:
n = int(input())
if n%2 ==0:
  print(0.5)
else:
  print((n+1)/(2*n))

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

ans = list(range(n))
for i in range(n):
    ans[a[i]-1] = i+1
print(" ".join(map(str,ans)))
Problem p02836 (python)

Fixed submission:
S = input() #ここで標準入力
rev = S[::-1]

l = int(len(S)/2)
front = S[0:l]
back = rev[0:l]

cnt = 0
moji = 0

for s in front:
    if front[cnt] == back[cnt]:
        moji += 1
    cnt += 1

ans = l - moji
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
rev = S[::-1]

l = int(len(S)/2)
front = S[0:l]
back = rev[0:l]

cnt = 0
moji = 0

for s in front:
    if front[cnt] == back[cnt]:
        moji += 1
    cnt += 1

ans = len - moji
print(ans)
Problem p02688 (python)

Fixed submission:
n, k = map(int, input().split())
ans = []
for _ in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    ans += a
print(n-len(set(ans)))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
ans = []
for _ in range(k):
    d = list(int(input()))
    a = list(map(int, input().split()))
    ans += a
print(n-len(set(ans)))
Problem p02689 (python)

Fixed submission:
n, m = [int(i) for i in input().split()]
# 高さ入力
h = [int(i) for i in input().split()]
# 条件を満たす地点を記録
list = [[]for i in range(n)]
for i in range(m):
    a, b = [int(i) for i in input().split()]
    list[a-1].append(h[b-1])
    list[b-1].append(h[a-1])
ans = 0
for i in range(n):
    if len(list[i]) == 0:
        ans += 1
    elif h[i] > max(list[i]):
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
# 高さ入力
h = list(int, input())
a = [0]*m
b = [0]*m
for i in range(m):
    a[i], b[i] = map(int, input().split())
list = []
for i in range(m):
    if h[a[i]-1] > h[b[i]-1]:
        list.append(a[i])
    elif h[a[i]-1] == h[b[i]-1]:
        list.append(a[i])
        list.append(b[i])
    else:
        list.append(b[i])
# 答えを記録する用配列
listans = [0]*n
for i in range(len(list)):
    listans[list[i] - 1] += 1
ans = 0
for i in range(n):
    if listans[i] == 0:
        ans += 1
print(ans)
Problem p02695 (python)

Fixed submission:
# ここから入力
from itertools import combinations_with_replacement
from itertools import accumulate
n, m, q = map(int, input().split())
a = []
for i in range(q):
    a.append(list(map(int, input().split())))
# ここまで入力
# 重複組合せ
x = 0
for i in combinations_with_replacement(range(1, m + 1), n):
    ans = []
    for j in a:
        if i[j[1] - 1] - i[j[0] - 1] == j[2]:
            ans.append(j[3])
    if x < sum(ans):
        x = sum(ans)
print(x)

Buggy submission (verdict: Runtime Error):
# ここから入力
from itertools import combinations_with_replacement
n, m, q = map(int, input().split())
lst = []
for i in range(q):
    a = list(map(int, input().split()))
    lst.append(a)
# ここまで入力
x = 0
# 重複組合せ
for i in combinations_with_replacement(range(1, m + 1), n):
    s = 0
    for j in a:
        if i[j[1] - 1] - i[j[0] - 1] == j[2]:
            s += j[3]
    if x < s:
        x = s
print(x)
Problem p02701 (python)

Fixed submission:
from collections import Counter
n = int(input())
s = [input() for i in range(n)]
c = Counter(s)
c = list(c.items())
print(len(c))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
s = [input() for i in range(n)]
c = Counter(s)
c = list(s.items())
print(len(c))

Buggy submission (verdict: Runtime Error):
import collections
n = int(input())
for i in range(n):
    a = int(input())
  b=collections.Counter(a)
  print(len(b))
Problem p02676 (python)

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

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

Fixed submission:
n,m = map(int,input().split())
h = [int(x) for x in input().split()]
a = [0] * m
b = [0] * m
for i in range(m):
    a[i],b[i] = map(int,input().split())
ind = []
for i in range(m):
    if h[a[i]-1] < h[b[i]-1]:
        ind.append(a[i])
    elif h[a[i]-1] == h[b[i]-1]:
        ind.append(a[i])
        ind.append(b[i])
    else:
        ind.append(b[i])
ind2 = [0] * n
for i in range(len(ind)):
    ind2[ind[i]-1] += 1
ans = 0
for i in range(n):
    if ind2[i] == 0:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
h = [int(x) for x in input().split()]
a = [0] * m
b = [0] * m
for i in range(m):
    a[i],b[i] = map(int,input().split())
ind = []
for i in range(m):
    if h[a[i]-1] < h[b[i]-1]:
        ind.append(a[i])
    elif h[a[i]-1] == h[b[i]-1]:
        ind.append(a[i])
        ind.append(b[i])
    else:
        ind.append(b[i])
ind2 = [0] * n
for i in range(n):
    ind2[ind[i]-1] += 1
ans = 0
for i in range(n):
    if ind2[i] == 0:
        ans += 1
print(ans)
Problem p03326 (python)

Fixed submission:
import itertools

N,M = map(int,input().split()) # <=1000
xyz = [list(map(int,input().split())) for _ in range(N)]
if  M == 0:
    print(0)
    exit()
result = 0
L = [[0] * N for i in range(8)]
for i,j in enumerate(itertools.product((-1,1),repeat=3)):
    for k,l in enumerate(xyz):
        L[i][k] = l[0] * j[0] + l[1] * j[1] + l[2] * j[2]
    L[i] = sorted(L[i],reverse=True)
print(max([sum(i[:M]) for i in L]))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split()) # <=1000
xyz = [list(map(int,input().split())) for _ in range(N)]

dp = [[{'S':0,'L':[0,0,0]} for __ in range(N)]for _ in range(M+1)]
dp[1][0]['L'] = xyz[0]
dp[1][0]['S'] = abs(xyz[0][0]) + abs(xyz[0][1]) + abs(xyz[0][2])
for i in range(1,N):
    for j in range(1,min(i+2,M+1)):
        t = dp[j-1][i-1]['L']
        t = [t[0] + xyz[i][0],t[1] + xyz[i][1],t[2] + xyz[i][2]]
        ts = abs(t[0])+abs(t[1])+abs(t[2])
        if dp[j][i-1]['S'] < ts:
            dp[j][i]['S'] = ts
            dp[j][i]['L'] = t
        else:
            dp[j][i]['S'] = dp[j][i-1]['S']
            dp[j][i]['L'] = dp[j][i-1]['L']

print(dp[M][N-1]['S'])

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split()) # <=1000
xyz = [list(map(int,input().split())) for _ in range(N)]

dp = [[{'S':0,'L':[0,0,0]} for __ in range(N)]for _ in range(M+1)]
dp[1][0]['L'] = xyz[0]
dp[1][0]['S'] = abs(xyz[0][0]) + abs(xyz[0][1]) + abs(xyz[0][2])
for i in range(1,N):
    for j in range(1,min(i+2,M+1)):
        t = dp[j-1][i-1]['L']
        t = [t[0] + xyz[i][0],t[1] + xyz[i][1],t[2] + xyz[i][2]]
        ts = abs(t[0])+abs(t[1])+abs(t[2])
        if dp[j][i-1]['S'] < ts:
            dp[j][i]['S'] = ts
            dp[j][i]['L'] = t
        else:
            dp[j][i]['S'] = dp[j][i-1]['S']
            dp[j][i]['L'] = dp[j][i-1]['L']

print(dp[M][N-1]['S'])
Problem p03426 (python)

Fixed submission:
H,W,D = map(int,input().split())
A = [list(map(int,input().split())) for _ in range(H)]
Q = int(input())
LR = [list(map(int,input().split())) for _ in range(Q)]

data = {A[i][j]:j + i * W for i in range(H) for j in range(W)}

memo = [0] * (H*W+1)
for i in range(1+D,H*W+1):
    a,b = data[i],data[i-D]
    memo[i] = memo[i-D] + abs(a%W - b % W) + abs(a//W - b//W)

for l,r in LR:
    if l == r:
        print(0)
        continue
    print(memo[r] - memo[l])

Buggy submission (verdict: Runtime Error):
H,W,D = map(int,input().split())
A = [list(map(int,input().split())) for _ in range(H)]
Q = int(input())
LR = [list(map(int,input().split())) for _ in range(Q)]

data = {A[i][j]:j + i * W for i in range(H) for j in range(W)}
move = [0] * (H*W + 1)

for i in range(1+D,H*W+1):
    a,b = data[i],data[i-D]
    move[i] = abs(a%W - b % W) + abs(a//W - b//W)

memo = [[None] * (H*W) for _ in range(H*W)]
for l,r in LR:
    if l == r:
        print(0)
        continue
    if memo[l][r]:
        print(memo[l][r])
    else:
        t = sum(move[l+D:r+1:D])
        memo[l][r] = t
        print(t)
Problem p02897 (python)

Fixed submission:
n = int(input())
if (n%2 == 0):
    print("%.10f" % (1/2))
else:
    ans = ((n//2) + 1) / n
    print("%.10f" % ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
if (n % 2 == 0):
  print("%.10f" % (1/2))
else:
  print("%.10f" % ((n//2)+1)/n)
Problem p02793 (python)

Fixed submission:
import sys #追加
sys.setrecursionlimit(500*500)

def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return int(x)

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

LCM = lcm(A)

ans = 0
for a in A:
    ans += LCM//a

ans %= 1000000007

print(ans)

Buggy submission (verdict: Runtime Error):
import sys #追加
sys.setrecursionlimit(500*500)

def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return int(x)

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

LCM = lcm(A)

ans = 0
for a in A:
    ans += int(LCM/a)
    ans %= 1000000007

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(500*500)

def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

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

LCM = lcm(A)

ans = 0
for a in A:
    ans += LCM/a
    ans %= 1000000007

print(ans)

Buggy submission (verdict: Runtime Error):
def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

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

LCM = lcm(A)

ans = 0
for a in A:
    ans += int(LCM/a)
    ans %= 1000000007

print(ans)
Problem p02659 (python)

Fixed submission:
from decimal import Decimal
import math
a,b = map(Decimal,input().split())
ans = a*b
print(math.floor(ans))

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

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

Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

A1, A2, A3 = map(int, input().split())

print("bust" if A1 + A2 + A3 >= 22 else "win")

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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

s = 0
b = 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 + 7
m = []
for i in range(1 - 1, N - 1):
    for j in range(i + 1 - 1, N + 1 - 1):
        s += A[i] ^ A[j]
        while s >= b:
            s -= b

print(s)
Problem p02676 (python)

Fixed submission:
K = int(input())
S = input()
 
if len(S) <= K:
  print(S)
else:
  print(S[:K] + '...')

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

if len(S) <= K:
  print(S)
else:
  print(S[:K] + '...')
Problem p02777 (python)

Fixed submission:
S, T = input().split()
A, B = (int(x) for x in input().split())
U = input()
if S == U or T == U:
  print(A - int(S==U), B - int(T==U))

Buggy submission (verdict: Runtime Error):
S, T = input().split()
A, B = (int(x) for x in input().split())
U = input()
print(A - int(S==U), B - int(T==U) if S == U or T == U)
Problem p02879 (python)

Fixed submission:
a,b=(int(x) for x in input().split())
if a > 9 or b > 9:
  print(-1)
else:
  print(a *b)

Buggy submission (verdict: Runtime Error):
N = int(input())  
count = [N-1]
for i in range(2, N+1):
  if N%i==0:
    count.append(int(i + N/i -2))
    print(min(count))
    break
Problem p02880 (python)

Fixed submission:
N = int(input())
multi_list = []
for i in range(1, 10):
  for j in range(1, 10):
    multi_list.append(i*j)
 
if N in multi_list:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
multi_list = []
for i range(1, 10):
  for j in range(1, 10):
    multi_list.append(i*j)

if N in multi_list:
  print('Yes')
else:
  print('No')
Problem p02711 (python)

Fixed submission:
num = input()
flag = False
for i in range(len(num)):
    if num[i] == '7':
        flag = True
        break
if flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
num = input()
flag = False
for i in range(num):
  if num[i] == '7':
    flag = True
    break
if flag:
  print("Yes")
else:
  print("No")
Problem p02726 (python)

Fixed submission:
n,x,y=map(int,input().split())
ans=[0]*(n-1)
for i in range(1,n):
    for j in range(i+1,n+1):
        ans[min(j-i,abs(x-i)+1+abs(j-y),abs(y-i)+1+abs(j-x))-1]+=1
for i in range(n-1):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
n,x,y=map(int,input().split())
ans=[0]*(n-1)
for i in range(1,n):
    for j in range(i+1,n+1):
        ans[min(j-i,abs(x-i)+1+abs(j-y)),abs(y-i)+1+abs(j-x)-1]+=1
for i in range(n-1):
    print(ans[i])
Problem p02773 (python)

Fixed submission:
import collections
n=int(input())
li=[input() for _ in range(n)]
c=collections.Counter(li)
M=max(c.values())
ans=[]
for k,v in c.items():
    if v==M:
      ans.append(k)
ans.sort()
for i in range(len(ans)):
  print(ans[i])

Buggy submission (verdict: Runtime Error):
import collections
n=int(input())
li=[]
for i in range(n):
    s=str(input())
    li.append(s)
li.sort(reverse=True)
c=collections.Counter(li)
print(c.most_common()[0][0])
for i in range(1,n):
    if c.most_common()[i][1]==c.most_common()[0][1]:
        print(c.most_common()[i][0])
    else:
        break
Problem p02879 (python)

Fixed submission:
a,b=map(int,input().split())
if a<=9 and b<=9:
  print(a*b)
else:
  print("-1")

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
l=[0]
b=0
for i in range(1,n,1):
  if n%i==0 and n/i>=i:
    a=i+(n/i)
    l.append(a)
  else:
    b+=1
    
c=min(l)  
print(c-2)
Problem p02880 (python)

Fixed submission:
n=int(input())
a=1
b=0
for i in range(1,10,1):
  if n%i==0 and n/i<=9:
    a=a*0
  else:
    b+=1
    
if a==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
a=0
b=0
for i in range(2,10,1):
  if n%i=0 and n/i<=9:
    a=1
  else:
    b+=1
    
if a==1:
  print("Yes")
else:
  print("No")
Problem p02881 (python)

Fixed submission:
import numpy as np
n=int(input())
m=int(np.ceil(np.sqrt(n)))+1
l=[]

for i in range(1,m,1):
    if n%i==0:
        a=i+(n/i)
        l.append(a)
        
c=int(min(l))
print(c-2)

Buggy submission (verdict: Runtime Error):
import numpy as np
n=int(input())
m=np.floor(np.sqrt(n))

l=[]
for i in range(1,m+1,1):
    if n%i==0:
        a=i+(n/i)
        l.append(a)
        
c=int(min(l))
print(c-2)

Buggy submission (verdict: Runtime Error):
n=int(inout())
l=[]
for i in range(1,n,1):
    if n%i==0 and n/i>=i:
        a=i+(n/i)
        l.append(a)
        
c=int(min(l))
print(c-2)
Problem p02897 (python)

Fixed submission:
n=int(input())
if n%2==0:
  print(0.5)
else:
  print((n+1)/(2*n))

Buggy submission (verdict: Runtime Error):
n=int(inpout())
if n%2==0:
  print(0.5)
else:
  print((n+1)/(2*n))

Buggy submission (verdict: Runtime Error):
n=int(inpout())
if n%2==0:
    print(0.5)
else:
    print((n+1)/(2*n))

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2==0:
    return(0.5)
else:
    return((n+1)/(2*n))

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2==0:
  return(0.5)
else:
  return((n+1)/(2*n))