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

Fixed submission:
#G
N,M=map(int,input().split())
A=[[] for i in range(N+1)]
B=[0 for i in range(N+1)]
dp=[0 for j in range(N+1)]

for i in range(M):
    x,y=map(int,input().split())
    A[x].append(y)
    B[y]+=1

st=[]
for i in range(1,N+1):
    if B[i]==0:
        st.append(i)
        dp[i]

while len(st):
    x=st.pop()
    for y in A[x]:
        dp[y]=max(dp[y],dp[x]+1)
        B[y]-=1
        if B[y]==0:
            st.append(y)
print(max(dp))

Buggy submission (verdict: Runtime Error):
#G
N,M=map(int,input().split())
A=[[] for i in range(N+1)]
dp=[[] for j in range(N)]

for i in range(M):
    x,y=map(int,input().split())
    A[x].append(y)
    dp[1]=dp[1]+[y]

flag=False
for i in range(2,N):
    for x in dp[i-1]:
        dp[i]=dp[i]+A[x]
            
        if dp[i]==[]:
            flag=True
            result=i
            break
    if flag:
        break

print(result)

Buggy submission (verdict: Runtime Error):
#G
N,M=map(int,input().split())
A=[[] for i in range(N+1)]
dp=[[] for j in range(N)]

for i in range(M):
    x,y=map(int,input().split())
    A[x].append(y)
    dp[1]=dp[1]+[y]

flag=False
for i in range(2,N):
    for x in dp[i-1]:
        for y in A[x]:
            dp[i]=dp[i]+[y]
            
        if dp[i]==[]:
            flag=True
            result=i
            break
    if flag:
        break

print(result)
Problem p02705 (python)

Fixed submission:
import math
r=int(input())
print(r*2*math.pi)

Buggy submission (verdict: Runtime Error):
import math
r=int(input())
print(r*2*math.pai)
Problem p02789 (python)

Fixed submission:
N,M=map(int,input().split())
if N==M:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
  N,M=map(int,input().split())
  if N==M:
    print("Yes")
  else:
    print("No")
Problem p02811 (python)

Fixed submission:
K,M=map(int,input().split())
if K*500>=M:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
K,M=mao(int,input().split())
if K*500>=M:
  print("Yes")
else:
  print("No")
Problem p02814 (python)

Fixed submission:
import sys
N,M=map(int,input().split())
A = list( map(int,input().split()) )
for i in range(N): A[i] = A[i]//2


def GCD(a,b):
    if a % b == 0:
        return b
    return GCD( b, a%b )

# 全Aが2で割り切れる数が等しいか確認
cnt = 1
while A[0]%(1<<cnt) == 0 :
    cnt += 1
for i in range(1,N):
    if (A[i]%(1<<cnt) == 0) or (A[i]%(1<<(cnt-1)) != 0):
        print(0)
        sys.exit()

A.append(1)
a = A[0]
b = A[1]
lcm = a * b // GCD(a,b)
#print(lcm)
if lcm > M:
    print(0)
    sys.exit()
for i in range(2,N):
    a = lcm
    b = A[i]
    lcm = a * b // GCD(a,b)
    if lcm > M:
        print(0)
        sys.exit()
print( (M+lcm) // (lcm*2) )

Buggy submission (verdict: Runtime Error):
import sys
N,M=map(int,input().split())
A = list( map(int,input().split()) )
for i in range(N): A[i] = A[i]//2


def GCD(a,b):
    if a % b == 0:
        return b
    return GCD( b, a%b )

# 全Aが2で和切れる数が等しいか確認
cnt = 1
while A[0]%(1<<cnt) == 0 :
    cnt += 1
for i in range(1,N):
    if (A[i]%(1<<cnt) == 0) or (A[i]%(1<<(cnt-1)) != 0):
        print(0)
        sys.exit()

a = A[0]
b = A[1]
A.append(1)
lcm = a * b // GCD(a,b)
#print(lcm)
if lcm > M:
    print(0)
    sys.exit()
for i in range(2,N):
    a = lcm
    b = A[i]
    lcm = a * b // GCD(a,b)
    if lcm > M:
        print(0)
        sys.exit()
print( (M+lcm+1) // (lcm*2) )
Problem p03102 (python)

Fixed submission:
N,M,C=map(int,input().split())
B=list(map(int,input().split()))
ans = 0
for i in range(N):
  A = list(map(int,input().split()))
  tmp = C
  for j in range(M):
    tmp += A[j]*B[j]
  if tmp > 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N,M,C=map(int.input().split())
B=list(map(int.input().split()))
ans = 0
for i in range(N):
  A = list(map(int.input().split()))
  tmp = C
  for j in range(M):
    tmp += A[j]*B[j]
  if tmp > 0:
    ans += 1
print(ans)
Problem p03110 (python)

Fixed submission:
CV = 380000.0
N=int(input())
total = 0
for i in range(N):
  x,u = input().split()
  x = float(x)
  if u == "BTC":
    x *= CV
  total += x
print(total)

Buggy submission (verdict: Runtime Error):
CV = 380000.0
N=int(input())
total = 0
for i in range(N):
  x,u = input().split()
  x = int(x)
  if u == "BTC":
    x *= CV
  total += x
print(total)
Problem p03126 (python)

Fixed submission:
N,M=map(int,input().split())
c= [ 0 for _ in range(M)]
for i in range(N):
  A = list(map(int, input().split()))
  for j in range(A[0]):
    c[A[j+1]-1]+=1
ans=0
for i in range(M):
  if c[i] == N:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
m= [ 0 for in range(M)]
for i in range(N):
  A = list(map(int, input().split()))
  for j in range(A[0]):
    m[A[j+1]-1]+=1
ans=0
for i in range(M):
  if m[i] == N:
    ans += 1
print(ans)
Problem p03210 (python)

Fixed submission:
x=int(input())
if x == 3 or x == 5 or x == 7:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
x=int(input())
if x == 3 or x == 5 x == 7:
  print("YES")
else:
  print("NO")
Problem p03220 (python)

Fixed submission:
N=int(input())
T,A=map(int, input().split())
H=list(map(int, input().split()))
tmin = 10000000
for i in range(N):
  if tmin > abs(A - (T - H[i] * 0.006)):
    ans = i+1
    tmin = abs(A - (T - H[i] * 0.006))
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
T,A=map(int, input().split())
H=list(map(int, input().split()))
tmin = 10000000
for i in range(N):
  if tmin < abs(T - H[i] * 0.006):
    ans = i+1
    tmin = abs(T - H[i] * 0.006)
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
T,A=map(int, input().split())
H=list(map(int, input().split()))
tmin = 10000000
for i in range(N):
  if tmin < (T - H[i] * 0.006):
    ans = i+1
    tmin = T - H[i] * 0.006
print(ans)
Problem p03238 (python)

Fixed submission:
N=int(input())
if N==1:
  print("Hello World")
else:
  A=int(input())
  B=int(input())
  print(A+B)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=int(input())
B=int(input())
if N==1:
  print("Hello World")
else:
  print(A+B)
Problem p03284 (python)

Fixed submission:
N,K=map(int,input().split())
if N%K==0:
  print(0)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input())
if N%K==0:
  print(0)
else:
  print(1)
Problem p03292 (python)

Fixed submission:
A,B,C=map(int, input().split())
d = [0,0,0]
d[0] = abs(A-B)
d[1] = abs(A-C)
d[2] = abs(C-B)
d.sort()
print(d[0]+d[1])

Buggy submission (verdict: Runtime Error):
A,B,C=map(int, input().split())
d = [0 0 0]
d[0] = abs(A-B)
d[1] = abs(A-C)
d[2] = abs(C-B)
d.sort()
print(d[0]+d[1])
Problem p03309 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
for i in range(N):
  A[i] = A[i] - i - 1
A.sort()
b = A[N//2]
ans = 0
for i in range(N):
  ans += abs(A[i] - b)
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
for i in range(N):
  A[i] = A[i] - i - 1
print( A.sum() // N )
Problem p03354 (python)

Fixed submission:
N,M=map(int,input().split())
p = list(map(int,input().split()))
for i in range(N): p[i] -= 1

par = [ i for i in range(N)]

def uf_root(a):
  if par[a] == a: return a
  par[a] = uf_root( par[a] )
  return par[a]

def uf_same(a,b):
  if (uf_root(a) ==uf_root(b)): return True

def uf_union(a,b):
  if (uf_same(a,b)): return
  a = uf_root(a)
  b = uf_root(b)
  par[a] = b
  return

for i in range(M):
  x,y = map(int, input().split())
  x -= 1
  y -= 1
  uf_union(x,y)

ans = 0
for i in range(N):
  if ( uf_same(i,p[i]) ):
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
p = list(map(int,input().split()))
for i in range(N): p[i] -= 1

par = [ i for i in range(N)]

def uf_root(a):
  if par[a] == a: return a
  par[a] = uf_root( par[a] )
  return par[a]

def uf_same(a,b):
  if (uf_root(a) ==uf_root(b)): return True
  return false

def uf_union(a,b):
  if (uf_same(a,b)): return
  a = uf_root(a)
  b = uf_root(b)
  par[a] = b
  return

for i in range(M):
  x,y = map(int, input().split())
  x -= 1
  y -= 1
  uf_union(x,y)

ans = 0
for i in range(N):
  if ( uf_same(i,p[i]) ):
    ans += 1
print(ans)
Problem p03360 (python)

Fixed submission:
a,b,c=map(int, input().split())
K=int(input())
ans = a+b+c
m = max(a, max(b,c))
ans += (pow(2,K)-1) * m
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int, input().split())
ans = a+b+c
m = max(a, max(b,c))
ans += (pow(2,K)-1) * m
print(ans)
Problem p03361 (python)

Fixed submission:
H,W=map(int, input().split())
s = []
dx = [  0, 0, 1, -1]
dy = [ -1, 1, 0, 0]
ans = "Yes"
for i in range(H):
  s.append( input())
for y in range(H):
  for x in range(W):
    if s[y][x] == '#':
      ng = 1
      for i in range(4):
        nx = x + dx[i]
        ny = y + dy[i]
        if (ny < 0) or (ny >= H) or (nx<0) or (nx>=W):
          continue
        if s[ny][nx] == '#':
          ng = 0
      if ng == 1:
        ans = "No"
print(ans)

Buggy submission (verdict: Runtime Error):
H,W=map(int, input().split())
s = []
dx = [ -1, -1, 1, 1]
dy = [ -1, 1, -1, 1]
ans = "Yes"
for i in range(H):
  s.append( input())
for y in range(H):
  for x in range(W):
    if s[y][x] == '#':
      ng = 1
      for i in range(4):
        nx = x + dx[i]
        ny = y + dy[i]
        if (ny < 0) or (ny >= H) or (nx<0) or (nx>=W):
          continue
        if s[ny][nx] == '#':
          ng = 0
    if ng == 1:
      ans = "No"
print(ans)
Problem p03380 (python)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
ma = max(A)
mid = ma / 2
l = 10000000000
f = 0
for i in range(n):
  if ((ma == A[i]) and (f==0)):
    f = 1
    continue
  if abs(l) > abs(A[i]-mid):
    l = A[i]-mid
print(ma, int(mid+l))

Buggy submission (verdict: Runtime Error):
n=int(input())
A=list(map(int,input().split()))
ma = max(A)
mid = ma / 2
l = 10000000000
for i in rage(n):
  l = min(l, abs(A[i]-mid))
print(ma, mid-l)
Problem p03434 (python)

Fixed submission:
N=int(input())
A=list(map(int, input().split()))
A.sort(reverse=True)
ans = 0
for i in range(N):
  if i%2==0:
    ans += A[i]
  else:
    ans -= A[i]
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int, input()))
A.sort(reverse=True)
ans = 0
for i in range(N):
  if i%2==0:
    ans += A[i]
  else:
    ans -= A[i]
print(ans)
Problem p03449 (python)

Fixed submission:
N=int(input())
A0 = list(map(int, input().split()))
A1 = list(map(int, input().split()))
ans = 0
for i in range(N-1):
  A0[i+1] += A0[i]
for i in range(N-1,0,-1):
  A1[i-1] += A1[i]
for i in range(N):
  ans = max(ans, A0[i] + A1[i])
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A0 = list(map(int, input().split()))
A1 = list(map(int, input().split()))
ans = 0
for i in range(N-1):
  A0[i+1] += A[i]
for i in range(N-1,0,-1):
  A1[i-1] += A[i]
for i in range(N):
  ans = max(ans, A0[i] + A1[i])
print(ans)
Problem p03474 (python)

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

ng = 0
if not (s[0:A].isdecimal()):
  ng = 1
if s[A] != "-": ng = 1
if not (s[A+1:A+B+1].isdecimal()):
  ng = 1
if ng == 1:
  print("No")
else:
  print("Yes")

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

ng = 0
if !(s[0:A].isdecimal()):
  ng = 1
if s[A] != "-": ng = 1
if !(s[A+1:A+B+1].isdecimal()):
  ng = 1
if ng == 1:
  print("No")
else:
  print("Yes")
Problem p02761 (python)

Fixed submission:
N, M=map(int,input().split())
s=list()
c=list()
a=0
for i in range(0,M):
    s.append(0)
    c.append(0)
for i in range(0,M):
    s[i], c[i]=map(int,input().split())
for i in range(0,M):
    for j in range(0,M):
        if s[i]==s[j] and c[i]!=c[j]:
            print("-1")
            break
    else:
        continue
    break
else:
    if N==1:
        b=[0]
        for i in range(0,M):
            b[s[i]-1]=c[i]
        print(b[0])
    else:
        b=[1]
        for i in range(0,N-1):
            b.append(0)
        for i in range(0,M):
            if s[i]==1 and c[i]==0:
                print("-1")
                break
        else:
            for i in range(0,M):
                b[s[i]-1]=c[i]
            for i in range(0,N):
                print(b[i],end='')

Buggy submission (verdict: Runtime Error):
N, M=map(int,input().split())
s=list()
c=list()
a=0
for i in range(0,M):
    s.append(0)
    c.append(0)
for i in range(0,M):
    s[i], c[i]=map(int,input().split())
for i in range(0,M):
    for j in range(0,M):
        if s[i]==s[j] and c[i]!=c[j]:
            print("-1")
            break
    else:
        continue
    break
else:
    if N==1:
        b=[0]
        for i in range(0,M):
            b[s[i]-1]=c[i]
        print(b[0])
    else:
        b=[1]
        for i in range(0,N-1):
            b.append(0)
        if s[i]==1 and c[i]==0:
            print("-1")
        else:
            for i in range(0,M):
                b[s[i]-1]=c[i]
            for i in range(0,N):
                print(b[i],end='')
Problem p02801 (python)

Fixed submission:
s=input()
print(chr(ord(s)+1))

Buggy submission (verdict: Runtime Error):
s=input()
x = chr(ord(ch) + 1)
print(x)
Problem p02885 (python)

Fixed submission:
a,b=map(lambda x:int(x),input().split())
print(max([0,a-b*2]))

Buggy submission (verdict: Runtime Error):
a,b = map(lambda x : int(x), input().split())
print(max(a - b * 2),0)
Problem p02886 (python)

Fixed submission:
n=int(input())
d=[int(di) for di in input().split()]
print(sum(d[i]*d[j] for i in range(n) for j in range(i+1,n)))

Buggy submission (verdict: Runtime Error):
n=int(input())
d=[int(di) for di in int(input()).split()]
print(sum(d[i]*d[j] for i in range(n) for j in range(i+1,n)))
Problem p04043 (python)

Fixed submission:
a = [int(x) for x in input().split()]
countF = 0
countS = 0
for i in range(3):
    countF += a[i] == 5
    countS += a[i] == 7
if countF == 2 and countS == 1:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())
s = []
for _ in range(n):
    s.append(input())
s = sorted(s)
print(''.join(s))
Problem p02614 (python)

Fixed submission:
import itertools
import numpy as np

h, w, k = map(int, input().split())
c = [input() for _ in range(h)]

count = 0
for ph in itertools.product([0, 1], repeat=h):
    for pw in itertools.product([0, 1], repeat=w):
        squares = np.array([[1 if cell == '#' else -1 for cell in row] for row in c])
        squares[np.array(ph) == True, :] *= 0
        squares[:, np.array(pw) == True] *= 0
        if np.count_nonzero(squares == 1) == k:
            count += 1

print(count)

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

count = 0
for binh in range(2**h):
    for binw in range(2**w):
        redh, redw = bin(binh)[2:], bin(binw)[2:]  # remove suffix '0x'
        squares = [list(row) for row in c]
        for rh in redh:
            for wh in range(w):
                squares[rh][wh] = '*'
        for rw in redw:
            for hw in range(h):
                squares[rw][hw] = '*'
        count += sum(row.count('#') for row in squares) == k

print(k)

Buggy submission (verdict: Runtime Error):
from python.c import squares


h, w, k = map(int, input().split())
c = [input() for _ in range(h)]

count = 0
for binh in range(2**h):
    for binw in range(2**w):
        redh, redw = bin(binh)[2:], bin(binw)[2:]  # remove suffix '0x'
        squares = [list(row) for row in c]
        for rh in redh:
            for wh in range(w):
                squares[rh][wh] = '*'
        for rw in redw:
            for hw in range(h):
                squares[rw][hw] = '*'
        count += sum(row.count('#') for row in squares) == k

print(k)
Problem p02787 (python)

Fixed submission:
import numpy as np

h, n = map(int, input().split())
ab = np.array([tuple(map(int, input().split())) for _ in range(n)])

a, b = ab[:, 0], ab[:, 1]
dp = np.zeros(h+1, dtype=np.int)
for i in range(1, h+1):
    dp[i] = np.min(dp[np.maximum(i-a, 0)] + b)

print(dp[h])

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

h, n = map(int, input().split())
ab = np.array([tuple(map(int, input().split())) for _ in range(n)])

a, b = ab[:, 0], ab[:, 1]
dp = np.zeros(h+1, dtype=int)
for i in range(1, h+1):
    dp[i] = np.min(dp[i-a] + b)

print(dp[-1])

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

h, n = map(int, input().split())
ab = np.array([tuple(map(int, input().split())) for _ in range(n)])

a, b = ab[:, 0], ab[:, 1]
dp = np.zeros(h+1, dtype=int)
for i in range(1, h+1):
    dp[i] = np.min(np.maximum(dp[i-a], 0) + b)

print(dp[h])

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

h, n = map(int, input().split())
ab = np.array([tuple(map(int, input().split())) for _ in range(n)])

a, b = ab[:, 0], ab[:, 1]
dp = np.zeros(2*h, dtype=int)
for i in range(1, h+1):
    dp[i] = np.min(dp[i-a] + b)

print(dp[h])

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

h, n = map(int, input().split())
a, b = zip(*[tuple(map(int, input().split())) for _ in range(n)])

npa, npb = np.array(a), np.array(b)
dp = np.zeros(h+1)
for i in range(1, h+1):
    dp[i] = np.min(dp[i-npa] + npb)

print(int(dp[h]))

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

h, n = map(int, input().split())
ab = list(tuple(map(int, input().split())) for _ in range(n))

sa, sb = 0, 0
for _, a, b in sorted((a/b, a, b) for a, b in ab, reversed=True):
    sa += a
    sb += b
    if sa >= h:
        print(sb)
        break
Problem p02843 (python)

Fixed submission:
import sys

x = input()

if len(x) < 3:
    print(0)
    sys.exit()

prefix = int(x[:-2])
suffix = int(x[-2:])

n = 0
for item in range(5, 0, -1):
    n += suffix // item
    suffix %= item

print(0 if n>prefix else 1)

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

prefix = int(x[:-2])
suffix = int(x[-2:])

n = 0
for item in range(5, 0, -1):
    n += suffix // item
    suffix %= item

print(0 if n>prefix else 1)
Problem p02888 (python)

Fixed submission:
import bisect

n = int(input())
l = sorted([int(li) for li in input().split()])

sum = 0
for i in range(n-1,-1,-1):
    for j in range(i-1,-1,-1):
        k = bisect.bisect_right(l,l[i]-l[j])
        sum += j-k if j>k else 0

print(sum)

Buggy submission (verdict: Runtime Error):
import bisect

n = int(input())
l = sorted([int(li) for li in input().split()])

sum = 0
for i in range(n-1,-1,-1):
    for j in range(i-1,-1,-1):
        k = bisect.bisect_right(l[j],l[i]-l[j])
        sum += j-k if j>k else 0

print(sum)
Problem p02900 (python)

Fixed submission:
def divisors(n):
    divs = set()
    for i in range(1,int(n**0.5)+1):
        if n % i == 0:
            divs |= {i, n//i}
    return sorted(divs)

def gcd(n,m):
    if m == 0:
        return n
    else:
        return gcd(m, n%m)

def is_disjoint(n,m):
    return gcd(n,m) == 1

def appendable(list, n):
    return all(is_disjoint(l, n) for l in list)

#O(n**2)!
def filter_disjoint(divisors):
    list = []
    for d in divisors:
        if appendable(list, d):
            list.append(d) 
    return list


a,b = list(map(int, input().split()))

filterd = filter_disjoint(divisors(gcd(a,b)))
print(len(filterd))

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

def divisors(n):
    divs = set()
    for i in range(1,int(n**0.5)+1):
        if n % i == 0:
            divs |= {i, n//i}
    return sorted(divs)

def is_disjoint(n,m):
    return np.gcd(n,m) == 1

def appendable(list, n):
    return all(is_disjoint(l, n) for l in list)

#O(n**2)!
def filter_disjoint(divisors):
    list = []
    for d in divisors:
        if appendable(list, d):
            list.append(d) 
    return list


a,b = list(map(int, input().split()))

filterd = filter_disjoint(divisors(np.gcd(a,b)))
print(len(filterd))

Buggy submission (verdict: Runtime Error):
import math

def divisors(n):
    divs = set()
    for i in range(1,int(n**0.5)+1):
        if n % i == 0:
            divs |= {i, n//i}
    return sorted(divs)

def is_disjoint(n,m):
    return math.gcd(n,m) == 1

def appendable(list, n):
    return all(is_disjoint(l, n) for l in list)

#O(n**2)!
def filter_disjoint(divisors):
    list = []
    for d in divisors:
        if appendable(list, d):
            list.append(d) 
    return list


a,b = list(map(int, input().split()))

filterd = filter_disjoint(divisors(math.gcd(a,b)))
print(len(filterd))
Problem p02628 (python)

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

p = list(map(int, input().split()))

sortp = sorted(p)
sum=0
for k in range(K):
    sum=sum+sortp[k]

print(sum)

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

p = list(map(int, input().split()))

sortp = sorted(p)

sum = sortp[0]+sortp[1]+sortp[2]

print(sum)
Problem p02641 (python)

Fixed submission:
X,N = map(int, input().split())
P = list(map(int, input().split()))
sortP = sorted(P)
if N==0:
    print(X)
elif sortP[0]>X:
    print(X)
elif sortP[N-1]<X:
    print(X)
else:
    for n in range(sortP[0]-2,sortP[N-1]+2):
        if n in sortP:
            continue
        if n ==X:
            print(X)
            break
        elif n>X:
            if X-a<=n-X:
                print(a)
                break
            else:
                print(n)
                break
        a = n

Buggy submission (verdict: Runtime Error):
X,N = map(int, input().split())
P = list(map(int, input().split()))
sortP = sorted(P)
if N==0:
    print(X)
elif sortP[0]>X:
    print(sortP[0]-1)
elif sortP[N-1]<X:
    print(sortP[N-1]+1)
else:
    for n in range(sortP[0],sortP[N-1]+2):
        if n in sortP:
            continue
        if n ==X:
            print(X)
        elif n>X:
            if X-a<=n-X:
                print(a)
                break
            else:
                print(n)
                break
        a = n
Problem p02705 (python)

Fixed submission:
import math
R = int(input())

l = 2 * R * math.pi

print(l)

Buggy submission (verdict: Runtime Error):
    import math
    R = int(input())
     
    l = 2 * R * math.pi
     
    print(l)