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

Fixed submission:
import sys
n = int(input())
w = []
for i in range(n):
    w.append(input())
if len(w) != len(set(w)):
    print("No")
    sys.exit()
for i in range(n-1):
    if w[i][len(w[i]) - 1] != w[i+1][0]:
        print("No")
        sys.exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
w = []
for i in range(n):
    w.append(input())
if len(w) != len(set(w)):
    print("No")
    sys.exit()
for i in range(n-1):
    if w[i][len(w[i]) - 1] != w[i+1][len(w[i+1] - 1)]:
        print("No")
        sys.exit()
print("Yes")
Problem p03281 (python)

Fixed submission:
import sys
import math
def search_divisor_num_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        divisor_num = 1
        for prime in prime_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num

def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]
    
n = int(input())
count =0
for i in range(1,n+1,2):
    tmp = search_divisor_num_1(i)
    if tmp == 8:
        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
import sys

def search_divisor_num_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        divisor_num = 1
        for prime in prime_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num

n = int(input())
count =0
for i in range(1,n+1,2):
    tmp = search_divisor_num_1(i)
    if tmp == 8:
        count+=1
print(count)
Problem p03285 (python)

Fixed submission:
import sys
n = int(input())
n2 = n
while n>0:
    if n % 4 == 0 or n % 7 == 0:
        print("Yes")
        sys.exit()
    n -= 7
while n2>0:
    if n2 % 4 == 0 or n2 % 7 == 0:
        print("Yes")
        sys.exit()
    n2 -= 4
print("No")

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
n2 = n
while n>0:
    if n % 4 == 0 or n % 7 == 0:
        print("Yes")
        sys.exit(1)
    n -= 7
while n2>0:
    if n2 % 4 == 0 or n2 % 7 == 0:
        print("Yes")
        sys.exit(1)
    n2 -= 4
print("No")

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
n2 = n
while n>0:
    if n % 4 == 0 or n % 7 == 0:
        print("Yes")
        sys.exit(1)
    n -= 7
while n>0:
    if n % 4 == 0 or n % 7 == 0:
        print("Yes")
        sys.exit(1)
    n -= 4
print("No")
Problem p03293 (python)

Fixed submission:
import sys
s = input()
t = input()

for i in range(len(s)):
    if s == t:
        print("Yes")
        sys.exit()
    else:
        tmp = s[0]
        s = s[1:] + tmp
print("No")

Buggy submission (verdict: Runtime Error):
import sys
s = input()
t = input()

for i in range(len(s)):
    if s == t:
        print("Yes")
        sys.exit()
    else:
        tmp = s[0]
        del s[0]
        s = s + tmp
print("No")

Buggy submission (verdict: Runtime Error):
import sys
s = set(input())
t = set(input())

if len(s) != len(t):
    print("No")
    sys.exit()

if all(s.count(t[i]) ==1 for i in range(len(t))):
    print("Yes")
else:
    print("No")
Problem p03308 (python)

Fixed submission:
import sys
n = int(input())
a = list(map(int, input().split()))
a.sort()
print(a[n-1] - a[0])

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
a = list(map(int, input().split())).sorted()
print(a[n-1] - a[0])
Problem p03351 (python)

Fixed submission:
a,b,c,d = list(map(int, input().split()))
print("Yes" if abs(a-c)<= d or abs(a-b)<=d and abs(c-b) <= d else "No")

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

def isExponential(i : int) -> bool:
    for j in range(2,math.ceil(math.sqrt(i))+1):       
        devidend = i
        devisor = j
        #print(devidend,devisor,"inFor") 
        while 1:
            #print(devidend,devisor,"inWhile")
            if devidend % devisor != 0:
                break
            else:
                if devidend == devisor:
                    return True
                else:
                    devidend //= devisor
    return False

x = int(input())
if x == 1:
    print(1)
for i in range(x,0,-1):
    if isExponential(i) == True:
        #print(i)
        #print("wtf")
        break
    else:
        print(i,"False")
Problem p03352 (python)

Fixed submission:
import sys
import math

def isExponential(i : int) -> bool:
    #math.ceil(math.sqrt(i))+1
    for j in range(2,i):       
        devidend = i
        devisor = j
        #print(devidend,devisor,"inFor") 
        while 1:
            #print(devidend,devisor,"inWhile")
            if devidend % devisor != 0:
                break
            else:
                if devidend == devisor:
                    return True
                else:
                    devidend //= devisor
    return False

x = int(input())
if x == 1:
    print(1)
for i in range(x,0,-1):
    if isExponential(i) == True:
        print(i)
        #print("wtf")
        break

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

def isExponential(i : int) -> bool:
    for j in range(math.sqrt(i)):
        devidend = i
        devisor = j
        while 1:
            if devidend % devisor != 0:
                break
            else:
                if devidend == devisor:
                    return 1
                else:
                    devidend //= devisor
    return 0
x = int(input())
for i in range(x,0,-1):
    if isExponential(i):
        print(i)
        break
Problem p03386 (python)

Fixed submission:
import sys
import math

a,b,k = list(map(int, input().split()))
if b-a+1 <= k:
    for i in range(a,b+1):
        print(i)
else:
    lis = list(range(a,a+k))
    lis.extend(list(range(b-k+1, b+1)))
    lis = list(set(lis))
    lis.sort()
    for i in range(len(lis)):
        print(lis[i])

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

a,b,k = list(map(int, input().split()))
lis = range(a,a+k)
lis.append(range(b-k+1, b+1))
for i in range(len(lis)):
    print(lis[i])

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

a,b,k = list(map(int, input().split()))
lis = range(a,a+k) + range(b-k+1, b+1)
for i in range(len(lis)):
    print(lis[i])
Problem p03434 (python)

Fixed submission:
n = int(input())
s = list(map(int, input().split()))
s.sort(reverse=True)
print(sum(s[::2]) - sum(s[1::2]))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(map(int, input().split()))
s.sort(reverse=True)
print(s[::2] - s[1::2])
Problem p03469 (python)

Fixed submission:
s = input().split("/")
print("2018/01/"+s[2])

Buggy submission (verdict: Runtime Error):
s = input().split("/")
print("2018/01/"+s[3])
Problem p03486 (python)

Fixed submission:
import sys
s = list(input())
s.sort()
t = list(input())
t.sort(reverse = True)
for i in range(min(len(s),len(t))):
    if ord(s[i]) < ord(t[i]):
        print("Yes")
        sys.exit()
    elif ord(s[i]) > ord(t[i]):
        print("No")
        sys.exit()
print("Yes" if len(s) < len(t) else "No")

Buggy submission (verdict: Runtime Error):
import sys
s = input().sort()
t = input().sort(reverse = True)
for i in range(min(len(s),len(t))):
    if ord(s[i]) < ord(t[i]):
        print("Yes")
        sys.exit()
    elif ord(s[i]) > ord(t[i]):
        print("No")
        sys.exit()
print("Yes" if len(s) < len(t) else "No")
Problem p03494 (python)

Fixed submission:
import sys
n = int(input())
a = list(map(int, input().split()))
count = 0
while all(i % 2 == 0 for i in a):
    a = [i // 2 for i in a]
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
a = list(map(int, input().split()))
count = 0
while all(a[i] % 2 == 0 for i in a):
    a = [a[i] // 2 for i in a]
    count+=1
print(count)
Problem p03679 (python)

Fixed submission:
x,y,z= list(map(int, input().split()))
if y>=z:
    print("delicious")
else:
    print("safe" if x+y>=z else "dangerous")

Buggy submission (verdict: Runtime Error):
x,y,z= list(map(int, input().split()))
if y>=z:
    print("delicious")
else:
    print("safe" if x+a>=b else "dangerous")
Problem p03680 (python)

Fixed submission:
import sys

def search_next(nextbutton : int) -> int:
    nextbutton = a.index(nextbutton) +1
    return nextbutton

n = int(input())
a = [int(input()) for i in range(n)]
nextbutton = 1
count = 0

#print(nextbutton,"first")

for _ in range(n):
    if nextbutton == 2:
        print(count)
        #print(nextbutton,"1")
        
        sys.exit()
    else:
        nextbutton = a[nextbutton -1]
        #print(nextbutton,"el")
        
        count += 1
print(-1)

Buggy submission (verdict: Runtime Error):
import sys

def search_next(nextbutton : int) -> int:
    nextbutton = a.index(nextbutton) +1
    return nextbutton

n = int(input())
a = [int(input()) for i in range(n)]
nextbutton = 2
count = 1

try :
    nextbutton = search_next(nextbutton)
except:
    print(-1)
    sys.exit()
#print(nextbutton,"first")

for _ in range(n):
    if nextbutton == 2:
        print(-1)
        #print(nextbutton,"2")
        
        sys.exit()
    elif nextbutton == 1:
        print(count)
        #print(nextbutton,"1")
        
        sys.exit()
    else:
        nextbutton = search_next(nextbutton)
        #print(nextbutton,"el")
        
        count += 1
print(-1)

Buggy submission (verdict: Runtime Error):
import sys

def search_next(nextbutton : int) -> int:
    nextbutton = a.index(nextbutton) +1
    return nextbutton

n = int(input())
a = [int(input()) for i in range(n)]
nextbutton = 2
count = 1

try :
    nextbutton = search_next(nextbutton)
except:
    print(-1)
    sys.exit()
#print(nextbutton,"first")

while 1:
    if nextbutton == 2:
        print(-1)
        #print(nextbutton,"2")
        
        sys.exit()
    elif nextbutton == 1:
        print(count)
        #print(nextbutton,"1")
        
        sys.exit()
    else:
        nextbutton = search_next(nextbutton)
        #print(nextbutton,"el")
        
        count += 1
Problem p03711 (python)

Fixed submission:
import sys
x,y = list(input().split())
judge = 0
x = x.translate(str.maketrans({"3":"1","5":"1","7":"1","8":"1","6":"4","9":"4"}))
y = y.translate(str.maketrans({"3":"1","5":"1","7":"1","8":"1","6":"4","9":"4"}))
x = x.replace("10", "1").replace("12", "1").replace("11","4")
y = y.replace("10", "1").replace("12", "1").replace("11","4")

print("Yes" if x == y else "No")

Buggy submission (verdict: Runtime Error):
import sys
x,y = list(input().split())
judge = 0
x = x.translate(string.maketrans({"3":"1","5":"1","7":"1","8":"1","10":"1","12":"1","6":"4","9":"4","11":"4"}))
y = y.translate(string.maketrans({"3":"1","5":"1","7":"1","8":"1","10":"1","12":"1","6":"4","9":"4","11":"4"}))

print("Yes" if x == y else "No")
Problem p03777 (python)

Fixed submission:
import sys
a,b = list(input().split())
print("H" if a == b else "D")

Buggy submission (verdict: Runtime Error):
import sys
a,b = list(map(int, input().split()))
print("H" if a == b else "D")
Problem p03853 (python)

Fixed submission:
import sys
h,w = list(map(int, input().split()))
c = [input() for _ in range(h)]

for i in range(h):
    print(c[i])
    print(c[i])

Buggy submission (verdict: Runtime Error):
import sys
h,w = list(map(int, input().split()))
c = []
c.append([input() for _ in range(h)])

for i in range(h):
    print(c[i])
    print(c[i])
Problem p03860 (python)

Fixed submission:
a,b,c = input().split()
print("A"+ b[0]+ "C")

Buggy submission (verdict: Runtime Error):
a,b,c = list(map(int, input().split()))
print("A"+ b[0]+ "C")
Problem p04030 (python)

Fixed submission:
s = input()
ans = ""
for i in range(len(s)):
    if s[i] == "0":
        ans = ans + "0"
    elif s[i] == "1":
        ans = ans + "1"
    elif s[i] == "B":
        ans = ans[:len(ans)-1]
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = ""
for i in range(len(s)):
    if s[i] = "0":
        ans.append("0")
    elif s[i] = "1":
        ans.append("1")
    elif s[i] = "B":
        ans.rstrip()
print(ans)
Problem p02743 (python)

Fixed submission:
def main():
    import math
    a, b, c = map(int, input().split())
    # a = math.sqrt(a)
    # b = math.sqrt(b)
    # c = math.sqrt(c)
    # n = math.sqrt(a*b)

    if 4 * a*b < (c-a-b)**2 and c-a-b > 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    import fractions
    a, b, c = map(int, input().split())
    a = fractions.sqrt(a)
    b = fractions.sqrt(b)
    c = fractions.sqrt(c)

    if a+b<c:
        print('Yes')
    else:
        print('No')


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

Fixed submission:
def main():
    # input
    m1, d1 = map(int, input().split())
    m2, d2 = map(int, input().split())

    if d2 == 1:
        print(1)
    else:
        print(0)

    # calc


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    # input
    n = int(input())
    s = input()

    ans = 0
    for i in range(0, 1000):
        num = str(i)
        num = '0'*(3-len(num))+num
        index = 0
        for i in s:
            if index == 3:
                ans += 1
                break
            elif num[index]==i:
                index += 1
        else:
            if index == 3:
                ans += 1

    print(ans)

    # calc


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    # input
    n = int(input())
    s = input()

    ans = 0
    for i in range(0, 1000):
        num = str(i).rjust(3, '0')
        index = 0
        for i in s:
            if index == 3:
                ans += 1
                break
            elif num[index]==i:
                index += 1
        else:
            if index == 3:
                ans += 1

    print(ans)

    # calc


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

Fixed submission:
def main():
    # input
    x = int(input())

    num = x//100
    a = x%100

    if a <= num*5:
        print(1)
    else:
        print(0)


    # calc


if __name__ == '__main__':
    main()

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

    dp = [False for _ in range(x+1)]
    for i in range(6):
        dp[100+i] = True

    # calc
    for i in range(106, x+1):
        for j in range(6):
            if dp[i-100-j]:
                dp[i] = True
                break

    if dp[i]:
        print(1)
    else:
        print(0)

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

Fixed submission:
def main():
    # input
    import math
    t1, t2 = map(int, input().split())
    a1, a2 = map(int, input().split())
    b1, b2 = map(int, input().split())

    x = (a1-b1)*t1
    y = (a2-b2)*t2
    diff = x+y

    if x == -y:
        print("infinity")
        return
    elif x*y>0 or abs(x)>abs(y):
        print(0)
        return

    x = abs(x)
    diff = abs(diff)
    ans = x//diff
    remainder = x%diff
    if remainder==0:
        print(ans*2)
    else:
        print(ans*2+1)

    # calc

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    # input
    t1, t2 = map(int, input().split())
    a1, a2 = map(int, input().split())
    b1, b2 = map(int, input().split())

    x = (a1-b1)*t1
    y = (a2-b2)*t2
    diff = x+y

    print(x)
    print(y)
    print(diff)

    if x == -y:
        print("infinity")
        return
    elif x*y > 0:
        print(0)
        return

    if diff > 0: # aが先行
        if x<0:
            x = abs(x)
            ans = x//diff
        else:
            y = abs(y)
            ans = y//diff

    else: # bが先行
        diff = ans(diff)
        if x>0:
            ans = x//diff
        else:
            ans = y//diff

    print(ans*2+1)

    # calc


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

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
ans = 0
for i in h:
  if i>=k:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input()))
ans = 0
for i in h:
  if i>k:
    ans += 1
print(ans)
Problem p02952 (python)

Fixed submission:
def func(len_a):
    ans = ""
    for i in range(1, len_a):
        if i & 1 == 0:
            ans += "0"
        elif i & 1 == 1:
            ans += "9"
    return ans

def main():
    a = input()
    len_a = len(a)
    if len_a & 1 == 0:
        ans = func(len_a)
        print(ans)
    else:
        if len_a == 1:
            print(a)
        else:
            ans = int(func(len_a-1))
            ans = ans + ( int(a) - 10 ** (len_a-1) ) + 1
            print(ans)


main()

Buggy submission (verdict: Runtime Error):
def func(len_a):
    ans = ""
    for i in range(1, len_a):
        if i & 1 == 0:
            ans += "0"
        elif i & 1 == 1:
            ans += "9"
    return ans

def main():
    a = input()
    len_a = len(a)
    if len_a & 1 == 0:
        ans = func(len_a)
        print(ans)
    else:
        ans = int(func(len_a-1))
        ans = ans + ( int(a) - 10 ** (len_a-1) ) + 1
        print(ans)


main()
Problem p03035 (python)

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

if A < 6:
    print(0)
elif 6 <= A <13:
    print(B//2)
else:
    print(B)

Buggy submission (verdict: Runtime Error):
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 p03160 (python)

Fixed submission:
def main():
    n = int(input())
    h = [int(i) for i in input().split()]
    cost = [0 for _ in range(n)]
    cost[0] = 0
    cost[1] = abs(h[1] - h[0])
    for i in range(2, n):
        cost[i] = min(cost[i-1]+abs(h[i] - h[i-1]), cost[i-2]+abs(h[i] - h[i-2]))
    print(cost[-1])
main()

Buggy submission (verdict: Runtime Error):
def main():
    n, k = map(int, input().split())
    h = tuple(map(int, input().split()))

    if k >= n:
        print(abs(h[-1]-h[0]))

    dp = [0]*(n)

    for i in range(1, n):
        temp = 10**10
        for j in range(1, min(i, k)+1):
            temp = min(temp, dp[i-j]+abs(h[i]-h[i-j]))
        dp[i] = temp

    print(dp[-1])

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

Fixed submission:
def main():
    n, k = map(int, input().split())
    h = tuple(map(int, input().split()))
    cost = [0 for _ in range(n)]
    cost[0] = 0
    cost[1] = abs(h[1] - h[0])
    for i in range(2, n):
        cost[i] = min((cost[i-1-j] + abs(h[i]-h[i-1-j]) for j in range(min(i, k))))
    print(cost[-1])
main()

Buggy submission (verdict: Runtime Error):
import numpy as np
def main():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    h = np.array(h)
    cost = np.empty(n)
    cost[0] = 0
    cost[1] = abs(h[1] - h[0])
    for i in range(2, n):
        j = min(i, k)
        cost[i] = np.min(cost[i-j:i-1] + np.abs(h[i-j:i-1] - h[i]))
    print(int(cost[-1]))
main()
Problem p03545 (python)

Fixed submission:
def main():
    li = [int(i) for i in input()]
    t = li[1:]
    op = ["+", "+", "+"]
    t_sum = sum(li)
    if t_sum == 7:
        print("{}+{}+{}+{}=7".format(li[0], li[1], li[2], li[3]))
    else:
        for i in range(3):
            if t_sum - 2*t[i] == 7:
                op[i] = "-"
                print("{}{}{}{}{}{}{}=7".format(li[0], op[0], li[1], op[1], li[2], op[2], li[3]))
                return
            elif t_sum - 2*t[i] > 7:
                for j in range(1, 3):
                    if t_sum - (t[i] + t[i-j])*2 == 7:
                        op[i] = "-"
                        op[i-j] = "-"
                        print("{}{}{}{}{}{}{}=7".format(li[0], op[0], li[1], op[1], li[2], op[2], li[3]))
                        return

main()

Buggy submission (verdict: Runtime Error):
def main():
    li = [int(i) for i in input()]
    t = li[1:]
    op = ["+", "+", "+"]
    t_sum = sum(t)
    if t_sum == 7:
        print("{}+{}+{}+{}=7".format(t[0], t[1], t[2], t[3]))
    else:
        for i in range(3):
            if t_sum - 2*t[i] == 7:
                op[i] = "-"
                print("{}{}{}{}{}{}{}=7".format(li[0], op[0], li[1], op[1], li[2], op[2], li[3]))
                return
            elif t_sum - 2*t[i] > 7:
                for j in range(1, 3):
                    if t_sum - (t[i] + t[i-j])*2 == 7:
                        op[i] = "-"
                        op[i-j] = "-"
                        print("{}{}{}{}{}{}{}=7".format(li[0], op[0], li[1], op[1], li[2], op[2], li[3]))
                        return

main()
Problem p02760 (python)

Fixed submission:
#!/usr/bin/env python3
import sys
#input = sys.stdin.buffer.readline

def inn(func=int):
    return list(map(func,input().split()))

def ins():
    return input().split()

a0 = inn()
a1 = inn()
a2 = inn()
a = a0+a1+a2
n = int(input())
ban = [0,0,0,0,0,0,0,0,0]
for i in range(n):
    b = int(input())
    for j in range(9):
        if b == a[j]:
            ban[j] = 1


for i in [0,1,2]:
    t = ban[i]+ban[i+3]+ban[i+6]
    if t == 3:
        print("Yes")
        exit()
for i in [0,3,6]:
    t = ban[i]+ban[i+1]+ban[i+2]
    if t == 3:
        print("Yes")
        exit()
if (ban[0]+ban[4]+ban[8]) == 3 or (ban[2]+ban[4]+ban[6]) == 3:
    print("Yes")
    exit()
print("No")

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
#input = sys.stdin.buffer.readline

def inn(func=int):
    return list(map(func,input().split()))

def ins():
    return input().split()

a0 = inn()
a1 = inn()
a2 = inn()
a = a0+a1+a2
n = int(input())
ban = [0,0,0,0,0,0,0,0,0]
for i in range(n):
    b = int(input())
    for j in range(9):
        if b == a[j]:
            ban[j] = 1

for i in [0,3,6]:
    tate = ban[i]+ban[i+3]+ban[i+6]
    yoko = ban[i]+ban[i+1]+ban[i+2]
    if tate == 3 or yoko == 3:
        print("Yes")
        exit()
if (ban[0]+ban[4]+ban[8]) == 3 or (ban[2]+ban[4]+ban[6]) == 3:
    print("Yes")
    exit()
print("No")
Problem p02741 (python)

Fixed submission:
arr = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

k = int(input())
print(arr[k-1])

Buggy submission (verdict: Runtime Error):
arr = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

k = int(input())
print(arr[k])
Problem p02924 (python)

Fixed submission:
n = (int)(input())
print((n-1)*n//2)

Buggy submission (verdict: Runtime Error):
n = (int)(input)
print((n-1)*n)//2
Problem p02791 (python)

Fixed submission:
N = int(input())
array = list(map(int, input().split()))
cnt = 1
minv = array[0]

for i in range(1, N):
    if minv > array[i]:
        minv = array[i]
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
from functools import lru_cache
@lru_cache(maxsize = None)

N = int(input())
array = list(map(int, input().split()))
cnt = 0

for i in range(0, N):
    for j in range(0, i):
        if array[i] > array[j]:
            break
    else:
        cnt += 1
print(cnt)
Problem p02811 (python)

Fixed submission:
K, X = map(int, input().split())

total = 500 * K

if total >= X:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
K, X = map(int, input().split())

total = 500 * K

if total >= X:
    print("Yes")
else:
    prnt("No")