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

Fixed submission:
h, w = map(int, input().split())
s = [input() for _ in range(h)]
for i in range(h):
    l = ''
    for j in range(w):
        if s[i][j] == '#': l += '#'
        else:
            l += str(sum([ss[max(0, j-1):min(w, j+2)].count('#') for ss in s[max(0, i-1):min(h, i+2)]]))
    print(l)

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
ss = [list(input()) for i in range(h)]
s = list(map(lambda x: list(map(lambda y: 1 if y == '#' else 0, x)), ss))

def calc(x, y):
    if (x+1) == 1 and (y+1) == 1:
        return s[x+1][y] + s[x][y+1] + s[x+1][y+1]
    elif (x+1) == h and (y+1) == 1:
        return s[x-1][y] + s[x][y+1] + s[x-1][y+1]
    elif (x+1) == 1 and (y+1) == w:
        return s[x+1][y] + s[x][y-1] + s[x+1][y-1]
    elif (x+1) == h and (y+1) == w:
        return s[x-1][y] + s[x][y-1] + s[x-1][y-1]
    elif (x+1) == 1:
        return s[x+1][y] + s[x][y-1] + s[x][y+1] + s[x+1][y+1] + s[x+1][y-1]
    elif (x+1) == h:
        return s[x-1][y] + s[1][y-1] + s[x][y+1] + s[x-1][y+1] + s[x-1][y-1]
    elif (y+1) == 1:
        return s[x+1][y] + s[x-1][y] + s[x][y+1] + s[x-1][y+1] + s[x+1][y+1]
    elif (y+1) == w:
        return s[x+1][y] + s[x-1][y] + s[x][y-1] + s[x-1][y-1] + s[x+1][y-1]
    else:
        return s[x-1][y] + s[x+1][y] + s[x][y-1] + s[x][y+1] + s[x+1][y+1] + s[x+1][y-1] + s[x-1][y+1] + s[x-1][y-1]

a = [[0 for i in range(w)] for j in range(h)]
for i in range(h):
    for j in range(w):
        if ss[i][j] == '#': a[i][j] = '#'
        else: a[i][j] = calc(i, j)

for i in range(h):
    for j in range(w):
        print(a[i][j], end='')
    print('')
Problem p03587 (python)

Fixed submission:
s = str(input())
char = list(s)
num = 0
for c in char:
    if int(c) == 1:
        num += 1

print(num)

Buggy submission (verdict: Runtime Error):
n = int(input())
a_b = [input() for i in range(n)]
min = 1000000001
max = -1
max_point = 0
for i in a_b:
    a, b = map(int, i.split())
    if(min > a):
        min = a
    if(max < a):
        max = a
        max_point = b

num = 0
num += min
num += max - min
num += max_point

print(num)

Buggy submission (verdict: Runtime Error):
n = int(input())
a_b = [input() for i in range(n)]
min = 1000000001
max = -1
max_point = 0
for i in a_b:
    a, b = map(int, i.split())
    if(min > a):
        min = a
    if(max < a):
        max = a
        max_point = b

num = 0
num += min
num += max - min
num += max_point

print(num)
Problem p03592 (python)

Fixed submission:
N, M, k = tuple(int(i) for i in input().split(' '))
ans = 'No'
for a in range(N + 1):
    for b in range(M + 1):
        if M * a + N * b - 2 * a * b == k:
            ans = 'Yes'
            break
print(ans)

Buggy submission (verdict: Runtime Error):
def flip(N, M, K, Mnum, Nnum, black):
    if black < 0 or black > K:
        return False
    if black == K:
        return True

    return flip(N, M, K, Mnum, Nnum+1, black+N-(Mnum*2)) or flip(N, M, K, Mnum+1, Nnum, black+M-(Nnum*2))

if __name__ == '__main__':
    inputs = input('> ').split()
    if flip(int(inputs[0]), int(inputs[1]), int(inputs[2]), 0, 0, 0):
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
def flip(N, M, K, Mnum, Nnum, black):
    if black < 0 or black > K:
        return False
    if black == K:
        return True

    return flip(N, M, K, Mnum+1, Nnum, black+M-Nnum) or flip(N, M, K, Mnum, Nnum+1, black+N-Nnum)

if __name__ == '__main__':
    inputs = input('> ').split()
    if flip(int(inputs[0]), int(inputs[1]), int(inputs[2]), 0, 0, 0):
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
def flip(N, M, K, Mnum, Nnum, black):
    print('count: ', Mnum+Nnum)
    print(black)
    if black < 0 or black > K:
        return False
    if black == K:
        return True

    return flip(N, M, K, Mnum+1, Nnum, black+M-Nnum) or flip(N, M, K, Mnum, Nnum+1, black+N-Nnum)

if __name__ == '__main__':
    inputs = input('> ').split()
    if flip(int(inputs[0]), int(inputs[1]), int(inputs[2]), 0, 0, 0):
        print('Yes')
    else:
        print('No')
Problem p03610 (python)

Fixed submission:
s = input()
print(''.join([s[i] for i in range(len(s)) if i%2 == 0]))

Buggy submission (verdict: Runtime Error):
s = input()
print(''.join([s[i] if i%2 == 1 for i in range(len(s))]))
Problem p03671 (python)

Fixed submission:
cos = list(map(int, input().split()))
res = min(cos)
cos.remove(min(cos))
res += min(cos)
print(res)

Buggy submission (verdict: Runtime Error):
cos = map(int, intput().split())
res = min(cos)
cos.remove(min(cos))
res += min(cos)
print(res)
Problem p03711 (python)

Fixed submission:
x, y = map(int, input().split())
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
if (x in a and y in a) or (x in b and y in b) or (x in c and y in c):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
if (x in a and y in a) or (x in b and y in b) or (x in c in y in c):
    print('Yes')
else:
    print('No')
Problem p03738 (python)

Fixed submission:
a = [int(input()) for _ in range(2)]
if a[0] > a[1]: print('GREATER')
elif a[0] < a[1]: print('LESS')
else: print('EQUAL')

Buggy submission (verdict: Runtime Error):
ab = [int(input()) for _ in range(2)]
if a[0] > a[1]: print('GREATER')
elif a[0] < a[1]: print('LESS')
else: print('EQUAL')
Problem p03827 (python)

Fixed submission:
n = int(input())
s = input()
ans = 0
cur = 0
for c in s:
    if c == 'I':
        cur += 1
        ans = max(cur, ans)
    else:
        cur -= 1

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
ans = 0
cur = 0
for c in s:
	if c == 'I':
		cur += 1
        ans = max(ans, cur)
    else:
		cur -= 1
          
print(ans)
Problem p03943 (python)

Fixed submission:
print('Yes' if (lambda x: sum(x[:2]) == x[2])(sorted(map(int, input().split()))) else 'No')

Buggy submission (verdict: Runtime Error):
num = list(map(int, input().split()))
if max(num) == sum(num.remove(max(num))): print('Yes')
else: print('No')
Problem p03962 (python)

Fixed submission:
l = sorted(map(int, input().split()))
if l[0] == l[1] == l[2]:
    print('1')
elif l[0] == l[1] or l[1] == l[2]:
    print('2')
else:
    print('3')

Buggy submission (verdict: Runtime Error):
l = sort(map(int, input().split()))
if l[0] == l[1] == l[2]:
    print('1')
elif l[0] == l[1]:
    print('2')
else:
    print('3')
Problem p02639 (python)

Fixed submission:
x = list(map(int, input().split()))

count=x.index(0)
ans = count+1
print(ans)

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

for i in range(0,X):
    foot = 2*i+4*(X-i)
    if foot==Y:
        print('Yes')
        break
else:
    print('No')
Problem p02717 (python)

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

Buggy submission (verdict: Runtime Error):
N, K=map(int, input().split())
nums=list()
nums.append(N)
 
while abs(N-K)<N:
    N=abs(N-K)
    nums.append(N)
print(min(nums))

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

while abs(N-K)<N:
    N=abs(N-K)
    nums.append(N)
print(min(nums))
Problem p02730 (python)

Fixed submission:
S=input()
n=len(S)
a=0
b=0
for i in range(1,int(n/2)+1):
    if S[i-1]!=S[n-i]:
        a=1
        print("No")
        break;
p=[]
q=[]
if a==0:
    for i in range(1,int(n/2)+1):
        p.append(S[i-1])
        q.append(S[i+int(n/2)])
    #print(p,q)
    for i in range(1,int((len(p))/2)+1):
        #print(p[i-1],p[len(p)-i],q[i-1],q[len(p)-i])
        if p[i-1]!=p[len(p)-i] or q[i-1]!=q[len(p)-i]:
            b=1
            print("No")
            break;
if a==0 and b==0:
    print("Yes")

Buggy submission (verdict: Runtime Error):
S=input()
n=len(S)
a=0
b=0
for i in range((n-1)/2):
	if S[i]!=S[n-i]:
    	a=1
        print("No")
        break;
p=""
q=""
if a==0:
	for i in range((n-1)/2):
		p.append(S[i])
    	q.append(S[i+1+(n-1)/2])
	for i in range((len(p)-1)/2):
  		if p[i]!=p[len(p)-i] or q[i]!=q[len(p)-i]:
        	b=1
            print("No")
            break;
if a==0 and b==0:
	print("Yes")
Problem p03029 (python)

Fixed submission:
a, p=map(int, input().split())
print((a*3+p)//2)

Buggy submission (verdict: Runtime Error):
a, p=map(int, input().split())
b=(a/3)+p
if b%2==0:
    print(b/2¥n)
else:
    print((b-1)/2¥n)

Buggy submission (verdict: Runtime Error):
a, p=map(int, input().split())
b=(a/3)+p
if b%2==0:
    print(b/2¥n)
if else:
    print((b-1)/2¥n)

Buggy submission (verdict: Runtime Error):
a, p=map(int, input().split())
b=(a/3)+p
if b%2==0:
    print(b/2)
if else:
    print((b-1)/2)
Problem p03035 (python)

Fixed submission:
a,b=map(int,input().split())
if a>=13:
    print(b)
elif a<=5:
    print(0)
else:
    print(b//2)

Buggy submission (verdict: Runtime Error):
a,b=map(int input().split())
if a>=13:
    print(b)
elif a<=5:
    print(0)
else:
    print(b/2)

Buggy submission (verdict: Runtime Error):
a,b=map(int input().split())
if a>=13:
    print(b\n)
elif a<=5:
    print(0\n)
else:
    print(b/2\n)
Problem p02641 (python)

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

arr = []

if n == 0:
    print(x)
else:
    tmp = input()
    num = tmp.split(' ')
    num_li = [int(i) for i in num]
    arr.extend(num_li)

    for i in range(10000):

        if x - i not in arr:
            print(x - i)
            break

        if x + i not in arr:
            print(x + i)
            break

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

arr = []
tmp = input()
num = tmp.split(' ')
num_li = [int(i) for i in num]
arr.extend(num_li)

min = x
max = x

if n == 0:
    print(x)
else:
    for i in range(10000):

        min -= 1
        max += 1

        if min not in arr:
            print(min)
            break

        if max not in arr:
            print(max)
            break

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

arr = []
tmp = input()
num = tmp.split(' ')
num_li = [int(i) for i in num]
arr.extend(num_li)

arr.sort()

min = x
max = x

if n == 0:
    print(x)
else:
    for i in range(10000):

        min -= 1
        max += 1

        if min not in arr:
            print(min)
            break

        if max not in arr:
            print(max)
            break

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

arr = []
tmp = input()
num = tmp.split(' ')
num_li = [int(i) for i in num]
arr.extend(num_li)

arr.sort()

min = x
max = x

for i in range(10000):
    if len(arr) == 1:
        print(x)
        break

    min -= 1
    max += 1

    if min not in arr:
        print(min)
        break

    if max not in arr:
        print(max)
        break

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

arr = [x]
tmp = input()
num = tmp.split(' ')
num_li = [int(i) for i in num]
arr.extend(num_li)

arr.sort()
arr = list(set(arr))

min = x
max = x

for i in range(10000):
    if len(arr) == 1:
        print(x)
        break

    min -= 1
    max += 1

    if min not in arr:
        print(min)
        break

    if max not in arr:
        print(max)
        break

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

arr = [x]
tmp = input()
num = tmp.split(' ')
num_li = [int(i) for i in num]
arr.extend(num_li)

arr.sort()
arr = list(set(arr))

min = x
max = x

for i in range(10000):
    if len(arr) == 1:
        print(x)
        break

    min -= 1
    max += 1
    
    try:
        arr.index(min)
    except:
        print(min)
        break

    try:
        arr.index(max)
    except:
        print(max)
        break

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

arr = [x]
tmp = input()
num = tmp.split(' ')
num_li = [int(i) for i in num]
arr.extend(num_li)

arr.sort()
arr = list(set(arr))

min = x
max = x

for i in range(100):
    if len(arr) == 1:
        print(x)
        break

    min -= 1
    max += 1
    
    try:
        arr.index(min)
    except:
        print(min)
        break

    try:
        arr.index(max)
    except:
        print(max)
        break
Problem p02684 (python)

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

p=1
if k<=n:
  for i in range(k):
    p=a[p-1]
  print(p)
  exit()

t=[-1]*n
t[0]=0
for i in range(1,n):
  p=a[p-1]
  if t[p-1] !=-1:
    break
  t[p-1]=i

d=i-t[p-1]
k-=i
k%=d
for i in range(k):
  p=a[p-1]
print(p)

Buggy submission (verdict: Runtime Error):
import re
def validate(text):
  match=re.search(r'(...)\1{2,}', text)
  return match.group(),match.start()

n,k=map(int,input().split())
a=list(map(int,input().split()))
ans=1
count=''
for j in range(11):
  ans=a[ans-1]
  count+=str(ans)
#print(validate(count)[0][:3],validate(count)[1])
ans=1
for i in range((k-validate(count)[1])%len(validate(count)[0][:3])+validate(count)[1]):
  ans=a[ans-1]
print(ans)
Problem p02705 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
 
for i in range(1,n+1):
  print(a.count(i))
Problem p02719 (python)

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

print(min(N%K,abs(N%K-K)))

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

print(min(N%K,abs(N%K-K)))

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

print(min(N%K,abs(N%K-K)))
Problem p02885 (python)

Fixed submission:
num1,num2=input().split()

a=int(num1)
b=int(num2)

if a <= b or a <= 2*b:
  print(0)

elif a>b:
  c=a-2*b
  print(c)

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

if a <= b or a <= 2*b:
  print(0)

if a>b:
  c=a-2*b
  print(c)
Problem p04043 (python)

Fixed submission:
abc=list(map(int,input().split()))
abc.sort()
if abc ==[5, 5, 7]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
abc=list(map(int,input().split()))
abc.sort()
if A ==[5, 5, 7]:
  print("Yes")
else:
  print("No")

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

if a==b==5:
  if c==7:
    return print("Yes")
  else:
    return print("No")
elif a==c==5:
  if b==7:
    return print("Yes")
  else:
    return print("No")
elif b==c==5:
  if a==7:
    return print("Yes")
  else:
    return print("No")
else:
  return print("No")
Problem p02614 (python)

Fixed submission:
h, w, k = [int(i) for i in input().split()]
masu = [input() for _ in range(h)]
ans = 0
for mark_h in range(2**h):
    for mark_w in range(2**w):
        black = 0
        for i in range(h):
            for j in range(w):
                if (mark_h>>i)&1==1 and (mark_w>>j)&1==1:
                    if masu[i][j]=="#":
                        black+=1
        if black==k:
            ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
h, w, k = [int(i) for i in input().split()]
masu = [input() for _ in range(h)]
ans = 0
for mark_h in range(2**h):
    for mark_w in range(2**w):
        black = 0
        for i in range(h):
            for j in range(w):
                if (mark_h>>i)&1==1 and (mark_w>>j)&1==1:
                    if c[i][j]=="#":
                        black+=1
        if black=k:
            ans+=1
print(ans)
Problem p02615 (python)

Fixed submission:
n = int(input())
friendly = list(map(int, input().split()))
friendly.sort(reverse=True)
if len(friendly)<=2:
    print(sum(friendly[0:n-1]))
else:
    ans = friendly[0]+sum(friendly[1:(n+1)//2-1])*2+friendly[(n+1)//2-1]*((n+1)%2+1)
    print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
friendly = list(map(int, input().split()))
friendly.sort(reverse=True)
if len(friendly)<=2:
    print(sum[0:n-1])
else:
    ans = friendly[0]+sum(friendly[1:(n+1)//2-1])*2+friendly[(n+1)//2-1]*((n+1)%2+1)
    print(ans)
Problem p02630 (python)

Fixed submission:
n = int(input())
a_list = list(map(int, input().split()))
sum_a = sum(a_list)
num_a = [0]*(10**5)
for i in a_list:
    num_a[i-1] += 1
    
q = int(input())
for _ in range(q):
    b, c = list(map(int, input().split()))
    sum_a = sum_a + c * num_a[b-1] - b *num_a[b-1]
    num_a[c-1] += num_a[b-1]
    num_a[b-1] = 0
    print(sum_a)

Buggy submission (verdict: Runtime Error):
n = int(input())
a_list = list(map(int, input().split()))
sum_a = sum(a_list)
num_a = [0]*(10**5)
for i in a_list:
    num_a[i] += 1
    
q = int(input())
for _ in range(q):
    b, c = list(map(int, input().split()))
    sum_a = sum_a + c * num_a[b] - b *num_a[b]
    num_a[c] += num_a[b]
    num_a[b] = 0
    print(sum_a)
Problem p02639 (python)

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

for i in range(5):
  if(n[i] != i+1):
    print(i+1)
    exit()

Buggy submission (verdict: Runtime Error):
n = list(map(int, input().split()))
if(n[1] == 0):
  print(n[0])
  exit()
x = list(map(int, input().split()))

for i in range(1,102):
  if n[0] - i not in x:
    print(n[0] - i)
    break
  elif n[0] + i not in x:
    print(n[0] + i)
    break

Buggy submission (verdict: Runtime Error):
n = list(map(int, input().split()))
if(n[1] == 0):
  print(n[0])
  exit()
x = list(map(int, input().split()))
print(n)
print(type(x))
  
for i in range(1,100):
  if(('n[0] - i' in x) == False):
    print(n[0] - i)
    exit()
  elif(('n[0] + i' in x) == False):
    print(n[0] + i)
    exit()
Problem p02687 (python)

Fixed submission:
str = input()

if str == 'ABC':
  print("ARC")
else:
  print("ABC")

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

if(str == 'ABC'):
  print("ARC")
  el:
    print("ABC")
Problem p03103 (python)

Fixed submission:
n, m = map(lambda x: int(x), input().split())
drinks = []
for _ in range(n):
    a, b = map(lambda x: int(x), input().split())
    drinks.append((a, b))
    
sorted_drinks = sorted(drinks, key=lambda x: x[0])

num_drinks = 0
sum_prices = 0
for price, num in sorted_drinks:
    num_drinks += num
    sum_prices += num * price
    if num_drinks > m:
        sum_prices -= (num_drinks - m) * price
        break
    elif num_drinks == m:
        break

print(sum_prices)

Buggy submission (verdict: Runtime Error):
N,M = [int(s) for s in input().split()]
pre_lst=[]
for i in range(N):
  a,b = [int(s) for s in input().split()]
  pre_lst=lst+[[a,b,a*b]]
lst = sorted(pre_lst, key=lambda x: x[0])
m=0
i=0
cost=0
while(m<M):
  m+=lst[i][1]
  cost+=lst[i][2]
  i+=1
if(m>M):
  cost-=lst[i-1][0]*(m-M)
print(cost)

Buggy submission (verdict: Runtime Error):
N,M = [int(s) for s in input().split()]
pre_lst=[]
for i in range(N):
  a,b = [int(s) for s in input().split()]
  pre_lst=lst+[[a,b,a*b]]
lst = sorted(pre_lst, lambda=x: x[0])
m=0
i=0
cost=0
while(m<M):
  m+=lst[i][1]
  cost+=lst[i][2]
  i+=1
if(m>M):
  cost-=lst[i-1][0]*(m-M)
print(cost)
Problem p03160 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
dp=[0]*(N)
dp[0]=0
dp[1]=abs(A[1]-A[0])
for i in range(2,N):
    dp[i]=min(dp[i-1]+abs(A[i]-A[i-1]),dp[i-2]+abs(A[i]-A[i-2]))
# print(dp)
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
dp=[0]*(N)
dp[0]=0
dp[1]=0
dp[2]=abs(A[1]-A[0])
for i in range(3,N):
    dp[i]=min(dp[i-1]+abs(A[i-1]-A[i-2]),dp[i-2]+abs(A[i-1]-A[i-3]))

print(dp[N-1])
Problem p03166 (python)

Fixed submission:
import sys
from collections import *
sys.setrecursionlimit(10**5)
def dfs(x):
    visited[x]=True
    for i in range(len(adj[x])):
        t=adj[x][i]
        distance[t]=max(distance[t],distance[x]+1)
        indegree[t]-=1
        if(indegree[t]==0):
            dfs(t)

MAX = 10**5+5
indegree=[0]*(MAX)
distance=[0]*(MAX)
visited = [False]*(MAX)
adj = defaultdict(list)
N,M=list(map(int,input().split()))
for i in range(M):
    a,b=list(map(int,input().split()))
    adj[a].append(b)
    indegree[b]+=1
ans=0
for i in range(1,N+1):
    if(visited[i]==False and indegree[i]==0):
        dfs(i)
for i in range(1,N+1):
    ans=max(ans,distance[i])

print(ans)

Buggy submission (verdict: Runtime Error):
from collections import *
def dfs(x):
    visited[x]=True
    for i in range(len(adj[x])):
        t=adj[x][i]
        distance[t]=max(distance[t],distance[x]+1)
        indegree[t]-=1
        if(indegree[t]==0):
            dfs(t)

MAX = 10**5+5
indegree=[0]*(MAX)
distance=[0]*(MAX)
visited = [False]*(MAX)
adj = defaultdict(list)
N,M=list(map(int,input().split()))
for i in range(M):
    a,b=list(map(int,input().split()))
    adj[a].append(b)
    indegree[b]+=1
ans=0
for i in range(1,N+1):
    if(visited[i]==False and indegree[i]==0):
        dfs(i)
for i in range(1,N+1):
    ans=max(ans,distance[i])

print(ans)
Problem p02601 (python)

Fixed submission:
A, B, C = map(int, input().split())
K = int(input())
flag = False

l=[]
for i in range(K+1):
  for j in range(K+1):
    for k in range(K+1):
      if i+j+k == K:
        m=[i, j, k]
        l.append(m)

for i in range(len(l)):
  m = l[i]
  a=A*(2**m[0])
  b=B*(2**m[1])
  c=C*(2**m[2])

  if a<b and b<c:
    flag = False
    print("Yes")
    break
  else:
    flag = True
if flag:
  print("No")

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

l=[]
for i in range(K):
  for j in range(K):
    for k in range(K):
      if i+j+k == K:
        m=[i, j, k]
        l.append(m)

for i in range(len(l)):
  m = l[i]
  a=A*(2**m[0])
  b=B*(2**m[1])
  c=C*(2**m[k])

  if a<b and b<c:
    flag = False
    print("Yes")
    break
  else:
    flag = True
if flag:
  print("No")

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

l=[]
for i in range(K):
  for j in range(K):
    for k in range(K):
      if i+j+k == K:
        m=[i+1, j+1, k+1]
        l.append(m)

for i in range(len(l)):
  m = l[i]
  a=A*(2**m[0])
  b=B*(2**m[1])
  c=C*(2**m[k])

  if a<b and b<c:
    flag = False
    print("Yes")
    break
  else:
    flag = True
if flag:
  print("No")
Problem p02640 (python)

Fixed submission:
x, y = map(int, input().split())
flag = True
for a in range(x+1):
  if 2*a + 4*(x-a) == y:
    print("Yes")
    flag = False
    break
if flag:
  print("No")

Buggy submission (verdict: Runtime Error):
flag = True
for a in range(101):
  if 2*a + 4*(x-a) == y:
    print("Yes")
    flag = False
    break
if flag:
  print("No")
Problem p02658 (python)

Fixed submission:
n = int(input())
a = sorted(map(int, input().split()))
ans = 1
for i in a:
    ans *= i
    if ans > 10 ** 18:
        print(-1)
        exit()
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int, input().split()))
x = sorted(x)
ans=1
for i in a:
  ans *= i
  if ans > 10 ** 8:
    print(-1)
    exit()
print(ans)
Problem p03086 (python)

Fixed submission:
S = input()
a = 0
count=[]

for i in range(len(S)):
  if S[i] in ["A", "C", "G", "T"]:
    a += 1
    count.append(a)
  else:
    a = 0
    count.append(a)
print(max(list(map(int, count))))

Buggy submission (verdict: Runtime Error):
S = input()
a = 0
count=[]

for i in range(len(S)):
  if S[i] in ["A", "C", "G", "T"]:
    a += 1
    count.append(a)
  else:
    a = 0
print(max(list(map(int, count))))
Problem p02645 (python)

Fixed submission:
print(input()[:3])

Buggy submission (verdict: Runtime Error):
print(input[:3])