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

Fixed submission:
from heapq import *
n,m = map(int,input().split())
t = [[] for i in range(10**5+1)]
for i in range(n):
    a,b = map(int,input().split())
    t[a].append(b)

ans = 0
h = []
for i in range(1,m+1):
    #print(i,"日目")
    for j in t[i]:
        heappush(h, -j)
        #print("heappush",j)
    if h:
        a = -heappop(h)
        #print("heappop",a)
        ans += a
print(ans)

Buggy submission (verdict: Runtime Error):
from heapq import *
n,m = map(int,input().split())
t = [[] for i in range(m+1)]
for i in range(n):
    a,b = map(int,input().split())
    t[a].append(b)

ans = 0
h = []
for i in range(1,m+1):
    #print(i,"日目")
    for j in t[i]:
        heappush(h, -j)
        #print("heappush",j)
    if h:
        a = -heappop(h)
        #print("heappop",a)
        ans += a
print(ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
ab = {i:[] for i in range(m+1)}
for i in range(n):
    a,b = map(int,input().split())
    if a in ab:
        ab[a].append(b)
    else:
        ab[a] = [b]
#print(ab)
ans = 0
for i in range(m)[::-1]:
    rem = m - i
    if ab[rem]:
        job = ab[rem]
        ans += max(job)
        del ab[rem][job.index(max(job))]
        if rem < m:
            ab[rem+1] += ab[rem]
    #print(ans)
print(ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
ab = [[] for i in range(1,m+1)]
for i in range(n):
    a,b = map(int,input().split())
    ab[a].append(b)
ab = {i:sorted(ab[i],reverse=True) for i in ab}
print(ab)
ans = 0
for i in range(m)[::-1]:
    rem = m - i
    #print("rem=",rem,"ab[rem]=",ab[rem])
    mx = 0
    fl = -1
    for j in range(1,m-i+1):
        #print("j=",j)
        if ab[j] and mx < ab[j][0]:
            mx = ab[j][0]
            fl = j
            #print("fl=",fl)
    ans += mx
    if fl > 0: del ab[fl][0]
    #print(ans)
print(ans)
Problem p03038 (python)

Fixed submission:
n, m = map(int, input().split())
A = list(map(lambda x:list((int(x),1)), input().split()))
#print(A)
for i in range(m):
    b,c = map(int, input().split())
    A.append([c,b])
A.sort(reverse = True)
sum = 0
rem = n
for i in range(len(A)):
    sum += A[i][0] * min(A[i][1],rem)
    rem -= min(A[i][1],rem)
    if rem == 0: break
print(sum)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
A = list(map(lambda x:list((int(x),1)), input().split()))
#print(A)
for i in range(m):
    b,c = map(int, input().split())
    A.append([c,b])
A.sort(reverse = True)
sum = 0
rem = n
for i in range(len(A)):
    sum += A[i][0] * min(A[i][1],rem)
    rem -= min(A[i][1],rem)
    if rem == 0: break
print(sum)
Problem p03041 (python)

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

s = input()

print(s[:k-1] + s[k-1].lower() + s[k:])

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

s = input()
s[k+1].lower()
print(s)
Problem p03077 (python)

Fixed submission:
import math
N = int(input())
r = [int(input()) for _ in range(5)]

m_r = min(r)
print(math.ceil(N/m_r) + 4)

Buggy submission (verdict: Runtime Error):
import fractions

N = int(input())
r = [int(input()) for _ in range(5)]

m_r = min(r)
print(fractions.ceil(N/m_r) + 4)

Buggy submission (verdict: Runtime Error):
import fractions

N = int(input())
r = [int(input()) for _ in range(5)]

m_r = min(r)
print(fractions.ceil(N/r) + 4)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
r = [int(input()) for _ in range(5)]

m_r = min(r)
print(math.ceil(N/r) + 4)
Problem p03207 (python)

Fixed submission:
n = int(input())
P = [int(input()) for _ in range(n)]

P.sort()
print(int(P[n-1]/2) + sum(P[:n-1]))

Buggy submission (verdict: Runtime Error):
v
Problem p03286 (python)

Fixed submission:
from math import log
n = int(input())
s = ""
if n != 0:
    for i in range(int(log(abs(n),2))+3):
        #print("i=",i)
        if n % 2**(i+1) == 2**i:
            s = "1" + s
            n -= (-2)**(i)
            #print(i,n)
        else:
            s = "0" + s
    for j in s[s.find("1"):]:
        print(j,end = "")
else:
    print(0)

Buggy submission (verdict: Runtime Error):
from math import log
n = int(input())
s = ""

for i in range(int(log(abs(n),2))+3):
    #print("i=",i)
    if n % 2**(i+1) == 2**i:
        s = "1" + s
        n -= (-2)**(i)
        #print(i,n)
    else:
        s = "0" + s
if "1" in s:
    for j in s[s.find("1"):]:
        print(j,end = "")
else:
    print(0)
Problem p03036 (python)

Fixed submission:
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 = int(input().split())
for i in range(10):
	x = r * x - d
	print(x)
Problem p03042 (python)

Fixed submission:
s = input()
a = int(s[:2])
b = int(s[2:])
if a <= 12 and a > 0:
	if b <=12 and b > 0:
		print('AMBIGUOUS')
	else:
		print('MMYY')
else:
	if b <=12 and b > 0:
		print('YYMM')
	else:
		print('NA')

Buggy submission (verdict: Runtime Error):
s = input()
a = int(s[:2])
b = int(s[2:])
if a <= 12 && a > 0:
	if b <=12 and b > 0:
		print('AMBIGUOUS')
	else:
		print('MMYY')
else:
	if b <=12 and b > 0:
		print('YYMM')
	else:
		print('NA')

Buggy submission (verdict: Runtime Error):
s = input()
a = int(s[:2])
b = int(s[2:])
if a <= 12 && a > 0:
	if b <=12 && b > 0:
		print('AMBIGUOUS')
	else:
		print('MMYY')
else:
	if b <=12 && b > 0:
		print('YYMM')
	else:
		print('NA')
Problem p03072 (python)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
sum = 0
m = 0
for i in h:
    if m <= i:
        sum += 1
        m = i
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = map(int, input().split())
sum = 0
max = 0
for i in range(n):
    if max <= h[i]:
        sum += 1
        max = h[i]
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = map(int, input().split())
sum = 0
max = 0
for i in range(n):
    if max <= h[i]:
        sum　+= 1
        max = h[i]
print(sum)
Problem p03075 (python)

Fixed submission:
l = [int(input()) for i in range(5)]
if l[4]-l[0] <= int(input()):
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
l = [int(input()) for i in range(5)]
if l <= int(input()):
    print('Yay!')
else:
    print(':(')
Problem p03207 (python)

Fixed submission:
N, *d = map(int, open(0).read().split())
print(int(sum(d)-max(d)/2))

Buggy submission (verdict: Runtime Error):
N, *d = map(int, open(0).read().split())
print(sum(d)-max(s)/2)

Buggy submission (verdict: Runtime Error):
N, *d = map(int, open(0))
print(sum(d)-max(s)/2)
Problem p02879 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = list(map(int, input()))
if a > 9 or b > 9:
  print(-1)
else:
  print(a * b)
Problem p02989 (python)

Fixed submission:
n=0
a=[]
i=1
ii=1
l=0
tasu=0
rk=[]
bk=[]
n=int(input())
for x in input().split(" "):
    a.append(int(x))

a.sort()

print(a[int(len(a)/2)]-a[int(len(a)/2)-1])

Buggy submission (verdict: Runtime Error):
a=[]
i=1
k=0
l=0
rk=[]
bk=[]
a.append(int(x))
for x in input().split(" "):
    a.append(int(x))

while k<=100000:
    while i<=a[0]:
        if a[i]>=k:
            rk.append(a[i])
        else:
            bk.append(a[i])
        i+=1
    if len(rk)==len(bk):
        l+=1
    rk=[]
    bk=[]
    i=1
    k+=1
        
print(l)
Problem p02897 (python)

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

Buggy submission (verdict: Runtime Error):
N=int(input())
if N==1:
  print(1)
elif N % 2==0:
  print(1/2)
else:
  print((N-1)/2N)
Problem p02951 (python)

Fixed submission:
A,B,C = map(int,input().split())
res = -A+B+C
if res <= 0:
  res = 0
print(res)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
res = -A+B+C
if res <= 0:
  res = 0
return res

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
return -A+B+C
Problem p02970 (python)

Fixed submission:
import math
N,D=map(int,input().split())
print(math.ceil(N/(2*D+1)))

Buggy submission (verdict: Runtime Error):
N,D=map(int,input().split())
print((N//(2D+1))+1)
Problem p03053 (python)

Fixed submission:
from collections import deque
H,W=map(int,input().split())

l=[input() for _ in range(H)]


def bfs(H,W,l):
  ans=0
  que=deque()
  count=[[-1]*W for _ in range(H)]
  num=H*W
  dx=[1,-1,0,0]
  dy=[0,0,1,-1]
  for i in range(H):
    for j in range(W):
      if l[i][j]=='#':
        count[i][j]=0
        que.append([i,j])
        num-=1
  while num>0:
    x,y=que.popleft()
    for k in range(4):
      a, b=x+dx[k], y+dy[k]
      if a<0 or a>=H or b<0 or b>=W or count[a][b]!=-1:
        continue
      else:
        count[a][b]=count[x][y]+1
        que.append([a,b])
        num-=1
  for i in range(H):
    ans=max(ans,max(count[i]))
  return ans
print(bfs(H,W,l))

Buggy submission (verdict: Runtime Error):
from collections import deque
H,W=map(int,input().split())

l=[input() for _ in range(H)]


def bfs(H,W,l):
  max_a,max_b=0,0
  que=deque()
  count=[[-1]*W for _ in range(H)]
  num=H*W
  dx=[1,-1,0,0]
  dy=[0,0,1,-1]
  for i in range(H):
    for j in range(W):
      if l[i][j]=='#':
        count[i][j]=0
        que.append([i,j])
        num-=1
  while num>0:
    x,y=que.popleft()
    for k in range(4):
      a,b=x+dx[k],y+dy[k]
      if a>=0 and a<H and b>=0 and b<W and count[a][b]==-1:
        count[a][b]=count[x][y]+1
        que.append([a,b])
        num-=1
        if num==0:
          max_x,max_y=a,b
  return count[max_x][max_y]
print(bfs(H,W,l))

Buggy submission (verdict: Runtime Error):
from collections import deque
H,W=map(int,input().split())

l=[input() for _ in range(H)]


def bfs(H,W,l):
  max_a,max_b=0,0
  que=deque()
  count=[[-1]*W for _ in range(H)]
  num=H*W
  dx=[1,-1,0,0]
  dy=[0,0,1,-1]
  for i in range(H):
    for j in range(W):
      if l[i][j]=='#':
        count[i][j]=0
        que.append([i,j])
        num-=1
  while num>0:
    x,y=que.popleft()
    for k in range(4):
      a,b=x+dx[k],y+dy[k]
      if a>=0 and a<H and b>=0 and b<W and count[a][b]==-1:
        count[a][b]=count[x][y]+1
        que.append([a,b])
        num-=1
        if num==0:
          max_x,max_y=a,b
  return count[max_x][max_y]
print(bfs(H,W,l))

Buggy submission (verdict: Runtime Error):
from collections import deque
H,W=map(int,input().split())

l=[input() for _ in range(H)]


def bfs(H,W,l):
  que=deque()
  count=[[-1]*W for _ in range(H)]
  num=H*W
  dx=[1,-1,0,0]
  dy=[0,0,1,-1]
  for i in range(H):
    for j in range(W):
      if l[i][j]=='#':
        count[i][j]=0
        que.append([i,j])
        num-=1
  while num>0:
    x,y=que.popleft()
    for k in range(4):
      a, b=x+dx[k], y+dy[k]
      if a<0 or a>=H or b<0 or b>=W or count[a][b]!=-1:
        continue
      else:
        count[a][b]=count[x][y]+1
        que.append([a,b])
        num-=1
        max_x=a
        max_y=b
  return count[max_x][max_y]
print(bfs(H,W,l))
Problem p03072 (python)

Fixed submission:
N=int(input())
l1=list(map(int,input().split()))
ans=0
h=0
for i in range(N):
  if h<=l1[i]:
    ans+=1
    h=max(h,l1[i])
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
l1=list(map(int,input().split()))
ans=0
h=0
for i in range(N):
  if h<=l[i]:
    ans+=1
    h=max(h,l[i])
print(ans)
Problem p03013 (python)

Fixed submission:
n,m = map(int,input().split())
li = [int(input()) for i in range(m)]
p = 1000000007
ans = 0

steps = [0]*(max(10,n+1))
steps[1] = 1
steps[2] = 2
for i in range(3,n+1):
  steps[i] = (steps[i-1] + steps[i-2])%p
if m == 0:
  print(steps[n])
else:
  if li[0] == 1:
    ans += 1
  else:
    ans += steps[li[0]-1]%p

  for i in range(m-1):
    if li[i+1] == li[i]:
      continue
    elif li[i+1] - li[i] == 1:
      ans = 0
    elif li[i+1] - li[i] == 2:
      continue
    else:
      ans *= steps[li[i+1]-li[i]-2]
      ans %= p

  if li[m-1] == n-1: 
    print(ans)
  else:
    print((ans*steps[n-li[m-1]-1])%p)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
li = [int(input()) for i in range(m)]
p = 1000000007
ans = 0

steps = [0]*(n+1)
steps[1] = 1
steps[2] = 2
for i in range(3,n+1):
  steps[i] = (steps[i-1] + steps[i-2])%p
if m == 0:
  print(steps[n])
else:
  if li[0] == 1:
    ans += 1
  else:
    ans += steps[li[0]-1]%p

  for i in range(m-1):
    if li[i+1] == li[i]:
      continue
    elif li[i+1] - li[i] == 1:
      ans = 0
    elif li[i+1] - li[i] == 2:
      continue
    else:
      ans *= steps[li[i+1]-li[i]-2]
      ans %= p

  if li[m-1] == n-1: 
    print(ans)
  else:
    print((ans*steps[n-li[m-1]-1])%p)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
li = [int(input()) for i in range(m)]
p = 1000000007
ans = 0

steps = [0]*(n+1)
steps[1] = 1
steps[2] = 2
for i in range(3,n+1):
  steps[i] = (steps[i-1] + steps[i-2])%p

if li[0] == 1:
  ans += 1
else:
  ans += steps[li[0]-1]%p

for i in range(m-1):
  if li[i+1] == li[i]:
    continue
  elif li[i+1] - li[i] == 1:
    ans = 0
  elif li[i+1] - li[i] == 2:
    continue
  else:
    ans *= steps[li[i+1]-li[i]-2]
    ans %= p

if li[m-1] == n-1: 
  print(ans)
else:
  print((ans*steps[n-li[m-1]-1])%p)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
li = [int(input()) for i in range(m)]
p = 1000000007
ans = 0

steps = [0]*(n+1)
steps[1] = 1
steps[2] = 2
for i in range(3,n+1):
  steps[i] = (steps[i-1] + steps[i-2])%p

if li[0] == 1:
  ans += 1
else:
  ans += steps[li[0]-1]%p

for i in range(m-1):
  ans *= steps[li[i+1]-li[i]-2]
  ans %= p

if li[m-1] == n-1: 
  print(ans)
else:
  print((ans*steps[n-li[m-1]-1])%p)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
li = [int(input()) for i in range(m)]
p = 1000000007
ans = 0

steps = [0]*(n+1)
steps[1] = 1
steps[2] = 2
for i in range(3,n+1):
  steps[i] = (steps[i-1] + steps[i-2])%p

if li[0] == 1:
  ans += 1
else:
  ans += steps[li[0]-1]%p

for i in range(m-1):
  ans *= steps[li[i+1]-li[i]-2]
  ans %= p

if li[m-1] == n-1: 
  print(ans)
else:
  print((ans*steps[n-li[m-1]-1])%p)
Problem p03286 (python)

Fixed submission:
n = int(input())
tmp = 1
lipos = [1]
while tmp<10**9:
  tmp *= 4
  lipos.append(lipos[-1]+tmp)
#print(lipos)
tmp = -2
lineg = [-2]
while tmp > - 10**9:
  tmp *= 4
  lineg.append(lineg[-1]+tmp)
#print(lineg)
if n == 0:
  print("0")
elif n == 1:
  print("1")
elif n == -1:
  print("10")
elif n > 0:
  flag = True
  i = 0
  while flag:
    if lipos[i] < n <= lipos[i+1]:
      k = i+1
      flag = False
    i += 1
  diff = lipos[k]-n
  print(bin(lipos[k]^diff)[2:])
else:
  flag = True
  i = 0
  while flag:
    if lineg[i] > n > lineg[i+1]:
      k = i+1
      flag = False
    i += 1
  diff = n-lineg[k]
  print(bin((-lineg[k])^diff)[2:])

Buggy submission (verdict: Runtime Error):
n = int(input())
tmp = 1
lipos = [1]
while tmp<10**9:
  tmp *= 4
  lipos.append(lipos[-1]+tmp)
#print(lipos)
tmp = -2
lineg = [-2]
while tmp > - 10**9:
  tmp *= 4
  lineg.append(lineg[-1]+tmp)
#print(lineg)
if n == 0:
  print("0")
elif n == 1:
  print("1")
elif n == -1:
  print("10")
elif n > 0:
  flag = True
  i = 0
  while flag:
    if lipos[i] < n <= lipos[i+1]:
      k = i+1
      flag = False
    i += 1
  diff = lipos[k]-n
  print(bin(lipos[k]^diff)[2:])
else:
  flag = True
  i = 0
  if lineg[i] > n >= lineg[i+1]:
    k = i+1
    flag = False
  i += 1
  diff = n-lineg[k]
  print(bin((-lineg[k])^diff)[2:])

Buggy submission (verdict: Runtime Error):
n = int(input())
tmp = 1
lipos = [1]
while tmp<10**9:
  tmp *= 4
  lipos.append(lipos[-1]+tmp)
#print(lipos)
tmp = -2
lineg = [-2]
while tmp > - 10**9:
  tmp *= 4
  lineg.append(lineg[-1]+tmp)
#print(lineg)
if n == 0:
  print("0")
elif n == 1:
  print("1")
elif n == -1:
  print("10")
elif n > 0:
  flag = True
  i = 0
  while flag:
    if lipos[i] < n <= lipos[i+1]:
      k = i+1
      flag = False
    i += 1
  diff = lipos[k]-n
  print(bin(lipos[k]^diff)[2:])
else:
  flag = True
  i = 0
  if lineg[i] > n > lineg[i+1]:
    k = i+1
    flag = False
  i += 1
  diff = n-lineg[k]
  print(bin((-lineg[k])^diff)[2:])
Problem p02915 (python)

Fixed submission:
a=int(input())
b = a**3
print(b)

Buggy submission (verdict: Runtime Error):
n = int(input())
b = list(map(int,input().split()))
sum = 0
for i in range(n-1):
    first = b[i]
    second = 0
    for j in range(i+1,n):
        if(second < b[j]):
            if(first < b[j]):
                second = first
                first = b[j]
            else:
                second = b[j]
        sum += second
print(sum)
Problem p02990 (python)

Fixed submission:
import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n, k = map(int, input().split())
x = n - k

div = 10 ** 9 + 7
for i in range(1, k+1):
    if (i-1 <= x):
        print((comb(x+1, i) * comb(k-1, i-1)) % div) 
    else:
        print('0')

Buggy submission (verdict: Runtime Error):
import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n, k = map(int, input().split())
x = n - k

div = 10 ** 9 + 7
for i in range(1, k+1):
    print((comb(x+1, i) * comb(k-1, i-1)) % div)
Problem p02916 (python)

Fixed submission:
import numpy as np
N=int(input())
A=np.array(list(map(int,input().split())))
B=list(map(int,input().split()))
C=np.array(list(map(int,input().split())))

sb=sum(B)
dC=np.diff(A)

sC=C[A[np.where(dC==1)[0]]-1].sum()
#print(sb, sC)
print(sb+sC)

Buggy submission (verdict: Runtime Error):
import numpy as np
N=int(input())
A=np.array(list(map(int,input().split())))
B=list(map(int,input().split()))
C=np.array(list(map(int,input().split())))

sb=sum(B)
dC=np.diff(A)

sC=C[A[np.where(dC==1)[0]]].sum()
#print(sb, sC)
print(sb+sC)

Buggy submission (verdict: Runtime Error):
import numpy as np
N=int(input())
A=map(int,input().split())
B=map(int,input().split())
C=array(map(int,input().split()))

sb=sum(B)
dC=np.diff(A)
sC=C[np.where(dC==1)[0]].sum()

print(sb+sC)

Buggy submission (verdict: Runtime Error):
import numpy as np
N=input()
A=map(int,input().split())
B=map(int,input().split())
C=array(map(int,input().split()))

sb=sum(B)
dC=np.diff(A)
sC=C[np.where(dC==1)[0]].sum()

print(sb+sC)

Buggy submission (verdict: Runtime Error):
import numpy as np
N=input()
A=map(input().split())
B=map(input().split())
C=array(map(input().split()))

sb=sum(B)
dC=np.diff(A)
sC=C[np.where(dC==1)[0]].sum()

print(sb+sC)
Problem p02860 (python)

Fixed submission:
n = int(input())
s = list(str(input()))
if n == 1:
  print('No')
  exit()
for i in range(int(n/2)):
  if s[i] != s[int(n/2+i)] or n%2:
    print('No')
    exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(str(input()))
for i in range(int(n/2)+1):
  if s[i] != s[int(n/2+i)] or n==1 or n%2:
    print('No')
    exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(str(input()))
for i in range(n/2):
  if s[i] != s[int(n/2)+i]:
    print('No')
    exit()
print('Yes')
Problem p02879 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
ans = a*b if a<=9 ans b<=9 else -1
print(ans)
Problem p02880 (python)

Fixed submission:
n = int(input())
for i in range(9):
  for j in range(9):
    if (i+1)*(j+1) == n:
      print('Yes')
      exit()
print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(1, 10):
  for j in range(1, 10):
    print('Yes' if i*j == n)
print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(1, 10):
  for j in ragne(1, 10):
    if i*j == n:
      print('Yes')
      exit()
print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(9):
  for j in range(9):
    if (i+1)*(j+1) == n:
      print('Yes')
      exit()
Print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = 9
for i in range(a+1):
  for j in range(a+1):
    if i*j == n:
      print('Yes')
      exit()
Print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(9):
  for j in range(9):
    if i*j == n:
      print('Yes')
      exit()
Print('No')
Problem p02881 (python)

Fixed submission:
n = int(input())
list = []
for i in range(1, int(n**0.5+1)):
  if n%i == 0:
    list.append(int(i + n/i))
print(min(list)-2)

Buggy submission (verdict: Runtime Error):
n = int(input())
list = []
for i in range(1, n**0.5+1):
  if n%i == 0:
    list.append(int(i + n/i))
print(min(list)-2)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
ans = int('inf')
for i in range(10^6):
  if n%(i+1) == 0:
    j = n/(i+1)
    ans = min(ans, (i+1)+j-2)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
ans = float('inf')
for i in range(10^6):
  if n%i == 0:
    j = n/i
    ans = min(ans, i+j-2)
print(ans)
Problem p02897 (python)

Fixed submission:
n = int(input())
odd = 0
for i in range(n+1):
  if i%2:
    odd += 1
print(odd/n)

Buggy submission (verdict: Runtime Error):
n = int(input())
odd = 0
for i in range(n+1):
  odd += 1 if i%2
print(odd/n)

Buggy submission (verdict: Runtime Error):
n = int(input())
odd = 0
for i in range(n+1):
  odd += i if i%2:
print(int(odd/n)
Problem p03135 (python)

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

print(float(T)/X)

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

try:
	assert 3 <= n <= 10
	assert len(ar) == n
	assert (1 <= min(ar)) and (max(ar) <= 100)
    
	if max(ar) < sum(ar) - max(ar):
		print("Yes")
	else:
		print("No")
except:
  print("No")

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

assert 3 <= n <= 10
assert len(ar) == n
assert (1 <= min(ar)) and (max(ar) <= 100)

if max(ar) < sum(ar) - max(ar):
  print("Yes")
else:
  print("No")