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

Fixed submission:
a = int(input())
s = input()

if a >= 3200:
  print(s)
else:
  print('red')

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

N, Q = map(int,input().split())

# AB = [[int(x) for x in input().split()] for _ in range(N-1)]

# print(AB)

# 添字を1からにしたいのでN+1
graph = [[] for _ in range(N+1)]

# 各頂点に隣接する頂点
for _ in range(N-1):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)

# print(graph)
counter = [0] * (N+1)

# print(counter)

# PX = [[int(x) for x in input().split()] for _ in range(Q)]

# 各頂点に点数を足す
for _ in range(Q):
  p, x = map(int, input().split())
  counter[p] += x


def shori(pa,c,val):
  val += counter[c]
  counter[c] = val
  for i in graph[c]:
    if i == pa:
      continue
    shori(c,i,val)
  
shori(0,1,0)
  

print(" ".join(map(str, counter[1:])))
Problem p03835 (python)

Fixed submission:
import sys
input = sys.stdin.readline
 
K,S=map(int,input().split())
count=0
for x in range(K+1):
    for y in range(K+1):
        if S-(x+y)>=0 and S-(x+y)<=K: count+=1
print(count)

Buggy submission (verdict: Runtime Error):
K,S=map(int,input().split())
if 2<=K<=2500 and 0<=S<=3*K:
    Ks=[]
    wa=[]
    for i in range(K+1):
        Ks.append(i)
    X,Y,Z =Ks,Ks,Ks
    for x in X:
        if x<=S:
            X_=[]
            X_.append(x)
            for y in Y:
                if y<=S:
                    X_Y_=[]
                    X_Y_=list(X_)
                    X_Y_.append(y)
                    for z in Z:
                        if z<=S:
                            X_Y_Z_=list(X_Y_)
                            X_Y_Z_.append(z) 
                            wa_=sum(X_Y_Z_)
                            wa.append(wa_)
    for j in wa:
        if j==S:
            count+=1
    print(count)
Problem p02753 (python)

Fixed submission:
s = input()
if s == 'AAA' or s == 'BBB':
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
s = input()
if s == AAA or BBB:
  print('No')
else:
  print('Yes')
Problem p02829 (python)

Fixed submission:
A = int(input())
B = int(input())
 
ans = ""
 
if A == 1 and B == 2:
  ans = "3"
elif A == 1 and B == 3:
  ans = "2"
elif A == 2 and B == 1:
  ans = "3"
elif A == 2 and B == 3:
  ans = "1"
elif A == 3 and B == 1:
  ans = "2"
elif A == 3 and B == 2:
  ans = "1"
  
print(ans)

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

def gcd(A,B):
  while B!=0:
    A,B=B,A%B
  return A
def lcm(A,B):
  return A*B//gcd(A,B)
print(lcm(A,B))

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

def gcd(A,B):
  while B!=0:
    A,B=B,A%B
  return A
def lcm(A,B):
  return A*B//gcd(A,B)
print(str(lcm(A,B)))

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

def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
def lcm(a,b):
  return a*b//gcd(a,b)
print(lcm(a,b))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

ans = 0

if A == 1 and B == 2:
  ans = 3
elif A == 1 and B == 3:
  ans = 2
elif A == 2 and B == 1:
  ans = 3
elif A == 2 and B == 3:
  ans = 1
elif A == 3 and B == 1:
  ans = 2
elif A == 3 and B == 2:
  elif = 1
  
print(ans)
Problem p02831 (python)

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

def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

def lcm(a,b):
  return a*b//gcd(a,b)
print(lcm(a,b))

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

def lcm(a,b):
  return a*b//gcd(a,b)
 print(lcm(a,b))
Problem p02835 (python)

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

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

Buggy submission (verdict: Runtime Error):
A1 = int(input())
A2 = int(input())
A3 = int(input())

if A1 + A2 + A3 >= 22:
  print('bust')
else:
  print('win')
Problem p02880 (python)

Fixed submission:
N = int(input())
if N > 81:
  print("No")
elif N>=1 and N<=10:
  print("Yes")
elif N==12 or N==14 or N==15 or N==16 or N==18 or N==20 or N==21 or N==24 or N==25 or N==27 or N==28 or N==30 or N==32 or N==35 or N==36 or N==40 or N==42 or N==45 or N==48 or N==49 or N==54 or N==56 or N==63 or N==64 or N==72 or N==81:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if N > 81:
  print("No")
elif N==1 or N==2 N==3 or N==4 or N==5 or N==6 or N==8 or N==9 or N==10 or N==12 or N==14 or N==15 or N==16 or N==18 or N==20 or N==21 or N==24 or N==25 or N==27 or N==28 or N==30 or N==32 or N==35 or N==36 or N==40 or N==42 or N==45 or N==48 or N==49 or N==54 or N==56 or N==63 or N==64 or N==72 or N==81:
  print("Yes")
else:
  print("No")
Problem p02897 (python)

Fixed submission:
N=int(input())
print((N//2+N%2)/N)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
h = [int(i) for i in input().split()]
 
ans = sum(1 for x in h if x >= k)
 
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int,input().split())
H = [int(i) for i in input().split()]
ans = sum(1 for x in H if x >= K)
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int,input().split())
H = list(map(int,input().split()))
print(sum([h>=K for h in H]))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
H=list(map(int,input().split()))
print(sum([h>=K for h in H]))

Buggy submission (verdict: Runtime Error):
N, K = map(int,input().split())
H = list(map(int,input().split()))
print(sum([h>=K for h in H]))
Problem p02915 (python)

Fixed submission:
N=int(input())
print(N*N*N)

Buggy submission (verdict: Runtime Error):
print(N*(N-1)*(N-2))

Buggy submission (verdict: Runtime Error):
N*(N-1)*(N-2)

Buggy submission (verdict: Runtime Error):
N*(N-1)*(N-2)

Buggy submission (verdict: Runtime Error):
N=int(input())
def fact(n):
  if n==0 or n==1:
    return 1
  else:
    return n*fack(n-1)
print(fack(3))
Problem p02659 (python)

Fixed submission:
import decimal
s = input().split()
a = int(s[0])
b = round(decimal.Decimal(s[1]), 2)
print(int(a * b))

Buggy submission (verdict: Runtime Error):
import math
A, B = [int(A) for A in input().split()]  
if float(B) >= 1:
    print(math.trunc(A * B))
elif 1 > float(B) > 0:
    print(0)
else:
    print(A * B)

Buggy submission (verdict: Runtime Error):
import math
A, B = [int(A) for A in raw_input().split()]  
if float(B) >= 1:
    print(math.trunc(A * B))
elif 1 > float(B) > 0:
    print(0)
else:
    print(A * B)

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int(input()), float(input()))
if B >= 1:
    print(math.trunc(A * B))
elif 1 > B > 0:
    print(0)
else:
    print(A * B)
Problem p02785 (python)

Fixed submission:
def main():
  N, K = map(int, input().split())
  
  H = sorted(list(map(int, input().split())), reverse=True)
 
  n = sum(H)
  
  if K == 0:
    print(n)
  elif N > K:
    for i in range(K):
      n -= H[i]
    print(n)
  else:
    print(0)
    
  return 0
 
if __name__ == "__main__":
  main()

Buggy submission (verdict: Runtime Error):
def main():
  N, K = map(int, input().split())
  
  H = sorted(list(map(int, input().split())), reverse=True)
 
  n =  sum(H)
  
  if K == 0:
    print(n)
  else:
    for i in range(K):
      n -= H[i]
    print(n)
    
  return 0

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

Fixed submission:
s, w = map(int, input().split()) # split()で空白区切りでリスト化、その際map()でint型にキャストし変数に代入。
if s > w:
	print("safe")
else:
	print("unsafe")

Buggy submission (verdict: Runtime Error):
s, w = map(int, input().split()) # split()で空白区切りでリスト化、その際map()でint型にキャストし変数に代入。
if s > w
	print("safe")
else
	print("unsafe")

Buggy submission (verdict: Runtime Error):
s, w = map(int, input().split()) # split()で空白区切りでリスト化、その際map()でint型にキャストし変数に代入。
if s > w
	print ("safe")
else print ("unsafe")
Problem p02711 (python)

Fixed submission:
n = input()
if "7" in n:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = inport()
if "7" in n:
  print("Yes")
else:
  print("No")
Problem p02723 (python)

Fixed submission:
A = input().strip()
if(A[2] == A[3] and A[4] == A[5]):
    print("Yes")
else:
    print ("No")

Buggy submission (verdict: Runtime Error):
A = input().strip()
if(A[2] == A[3] and A[4] == A[5])
    print("Yes")
else
    print ("no")

Buggy submission (verdict: Runtime Error):
A = input().strip()
if(A[3] == A[4] and A[5] == A[6])
    print("Yes")
else
    print ("no")

Buggy submission (verdict: Runtime Error):
A = input().strip()
if(A[3] == A[4] and A[5] == A[6])
    print("Yes")
else
    print ("no")
Problem p02711 (python)

Fixed submission:
a = int(input())
aa = list(str(a))
n = 0
for i in range(len(aa)):
    b = int(aa[i])
    if b == 7:
        n +=1
    else:
        n = n
if n > 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
SS = list(S)
n = 0
for i in range(N):
  for j in range(N):
    for k in range(N):
      kk = []
      kk.append(i)
      kk.append(j)
      kk.append(k)
      kk.sort()
      if SS[int(kk[0])] != SS[int(kk[1])] and SS[int(kk[1])] != SS[int(kk[2])] and SS[int(kk[2])] != SS[int(kk[0])]:
        if int(kk[1]) - int(kk[0]) != int(kk[2]) - int(kk[1]):
            n+=1
ans = int(n / 6)
print(ans)

Buggy submission (verdict: Runtime Error):
a = int(input())
aa = list(str(a))
n = 0
for i in range(len(aa)):
	b = int(aa[i])
    if b == 7:
        n +=1
    else:
        n = n
if n > 0:
    print("Yes")
else:
    print("No")
Problem p02659 (python)

Fixed submission:
A, B = input().split()
A, B = int(A), int(B.replace('.', ''))
print(A * B // 100)

Buggy submission (verdict: Runtime Error):
a,b=map(float,input().split())
a=int(a)
b=str(b)
b.replace(".","")
x=a*int(b)/100
print(x)

Buggy submission (verdict: Runtime Error):
a,b=int(input()),str(input())
b.replace(".","")
print(int(a*b/100))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=str(input())
b.replace(".","")
print(int(a*b/100))

Buggy submission (verdict: Runtime Error):
import math
a=int(input())
b=float(input())
p=a*b
print(math.floor(p))

Buggy submission (verdict: Runtime Error):
import math
a,b=int(input()),float(input())
x=a*b
print(math.floor(x))
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=int(input())
S=input()
if len(S)<K:
  print(S)
else:
  print(S[:,K]+"...")

Buggy submission (verdict: Runtime Error):
K=int(input())
S=input()
hai=[]
if len(S)<K:
  print(S)
else:
  for i in range(0,K):
    hai.append(S[i])
  print(hai+"...")
Problem p02699 (python)

Fixed submission:
import sys
input = sys.stdin.readline


def main():
    S, W = map(int, input().split())
    print("safe") if S > W else print("unsafe")


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline


def main():
    S = input().strip()
    answer = []
    for i in range(1, len(S)+1):
        [answer.append(j) for j in range(i+4, len(S)+1)
         if int(S[i-1:j]) % 2019 == 0]
    print(len(answer))


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

Fixed submission:
import sys
input = sys.stdin.readline
N = input()
assert 100 <= int(N) <= 999
print("Yes") if str(7) in N else print("No")

Buggy submission (verdict: Runtime Error):
import sys
import collections
input = sys.stdin.readline
N = int(input())
S = input().strip()
assert 1 <= N <= 4000
assert N == len(S)
r = S.count("R")
g = S.count("G")
b = S.count("B")
total = 0
for j in range(1, N-1):
    for i in range(j):
        k = 2*j-i
        if k < len(S):
            if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
                total += 1
# print(c["R"]*c["G"]*c["B"]-total)
print(r*g*b - total)

Buggy submission (verdict: Runtime Error):
import sys
import math
from functools import reduce


def main():
    input = sys.stdin.readline
    K = int(input())
    assert 1 <= K <= 200
    total = 0
    for i in range(1, K+1):
        for j in range(1, K+1):
            a = euclidean_algorithm(i, j)
            for k in range(1, K+1):
                total += euclidean_algorithm(a, k)
    print(total)


def euclidean_algorithm(a, b):
    r = a % b
    while r != 0:
        a = b
        b = r
        r = a % b
    return b


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
import math
from functools import reduce


def main():
    input = sys.stdin.readline
    K = int(input())
    assert 1 <= K <= 200
    total = 0
    for i in range(1, K+1):
        for j in range(1, K+1):
            a = euclidean_algorithm(i, j)
            for k in range(1, K+1):
                total += euclidean_algorithm(a, k)
    print(total)


def euclidean_algorithm(a, b):
    r = a % b
    while r != 0:
        a = b
        b = r
        r = a % b
    return b


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
import math
from functools import reduce


def main():
    input = sys.stdin.readline
    K = int(input())
    assert 1 <= K <= 200
    total = 0
    for i in range(1, K+1):
        for j in range(1, K+1):
            a = euclidean_algorithm(i, j)
            for k in range(1, K+1):
                total += euclidean_algorithm(a, k)
    print(total)


def gcd_list(numbers):
    return reduce(euclidean_algorithm, numbers)


def euclidean_algorithm(a, b):
    r = a % b
    while r != 0:
        a = b
        b = r
        r = a % b
    return b


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

Fixed submission:
import sys
input = sys.stdin.readline


def main():
    S = input().strip()
    print("No") if S == "AAA" or S == "BBB" else print("Yes")


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
import math
input = sys.stdin.readline


def main():
    A, B = map(int, input().split())
    assert A <= 100
    assert B <= 100
    for i in range(1000):
        if math.floor((i+1) * 0.08) == A and math.floor((i+1) * 0.1) == B:
            print(i+1)
            exit()
    print("-1")


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
import math
input = sys.stdin.readline


def main():
    A, B = map(int, input().split())
    for i in range(10000):
        if math.floor((i+1) * 0.08) == A and math.floor((i+1) * 0.1) == B:
            print(i+1)
            exit()
    print("-1")


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline


def main():
    S = input().strip()
    print("No") if S == "AAA" or S == "BBB" else print("Yes")


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

Fixed submission:
import sys
input = sys.stdin.readline


def main():
    N = int(input())
    print(N//2+1) if N % 2 else print(N//2)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline


def main():
    A = [list(map(int, input().split()))for _ in range(3)]
    N = int(input())
    B = [int(input()) for _ in range(N)]
    for bn in B:
        for i in range(len(A)):
            for j in range(len(A[i])):
                if bn == A[i][j]:
                    A[i][j] = 0
    for m in range(len(A)):
        if all(A[m][n] == 0 for n in range(len(A))):
            print("Yes")
            exit()
        if all(A[n][m] == 0 for n in range(len(A))):
            print("Yes")
            exit()
        if all(A[n][n] == 0 for n in range(len(A))):
            print("Yes")
            exit()
        if all(A[n][len(A)-n-1] == 0 for n in range(len(A))):
            print("Yes")
            exit()
    print("No")


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

Fixed submission:
k = input()
s = input()
i = 0
l = int(k)
p = str()
 
while i < l and len(s) > l:
    p = p + s[i]
    i = i + 1
while i < len(s) and len(s) <=l:
    p = p + s[i]
    i = i + 1
if len(s) > l:
	print(p + '...')
else:
	print(p)

Buggy submission (verdict: Runtime Error):
k = input()
s = input()
i = 0
l = int(k)
p = str()

while i < l:
    p = p + s[i]
    i = i + 1

if len(s) > l:
	print(p + '...')
else:
	print(p)

Buggy submission (verdict: Runtime Error):
k = input()
s = input()
i = 0
l = int(k)
p = str()

while i < l:
    p = p + s[i]
    i = i + 1

print(p)

Buggy submission (verdict: Runtime Error):
k = input()
s = input()
i = 0
l = int(k)
p = None

while i < l:
    p = p + s[i]
    i = i + 1

print(p)

Buggy submission (verdict: Runtime Error):
k = input()
s = input()
i = 0
l = int(k)

while i < l:
    p = p + s[i]
    i = i + 1

print(p)

Buggy submission (verdict: Runtime Error):
k = input()
s = input()
i = 0
list = []
l = int(k)

while i < l:
    list.append(s[i])
    i = i + 1

print(list)

Buggy submission (verdict: Runtime Error):
k = input()
s = input()
i = 0
l = int(k)

while i < l:
	print(s[i])
    i = i + 1

Buggy submission (verdict: Runtime Error):
k = input()
s = input()
i = 0

while i < int(k):
	print(s[i])
    i = i + 1

Buggy submission (verdict: Runtime Error):
k = input()
s = input()
i = 0

while i < 7:
	print(s[i])
    i = i + 1
Problem p02699 (python)

Fixed submission:
s, w = map(int, input().split())
if w >= s:
  print('unsafe')
else:
  print('safe')

Buggy submission (verdict: Runtime Error):
s = input()
count = 0
for i in range(len(s)+1):
    for j in range(i+1, len(s)+1):
        if (int(s[i:j])%3 == 0 and int(s[i:j])%673 == 0):
            count += 1
            #print("ok", s[i:j])
print(count)
Problem p02699 (python)

Fixed submission:
s, w = map(int, input().split())
if w >= s:
  print('unsafe')
else:
  print('safe')

Buggy submission (verdict: Runtime Error):
s, w = map(int, input().split())
if w > s:
  print('unsafe')
else:
  print('safe;)
Problem p02754 (python)

Fixed submission:
n, a, b = map(int, input().split())
c = n // (a + b) * a
d = n % (a + b)
if d > a:
  print(c+a)
else:
  print(c+d)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
if A ==0:
  print(0)
  exit()
s = ''
while len(s) < N:
  s = s + (A * 'b')
  s = s + (B * 'r')
print(s[:N].count('b'))
Problem p02711 (python)

Fixed submission:
N = str(input())
enc = 0

for char in list(N):
  if char == "7":
    enc += 1
    
if enc >= 1:
  print("Yes") 
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = str(input())
enc = 0

for char in list(N):
  if char == "7":
    enc +=1
    
if enc >= 1:
  return "Yes"
else:
  return "No"

Buggy submission (verdict: Runtime Error):
N = str(input())
enc = 0

for char in list(N):
  	if char == 7:
    	enc +=1

if enc >= 1:
  return Yes
else:
   return No
Problem p02835 (python)

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

if (a+b+c >= 22):
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
int a,b,c
if a+b+c >= 22:
  print bust
else:
  print win

Buggy submission (verdict: Runtime Error):
if(a+b+c >=22):
    print bust
else:
    print win
Problem p02847 (python)

Fixed submission:
s = input()
dic = {'SUN':7,
       'MON':6,
       'TUE':5,
       'WED':4,
       'THU':3,
       'FRI':2,
       'SAT':1}

print(dic[s])

Buggy submission (verdict: Runtime Error):
s = int(input())
f = input()
a = "ABCDEFGHIJKLNMOPQRSTUVWXYZ"
ans = ""
for i in f:
  ans += a[a.index(i)+s]

print(ans)

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

print(s**2)

Buggy submission (verdict: Runtime Error):
s = input()
dic = {SUN : 7,
       MON :6,
       TUE:5,
       WED:4,
       THU:3,
       FRI:2,
       SAT:1}

print(dic[s])

Buggy submission (verdict: Runtime Error):
s = input()
dic = {'SUN':7,
       'MON':6,
       'TUE':5,
       'WED':4,
       'THU':3,
       'FRI':2,
       'SAT':1
      }

print(s[dic])
Problem p02987 (python)

Fixed submission:
a = list(input())
a.sort()

if a[0] == a[1] and a[2]==a[3] and a[0]!=a[2]:
    print("Yes")

else:
    print("No")

Buggy submission (verdict: Runtime Error):
a = list(input())
a.sort()

if n[0] == n[1] and a[2]==a[3] and a[0]!=a[2]:
    print("Yes")

else:
    print("No")

Buggy submission (verdict: Runtime Error):
a = list(input())
a.sort()

if n[0] == n[1] and a[2]==a[3] and a[0]!==a[2]:
    print("Yes")

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

Fixed submission:
p,q,r = map(int,input().split())

if p+q <= p+r and p+q <= q+r:
    print(p+q)

elif q+r <= p+q and q+r <= p+r:
    print(q+r)

elif p+r <= p+q and p+r <= q+r:
    print(p+r)

Buggy submission (verdict: Runtime Error):
p,q,r = map(int,input().split())

if p+q >= p+r or p+q >= q+r:
    print(p+q)

elif q+r >= p+q and q+r >= p+r:
    print(q+r)

elif p+r >= p+q and p+e >= q+r:
    print(p+r)
Problem p02785 (python)

Fixed submission:
N,K = map(int, input().split())
H = list(map(int, input().split()))
 
H.sort(reverse=True)
 
if N <= K:
  print(0)
else:
  del H[0:K]
  print(sum(H))

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

H.sort(reverse=True)

if N <= K:
  print(0)
else:
  del l[0:K]
  print(sum(H))

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

H.sort(reverse=True)

if N <= K:
  print(0)
else:
  for i in range(K):
    H.pop(i)
  print(sum(H))
Problem p02819 (python)

Fixed submission:
import math
 
def is_prime(n):
    for i in range(2, int(math.sqrt(n))+1):
        if n % i == 0:
            return False
    return True
 
def main():
    X = int(input())
    while True:
        result = is_prime(X)
        if result:
            print(X)
            exit()
        X +=1
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from sympy import sieve

X=int(input())

PL=[i for i in sieve.primerange(1, 10**5+1)]

PL.append(X)
PL.sorted()

ID=PL.index(X)

print(ID+1)