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

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
inf=float("inf")
dp=[(inf) for i in range(n)]
dp[0]=0

for i in range(1,n):
    if i==1:
        dp[i]=dp[i-1]+abs(h[i]-h[i-1])
    else:
        dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]))
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
def main():
  n,k=map(int,input().split())
  h=list(map(int,input().split()))+[0]*(k+10)
  dp=[(10**5) for i in range(n+k+10)]
  dp[0]=0
  for i in range(n-1):
    for j in range(k):
      dp[i+j+1]=min(dp[i]+abs(h[i]-h[i+j+1]),dp[i+j+1])
  print(dp[n-1])
main()

Buggy submission (verdict: Runtime Error):
int(input())
h=list(map(int,input().split()))
inf=float("inf")
dp=[(inf) for i in range(n)]
dp[0]=0

for i in range(1,n):
    if i==1:
        dp[i]=dp[i-1]+abs(h[i]-h[i-1])
    else:
        dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]))
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
int(input())
h=list(map(int,input().split()))
inf=float("inf")
dp=[(inf) for i in range(n)]
dp[0]=0

for i in range(1,n):
    if i==1:
        dp[i]=dp[i-1]+abs(h[i]-h[i-1])
    else:
        dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]))
print(dp[n-1])
Problem p03161 (python)

Fixed submission:
def main():
  n,k=map(int,input().split())
  h=list(map(int,input().split()))+[0]*(k+10)
  dp=[(float("inf")) for i in range(n+k+10)]
  dp[0]=0
  for i in range(n-1):
    for j in range(k):
      dp[i+j+1]=min(dp[i]+abs(h[i]-h[i+j+1]),dp[i+j+1])
  return (dp[n-1])
print(main())

Buggy submission (verdict: Runtime Error):
import numpy as np
def main():
  n,k=map(int,input().split())
  h=np.(list(map(int,input().split()))+[0]*(k+10))
  dp=[(float("inf")) for i in range(n+k+10)]
  dp[0]=0
  dp=np.dp
  for i in range(n-1):
    for j in range(k):
      np.dp[i+j+1]=min(np.dp[i]+abs(np.h[i]-np.h[i+j+1]),np.dp[i+j+1])
  return (np.dp[n-1])
print(main())

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))+[0]*(k+10)
dp=[(float("inf")) for i in range(n+k+10)]
dp[0]=0
def main():
  	for i in range(n-1):
    	for j in range(k):
      		dp[i+j+1]=min(dp[i]+abs(h[i]-h[i+j+1]),dp[i+j+1])
  print(dp[n-1])
main()

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))+[0]*(k+10)
dp=[(float("inf")) for i in range(n+k+10)]
dp[0]=0
def main():
  	for i in range(n-1):
      	for j in range(k):
          	dp[i+j+1]=min(dp[i]+abs(h[i]-h[i+j+1]),dp[i+j+1])
  	print(dp[n-1])
main()
Problem p03210 (python)

Fixed submission:
x=int(input())
iwai=[7,5,3]

if x in iwai:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
    print("NO")
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):
com=int(input())
if com==1:
  print("Hello World")
else:
  a,b=map(int,input().split())
  print(a+b)
Problem p03239 (python)

Fixed submission:
n,T=map(int,input().split())
clist,tlist=[],[]
for i in range(n):
  c,t=map(int,input().split())
  clist.append(c)
  tlist.append(t)

ans=10100
flag=False
for d,e in zip(clist,tlist):
  if e<=T:
    ans=min(ans,d)
    flag=True
if flag == False:
  print("TLE")
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
n,T=map(int,input().split())
clist,tlist=[],[]
for i in range(n):
  c,t=map(int,input().split())
  clist.append(c)
  tlist.append(t)

ans=10100
flag=False
for d,e in zip(c,t):
  if e<=T:
    ans=min(ans,d)
    flag=True
if flag == False:
  print("TLE")
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
n,T=map(int,input().split())
clist,tlist=[],[]
for i in range(n):
  c,t=map(input().split())
  clist.append(c)
  tlist.append(t)

ans=10100
flag=False
for d,e in zip(c,t):
  if e<=T:
    ans=min(ans,d)
    flag=True
if flag == False:
  print("TLE")
else:
  print(ans)
Problem p03282 (python)

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

for i in s:
  if i == "1":
    k-=1
  else:
    print(i)
    exit()
  if k == 0:
    print(i)
    exit()

Buggy submission (verdict: Runtime Error):
s=input()
k=input();k=int(k)
l=min(len(s),k)
for i in range(l+1):
  if s[i] == "1":
    tmp=1
  else:
    tmp=int(s[i])
    break
print(tmp)

Buggy submission (verdict: Runtime Error):
s=input()
k=input();k=int(k)
l=min(len(s),k)
for i in range(l+1):
  if s[i] == "1":
    pass
  else:
    tmp=s[i]
    break
print(tmp)
Problem p03311 (python)

Fixed submission:
import statistics
n,*a=map(int,open(0).read().split())
b=[q-i for i,q in enumerate(a,1)]
c=statistics.median(b)
ans=sum(map(abs,[p-c for p in b]))
print(int(ans))

Buggy submission (verdict: Runtime Error):
n,*a=map(int,open(0).read().split())
b=[q-i for i,q in enumerate(a,1)]
b.sort()

c=b[(n+1)//2]+b[::-1][(n+1)//2]
c//=2

ans=float("inf")
for i in range(-10+c,11+c):
  tmp=sum(map(abs,[q-i for q in b]))
  ans=min(ans,tmp)
print(ans)
Problem p03337 (python)

Fixed submission:
a,b=map(int,input().split())
c=a+b
d=a-b
e=a*b
ans=max(c,d,e)
print(ans)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print(max(a+b,a-b,a*b))
Problem p03351 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
AB=abs(a-b)
BC=abs(b-c)
AC=abs(a-c)

if AC<=d or (AC>d and AB<=d and BC<=d):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
AB=abs(a-b)
BC=abs(b-c)
AC=abs(a-c)

if AC=<d or (AC>d and AB<d and BC<d):
  print("Yes")
else:
  print("No")
Problem p03361 (python)

Fixed submission:
h,w=map(int,input().split())
lll=[list("."*(w+2))]
G=[list("."+input()+".") for _ in range(h)]
G=lll+G+lll
#print(G)
for i in range(1,h+1):
  for j in range(1,w+1):
    if G[i][j]=="#" and G[i-1][j]==G[i+1][j]==G[i][j-1]==G[i][j+1]==".":
      print("No")
      exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
lll=[list("."*(w+2))]
G=[list("."+input()+".") for _ in range(h)]
G=lll+G+lll
print(G)
for i in range(1,w+1):
  for j in range(1,h+1):
    if G[i][j]=="#" and G[i-1][j]==G[i+1][j]==G[i][j-1]==G[i][j+1]==".":
      print("No")
      exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
lll=["."*(w+2)]
G=[list("."+input()+".") for _ in range(h)]
G=lll+G+lll
for i in range(1,w+1):
  for j in range(1,h+1):
    if G[i][j]=="#" and G[i-1][j]==G[i+1][j]==G[i][j-1]==G[i][j+1]==".":
      print("No")
      exit()
print("Yes")
Problem p03379 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
p,q=b[n//2-1:n//2+1]
for i in a:print(p if i>=q else q)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
p,q=b[n//2-1],b[n//2+1]
for i in a:print(p if i>=q else q)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
p,q=sorted(a)[n//2-1:n//2+1]
for i in a:print(p if a>=q else q)
Problem p03425 (python)

Fixed submission:
m=0
a=0
r=0
c=0
h=0
n=int(input())
for i in range(n):
  s=input()
  if s[0]=="M":m+=1
  elif s[0]=="A":a+=1
  elif s[0]=="R":r+=1
  elif s[0]=="C":c+=1
  elif s[0]=="H":h+=1
  else:pass

li=[m,a,r,c,h]
ans=0
for ai in range(5):
  for bi in range(5):
    for ci in range(5):
      if ci>bi>ai:
        ans+=li[ai]*li[bi]*li[ci]
print(ans)

Buggy submission (verdict: Runtime Error):
m=0
a=0
r=0
c=0
h=0
n=int(input())
for i in range(n):
  s=input()
  if s[0]=="M":m+=1
  elif s[0]=="A":a+=1
  elif s[0]=="R":r+=1
  elif s[0]=="C":c+=1
  elif s[0]=="H":h+=1
  else:pass

li=[m,a,r,c,h]
ans=0
for ai in range(n):
  for bi in range(n):
    for ci in range(n):
      if ci>bi>ai:
        ans+=li[ai]*li[bi]*li[ci]
print(ans)
Problem p03476 (python)

Fixed submission:
from functools import lru_cache
@lru_cache(maxsize=None)
def is_prime(x):
    if x==1:
        return False
    for i in range(2,int(x**0.5)+1):
        if x%i==0:
            return False
    return True

# @lru_cache(maxsize=None)
def like2017(x):
    return is_prime(i) and is_prime((i+1)//2)
    
table=[0,0]
for i in range(2,10**5):
    table+=table[i-1]+like2017(i),
        
n=int(input())
for _ in range(n):
    a,b=map(int,input().split())
    print(table[b]-table[a-1])
# print(table)

Buggy submission (verdict: Runtime Error):
import numpy as np
def isprime(x):
  if x==1:
    return False
  if x==2:
    return True
  for i in range(2,int(x**0.5)+1):
    if x%i==0:
      return False
  return True

def like2017(x):
  return (isprime(x) and isprime((x+1)//2))


a=[like2017(i) for i in range(10**5+1)]

a_cum=np.cumsum(a)

q=int(input())
for i in range(q):
  l,r=map(int,input().split())
  print(a_cum[r]-a_cum[l-1])

Buggy submission (verdict: Runtime Error):
import numpy as np
def isprime(x):
  if x==1:
    return False
  if x==2:
    return True
  for i in range(2,int(x**0.5)+1):
    if x%i==0:
      return False
  return True

def like2017(x):
  return (isprime(x) and isprime((x+1)//2))


a=[like2017(i) for i in range(10**5+1)]

a_cum=np.cumsum(a)

q=int(input())
for i in range(q):
  l,r=map(int,input().split())
  print(a_cum[r]-a_cum[l-1])
Problem p03501 (python)

Fixed submission:
n,a,b=map(int,input().split())
print(min(a*n,b))

Buggy submission (verdict: Runtime Error):
n,a,t=map(int,input().split())
print(min(a*n,b))

Buggy submission (verdict: Runtime Error):
n,a,t=map(int,input().split())
print(min(a*t,b))
Problem p03645 (python)

Fixed submission:
n,m=map(int,input().split())
c=[]
d=[]
for i in range(m):
  a,b=map(int,input().split())
  if a==1:
    c.append(b)
  if b==n:
    d.append(a)
#O(m)
if len(set(c)&set(d))!=0:
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ab=[]
for i in range(m):
  a,b=map(int,input().split())
  ab.append((a,b))
#print(ab)
     
mid=[]
for (i,j) in ab:
  if i==1:
    mid.append(j)

for (i,j) in ab:
  if i in mi and j==n:
    print("POSSIBLE");exit()
    
print("IMPOSSIBLE")
Problem p03695 (python)

Fixed submission:
li=[0]*8
o=0
n,*a=map(int,open(0).read().split())
for i in a:
  if i>=3200:
    o+=1  
  else:
    li[i//400]=1

#全員3200以上==(sum(li)==0)> 1,min(o,8)
#全員3200未満==(o==0)> sum(li),min(sum(li)+o,8)
#それ以外>sum(li)
if sum(li)==0:
  print(1,min(o,8))
else:
  print(sum(li),(sum(li)+o))

Buggy submission (verdict: Runtime Error):
li=[0]*8
o=0
n,*a=map(int,open(0).read().split())
for i in a:
  if i>=3200:
    o+=1  
  else:
    li[i//400]=1

#全員3200以上==(sum(li)==0)> 1,min(o,8)
#全員3200未満==(o==0)> sum(li),min(sum(li)+o,8)
#それ以外>sum(li)
if sum(li)==0:
  print(1,min(o,8))
else:
  print(sum(li),min(sum(li)+o,8)

Buggy submission (verdict: Runtime Error):
n,*a=map(int,open(0).read().split())
""" 
1 399：灰色 
400 799：茶色
800 1199：緑色
1200 1599：水色 
1600 1999：青色 
2000 2399：黄色 
2400 2799：橙色
2800 3199：赤色
"""
if n=1:
  print(1,1)
  exit()

li=[False]*8
over3200=0
for i in a:
  if i>=3200:
    over3200+=1
  else:
    li[(i//400)]=True
    
k=sum(li)
print(k,k+over3200)
Problem p03711 (python)

Fixed submission:
a={1,3,5,7,8,10,12}
b={4,6,9,11}
c={2}
xy=set(map(int,input().split()))
if xy.issubset(a) or xy.issubset(b) or xy.issubset(c):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a={1,3,5,7,8,10,12}
b={4,6,9,11}
c={2}
xy=map(set,input().split())
if xy.issubset(a) or xy.issubset(b) or xy.issubset(c):
  print("No")
else:
  print("Yes")
Problem p02658 (python)

Fixed submission:
import sys, io, os, re
import bisect
from pprint import pprint
from math import sin, cos, pi, radians, sqrt
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce

def array1(n): return [0] * n
def array2(n, m): return [[0] * m for x in range(n)]
def array3(n, m, l): return [[[0] * l for y in xrange(m)] for x in xrange(n)]

a = sys.stdin.readline().strip()
arr = list(map(int, sys.stdin.readline().strip().split()))
mod = 10**18

ans = arr[0]
for i in range(1, len(arr)):
    ans *= arr[i]
    if ans > mod:
        ans = -1
        break

if 0 in arr:
    ans = 0

print(ans)

Buggy submission (verdict: Runtime Error):
import sys, io, os, re
import bisect
from pprint import pprint
from math import sin, cos, pi, radians, sqrt
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce

def array1(n): return [0] * n
def array2(n, m): return [[0] * m for x in range(n)]
def array3(n, m, l): return [[[0] * l for y in xrange(m)] for x in xrange(n)]

a = sys.stdin.readline().strip()
arr = map(int, sys.stdin.readline().strip().split())
mod = 10**18

ans = arr[0]
for i in range(1, len(arr)):
    ans *= arr[i]
    if ans > mod:
        ans = -1
        break

print(ans)

Buggy submission (verdict: Runtime Error):
import sys, io, os, re
import bisect
from pprint import pprint
from math import sin, cos, pi, radians, sqrt
from copy import copy, deepcopy
from collections import deque
from fractions import gcd

def array1(n): return [0] * n
def array2(n, m): return [[0] * m for x in range(n)]
def array3(n, m, l): return [[[0] * l for y in xrange(m)] for x in xrange(n)]

a = int(sys.stdin.readline().strip())
arr = map(int, sys.stdin.readline().strip().split())

x = reduce(lambda x, y: x*y, arr)

print(x if x < 10**18 else -1)
Problem p02675 (python)

Fixed submission:

import sys, os, re
from pprint import pprint

a = int(sys.stdin.readline().strip())

if a%10 in [2, 4, 5, 7, 9]:
    print("hon")
elif a%10 in [0, 1,6, 8]:
    print("pon")
elif a%10 in [3]:
    print("bon")

Buggy submission (verdict: Runtime Error):
import sys, os, re
from pprint import pprint

n, m = list(map(int, sys.stdin.readline().strip().split()))
g = [[] for x in range(n)]

for i in range(n):
    x, y = list(map(int, sys.stdin.readline().strip().split()))
    x -= 1
    y -= 1
    g[x].append(y)
    g[y].append(x)

ans = {0: -1}

while len(ans) < n:
    flag = False
    for k, v in ans.items():
        for node in g[k]:
            if node not in ans:
                ans[node] = k
                flag = True
    if flag == False:
        break

print("Yes")
for i in range(1, n):
    print(ans[i]+1)
Problem p02574 (python)

Fixed submission:
from math import gcd
inpl = lambda: list(map(int,input().split()))
def primes(N):
    P = []
    firstfactor = [1]*N
    for i in range(2,N):
        sieve = 1
        for p in P:
            if p*p > i:
                break
            elif i % p == 0:
                sieve = 0
                firstfactor[i] = p
                break
        if sieve == 0:
            continue
        else:
            firstfactor[i] = i
            P.append(i)
    return P, firstfactor

N = int(input())
A = inpl()

g = A[0]
for a in A:
    g = gcd(g,a)
if g > 1:
    print('not coprime')
    exit()

ff = primes(max(A)+1)[1]
st = set()
for a in A:
    prev = 0
    while a > 1:
        p = ff[a]
        a //= p
        if p == prev:
            continue
        elif p in st:
            print('setwise coprime')
            exit()
        else:
            prev = p
            st.add(p)
print('pairwise coprime')

Buggy submission (verdict: Runtime Error):
from math import gcd
inpl = lambda: list(map(int,input().split()))
def primes(N):
    P = []
    for i in range(2,N):
        sieve = 1
        for p in P:
            if p*p > i:
                break
            elif i % p == 0:
                sieve = 0
                break
        if sieve == 0:
            continue
        else:
            P.append(i)
    return P

N = int(input())
A = inpl()

g = A[0]
for a in A:
    g = gcd(g,a)
if g > 1:
    print('not coprime')
    exit()

P = primes(1000)
for p in P:
    n = 0
    for i in range(N):
        if A[i] % p == 0:
            n += 1
            while A[i] % p == 0:
                A[i] //= p
            if n > 1:
                print('setwise coprime')
                exit()
s = set()
for a in A:
    if a == 1:
        continue
    elif a in s:
        print('setwise coprime')
	    exit()
    else:
        s.add(a)
print('pairwise coprime')
Problem p02609 (python)

Fixed submission:
N = int(input())
X = input()
p0 = X.count('1')
p1, p2 = p0-1, p0+1
mem = {0:0}
def f(n):
    if n in mem:
        return mem[n]
    else:
        p = bin(n).count('1')
        ret = f(n % p) + 1
        mem[n] = ret
        return ret
r1 = r2 = 0
k1 = k2 = 1
for i in range(N):
    if X[-i-1] == '1':
        if p1 > 0:
            r1 = (r1+k1) % p1
        r2 = (r2+k2) % p2
    if p1 > 0:
        k1 = k1 * 2 % p1
    k2 = k2 * 2 % p2

ans = [None]*N
k1 = k2 = 1
for i in range(N):
    if X[-i-1] == '0':
        r = (r2 + k2) % p2
        ans[-i-1] = f(r) + 1
    elif p1 > 0:
        r = (r1 - k1) % p1
        ans[-i-1] = f(r) + 1
    else:
        ans[-i-1] = 0
    if p1 > 0:
        k1 = k1 * 2 % p1
    k2 = k2 * 2 % p2
for i in range(N):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
N = int(input())
X = input()
p0 = X.count('1')
p1, p2 = p0-1, p0+1
mem = {0:0}
def f(n):
    if n in mem:
        return mem[n]
    else:
        p = bin(n).count('1')
        ret = f(n % p) + 1
        mem[n] = ret
        return ret
r1 = r2 = 0
k1 = k2 = 1
for i in range(N):
    if X[-i-1] == '1':
        r1 = (r1+k1) % p1
        r2 = (r2+k2) % p2
    k1 = k1 * 2 % p1
    k2 = k2 * 2 % p2

ans = [None]*N
k1 = k2 = 1
for i in range(N):
    if X[-i-1] == '0':
        r = (r2 + k2) % p2
    else:
        r = (r1 - k1) % p1
    ans[-i-1] = f(r) + 1
    k1 = k1 * 2 % p1
    k2 = k2 * 2 % p2
for i in range(N):
    print(ans[i])
Problem p02805 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**9)
input = lambda: sys.stdin.readline().rstrip()
inpl = lambda: list(map(int,input().split()))

N = int(input())
x = []
y = []
for i in range(N):
    xy = inpl()
    x.append(xy[0])
    y.append(xy[1])
ans2 = 10**12
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            a = 2*(x[j]-x[i])
            c = 2*(x[k]-x[j])
            b = 2*(y[j]-y[i])
            d = 2*(y[k]-y[j])
            P = x[j]**2 - x[i]**2 + y[j]**2 - y[i]**2
            Q = x[k]**2 - x[j]**2 + y[k]**2 - y[j]**2

            det = a*d - b*c
            if det == 0:
                continue
            Cx = (d*P - b*Q)/det
            Cy = (a*Q - c*P)/det
            r2 = (Cx-x[i])**2 + (Cy-y[i])**2
            for p in range(N):
                if p in (i,j,k):
                    continue
                if (Cx-x[p])**2 + (Cy-y[p])**2 > r2:
                    break
            else:
                if r2 < ans2:
                    ans2 = r2

for i in range(N-1):
    for j in range(i+1,N):
        Cx = (x[i] + x[j])/2
        Cy = (y[i] + y[j])/2
        r2 = ((x[i]-x[j])**2 + (y[i]-y[j])**2)/4
        for p in range(N):
            if p in (i,j):
                continue
            if (Cx-x[p])**2 + (Cy-y[p])**2 > r2:
                break
        else:
            if r2 < ans2:
                ans2 = r2

print(ans2**0.5)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)
input = lambda: sys.stdin.readline().rstrip()
inpl = lambda: list(map(int,input().split()))

N = int(input())
x = []
y = []
for i in range(N):
    xy = inpl()
    x.append(xy[0])
    y.append(xy[1])
ans2 = 10*12
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            a = 2*(x[j]-x[i])
            c = 2*(x[k]-x[j])
            b = 2*(y[j]-y[i])
            d = 2*(y[k]-y[j])
            P = x[j]**2 - x[i]**2 + y[j]**2 - y[i]**2
            Q = x[k]**2 - x[j]**2 + y[k]**2 - y[j]**2

            det = a*d - b*c
            if det == 0:
                continue
            Cx = (d*P - b*Q)/det
            Cy = (a*Q - c*P)/det
            r2 = (Cx-x[i])**2 + (Cy-y[i])**2
            for p in range(N):
                if p in (i,j,k):
                    continue
                if (Cx-x[p])**2 + (Cy-y[p])**2 > r2:
                    break
            else:
                ans2 = r2

for i in range(N-2):
    for j in range(i+1,N-1):
        Cx = (x[i] + x[j])/2
        Cy = (y[i] + y[j])/2
        for p in range(N):
            if p in (i,j):
                continue
            if (Cx-x[p])**2 + (Cy-y[p])**2 > r2:
                break
        else:
            ans2 = r2

print(ans2**0.5)
Problem p02843 (python)

Fixed submission:
inpl = lambda: list(map(int,input().split()))
X = int(input())
if X < 100:
    print(0)
    exit()
elif X <= 105:
    print(1)
    exit()
dp = [False]*(X+1)
goods = list(range(100,106))
dp[0] = True
for k in goods:
    dp[k] = True

for i in range(200, X+1):
    for k in goods:
        if dp[i-k]:
            dp[i] = True
            break
if dp[X]:
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
inpl = lambda: list(map(int,input().split()))
X = int(input())
if X < 100:
    print(0)
elif X <= 105:
    print(1)
dp = [False]*(X+1)
goods = list(range(100,106))
dp[0] = True
for k in goods:
    dp[k] = True

for i in range(200, X+1):
    for k in goods:
        if dp[i-k]:
            dp[i] = True
            break
if dp[X]:
    print(1)
else:
    print(0)
Problem p02855 (python)

Fixed submission:
import sys
input = lambda: sys.stdin.readline().rstrip()
inpl = lambda: list(map(int,input().split()))
H, W, K = inpl()
a = [input() for _ in range(H)]
strawberry = [[] for _ in range(H)]
for h in range(H):
    for w in range(W):
        if a[h][w] == '#':
            strawberry[h].append(w)
empty = []
ans = [[0]*W for _ in range(H)]
s = 1
for h in range(H):
    if len(strawberry[h]) == 0:
        empty.append(h)
        continue
    strawberry[h][-1] = W-1
    i = 0
    for w in range(W):
        ans[h][w] = s
        if w == strawberry[h][i]:
            s += 1
            i += 1

j = 0
while len(empty) > j and empty[j] == j:
    j += 1
for k in range(j):
    ans[k] = ans[j]
for e in range(j, len(empty)):
    k = empty[e]
    ans[k] = ans[k-1]

for h in range(H):
    print(' '.join(list(map(str, ans[h]))))

Buggy submission (verdict: Runtime Error):
import sys
input = lambda: sys.stdin.readline().rstrip()
inpl = lambda: list(map(int,input().split()))
H, W, K = inpl()
a = [input() for _ in range(H)]
strawberry = [[] for _ in range(H)]
for h in range(H):
    for w in range(W):
        if a[h][w] == '#':
            strawberry[h].append(w)
empty = []
ans = [[0]*W for _ in range(H)]
s = 1
for h in range(H):
    if len(strawberry[h]) == 0:
        empty.append(h)
        continue
    strawberry[h][-1] = W-1
    i = 0
    for w in range(W):
        ans[h][w] = s
        if w == strawberry[h][i]:
            s += 1
            i += 1

j = 0
if empty and empty[0] == 0:
    j = 1
    while empty[j] == j:
        j += 1
    for k in range(j):
        ans[k] = ans[j]
for e in range(j, len(empty)):
    k = empty[e]
    ans[k] = ans[k-1]

for h in range(H):
    print(' '.join(list(map(str, ans[h]))))
Problem p02865 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input)
print(N//2)