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

Fixed submission:
array = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, \
2, 5, 4, 1, 4, 1, 51]

inp = input()

inp = int(inp)

print('{}'.format(array[inp-1]))

Buggy submission (verdict: Runtime Error):
import math
abc = input()
abc = abc.split(' ')
a = int(abc[0])
b = int(abc[1])
c = int(abc[2])

if (c-a-b>0) and 4*a*b<(c-a-b)*(c-a-b):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import math
abc = input()
abc = abc.split(' ')
a = int(abc[0])
b = int(abc[1])
c = int(abc[2])

if 4*a*b<(c-a-b)*(c-a-b):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import math
abc = input()
abc = abc.split(' ')
a = int(abc[0])
b = int(abc[1])
c = int(abc[2])

if 4*a*b<(c-a-b)*(c-a-b):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import math
abc = input()
abc = abc.split(' ')
a = int(abc[0])
b = int(abc[1])
c = int(abc[2])

if 4*a*b<(c-a-b)*(c-a-b):
    print('Yes')
else:
    print('No')
Problem p02743 (python)

Fixed submission:
import math
abc = input()
abc = abc.split(' ')
a = int(abc[0])
b = int(abc[1])
c = int(abc[2])

if (c-a-b>0) and 4*a*b<(c-a-b)*(c-a-b):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import math
abc = input()
abc = abc.split(' ')
a = int(abc[0])
b = int(abc[1])
c = int(abc[2])

if 4*a*b<(c-a-b)(c-a-b):
    print('Yes')
else:
    print('No')
Problem p02934 (python)

Fixed submission:
n = int(input())

a = input().split()

sum_a_rev = 0

for i in range(n):
    sum_a_rev = sum_a_rev + 1/int(a[i])

res = 1/sum_a_rev

print("{}".format(res))

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

sum_a_rev = 0

for i in range(n):
    val = int(input())
    sum_a_rev = sum_a_rev + 1/val

res = 1/sum_a_rev

print("{}".format(res))

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

sum_a_rev = 0

for i in range(n):
    val = int(input())
    sum_a_rev = sum_a_rev + 1/val

res = 1/sum_a_rev

print("{}".format(res))
Problem p02945 (python)

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

print('{}'.format(max(a+b, a-b, a*b)))

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

input_patterns = []

patterns = {}

def init_key():
    ini_key = []
    for i in range(26):
        ini_key.append(0)
    return ini_key

for i in range(n):
    val = input()
    input_patterns.append(val)

#input_patterns = ['acornistnt', 'peanutbomb', 'constraint']
count = 0
for inp in input_patterns:
#    key = init_key()
    #for j in range(len(inp)):
        # make [0, 0, 1, 0, 2, 3, ...]
        #       a  b  c  d  e  f  
    #    for k in range(26):
    #        if inp[j] == chr(ord('a') + k):
    #            key[k] = key[k] + 1
    
    key = sorted(inp)
    skey = ''

    for k in range(len(key)):
        skey = skey + key[k]

    if skey in patterns:
        patterns[skey] = patterns[skey] + 1
    else:
        patterns[skey] = 1

    if patterns[skey] > 1:
        count = count + patterns[skey] - 1
    
result = 0

#for skey in patterns:
#    if patterns[skey] > 1:
#        for i in range(1, int(patterns[skey])):
#            result = result + i

print('{}'.format(count))
Problem p02743 (python)

Fixed submission:
import math
from decimal import Decimal

a, b, c = map(int, input().split())
a = Decimal(a)
b = Decimal(b)
c = Decimal(c)
if (a.sqrt() + b.sqrt() < c.sqrt()):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import math
from decimal import Decimal

a, b, c = map(int, input().split())
a = Decimal(a)
b = Decimal(b)
c = Decimal(c)
if (a.sqrt + b.sqrt < c.sqrt):
    print("Yes")
else:
    print("No")
Problem p02741 (python)

Fixed submission:
ks = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(ks[k-1])

Buggy submission (verdict: Runtime Error):
def ceildiv(a, b):
    return -(-a // b)

h, w = map(int, input().split())

if (h==1 or w==1):
    print(1)
else:
    print(ceildiv(h,2)*ceildiv(w,2) + (ceildiv(h,2)-1)*(ceildiv(w,2)-1))

Buggy submission (verdict: Runtime Error):
def ceildiv(a, b):
    return -(-a // b)

int h, w = map(int, input().split())

if (h==1 or w==1):
    print(1)
else:
    print(ceildiv(h,2)*ceildiv(w,2) + (ceildiv(h,2)-1)*(ceildiv(w,2)-1))
Problem p02741 (python)

Fixed submission:
ls = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
num = input()
print(ls[int(num)-1])

Buggy submission (verdict: Runtime Error):
ls = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
num = input()
k = int(num) + 1
print(ls[k])

Buggy submission (verdict: Runtime Error):
ls = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
num = input()
print(ls[int(num)+1])

Buggy submission (verdict: Runtime Error):
ls = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
num = scan()
print(ls[int(num)])
Problem p02741 (python)

Fixed submission:
arr = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
n = input()
print(arr[int(n)-1])

Buggy submission (verdict: Runtime Error):
arr = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
n = input()
print(arr[int(n)+1])

Buggy submission (verdict: Runtime Error):
arr = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
n = input()
print(arr[int(n)])
Problem p02741 (python)

Fixed submission:
str_K = input()
k = int(str_K)
tmp_list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(tmp_list[k-1])

Buggy submission (verdict: Runtime Error):
in_list = list(map(int,input().split()))
a = in_list[0]
b = in_list[1]
c = in_list[2]
if 0 < (c*c - 2*a*b + a*a - 2*b*c + b*b - 2*c*a):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import math
in_list = list(input().split())
a = float(in_list[0])
b = float(in_list[1])
c = float(in_list[2])
if (math.sqrt(a) + math.sqrt(b)) < math.sqrt(c):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
tmp_list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(tmp_list[input()-1])

Buggy submission (verdict: Runtime Error):
tmp = list(input().split())
print(tmp[K-1])

Buggy submission (verdict: Runtime Error):
print(input()-1)
Problem p03060 (python)

Fixed submission:
in_data = [list(map(int,input().split())) for i in range(3)]

N = in_data[0][0]

earn_ttl = 0

for i in range(N):
    value = in_data[1][i]
    cost = in_data[2][i]
    earn = value - cost
    if (earn > 0):
        earn_ttl = earn_ttl + earn
        
print(earn_ttl)

Buggy submission (verdict: Runtime Error):
in_data = [list(map(int,input().split())) for i in range(3)]
print(ls)
print(in_data[0])
print(in_data[1])
print(in_data[2])
print("--------")

N = in_data[0][0]

earn_ttl = 0

for i in range(N):
    #print(i)
    value = in_data[1][i]
    cost = in_data[2][i]
    earn = value - cost
    if (earn > 0):
        earn_ttl = earn_ttl + earn
        
print(earn_ttl)
Problem p02741 (python)

Fixed submission:
k = int(input())
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(a[k-1])

Buggy submission (verdict: Runtime Error):
import math
import decimal
decimal.getcontext().prec = 6
a, b, c = map(int, input().split())
a = decimal.Decimal(a)
b = decimal.Decimal(b)
c = decimal.Decimal(c)
d = decimal.Decimal(math.sqrt(a*b))
if a + 2 * d +b - c < 1e-20:
    print("Yes")
else:
    print("No")
Problem p02742 (python)

Fixed submission:
import math
h, w = map(float, input().split())
if h == 1 or w == 1:
    print(1)
else:
    print(math.ceil(h*w/2))

Buggy submission (verdict: Runtime Error):
import math
h, w = map(int,input().split())
if h % 2 ==1 and w % 2 == 1:
    print((h*w+1)/2)
else:
# print(math.ceil(h*w/2))
print(h*w/2)
Problem p02743 (python)

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

d = c - a - b
if d**2 > 4*a*b and d > 0:
# if a + 2 * d +b - c < 1e-20:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import math
import decimal
decimal.getcontext().prec = 6
a, b, c = map(int, input().split())
a = decimal.Decimal(a)
b = decimal.Decimal(b)
c = decimal.Decimal(c)
if a + 2 * math.sqrt(a*b) + b - c < 1e-20:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import math
a, b, c = map(int, input().split())
if math.fsum(a**(1/2) + b**(1/2)) < math.fsum(c**(1/2)):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import math
a, b, c = map(int, input().split())
if ((c-a-b)/2).as_integer_ratio() > (math.sqrt(a*b)).as_interger_ratio():
    print("Yes")
else:
    print("No")
Problem p02756 (python)

Fixed submission:
S = str(input())
n = int(input())
Q = [list(map(str, input().split())) for _ in range(n)]
cnt = 0
s_pre = ""
s_pro = ""
for q in Q:
    if q[0] == "1":
        cnt += 1
    else:
        if (int(q[1])+cnt)%2 == 1:
#             S = q[2] + S
            s_pre = q[2] + s_pre
        else:
            s_pro = s_pro + q[2]
#             S = S + q[2]

S = s_pre + S + s_pro
if cnt%2==1:
    S = list(S)
    S.reverse()
print("".join(S))

Buggy submission (verdict: Runtime Error):
S = str(input())
n = int(input())
Q = [list(map(str, input().split())) for _ in range(n)]
cnt = 0
# for q in Q:
#     if q[0] == "1":
#         cnt += 1
# #         S.reverse()
#     elif q[0] == "2":
#         if (int(q[1])+cnt)%2 == 1:
#             S.insert(0,q[2])
#         else:
#             S.append(q[2])
for q in Q:
    if q[0] == "1":
        cnt += 1
    elif q[0] == "2":
        if (int(q[1])+cnt)%2 == 1:
            S = q[2] + S
        else:
            S = S + q[2]

if cnt%2==1:
    S.reverse()
print("".join(S))
Problem p02760 (python)

Fixed submission:
def main():
    A = [list(map(int, input().split())) for i in range(3)]
    N = int(input())
    b = [int(input()) for i in range(N)]
    
    for i in range(3):
        for j in range(3):
            for k in range(N):
                if A[i][j] == b[k]:
                    A[i][j] = 0
    
    ans = "No"
    for i in range(3):
        if A[i][0]+A[i][1]+A[i][2]==0:
            ans = "Yes"
        if A[0][i]+A[1][i]+A[2][i]==0:
            ans = "Yes"
    if A[0][0]+A[1][1]+A[2][2]==0:
        ans = "Yes"
    if A[0][2]+A[1][1]+A[2][0]==0:
        ans = "Yes"
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
def main():
    A = [list(map(int, input().split())) for i in range(3)]
    N = int(input())
    b = [int(input()) for i in range(N)]
    
    for i in range(3):
        for j in range(3):
            for k in range(N):
                if (A[i][j] == b(k)):
                    A[i][j] = 0
    
    ans = "No"
    for i in range(3):
        if A[i][0]+A[i][1]+A[i][2]==0:
            ans = "Yes"
        if A[0][i]+A[1][i]+A[2][i]==0:
            ans = "Yes"
    if A[0][0]+A[1][1]+A[2][2]==0:
        ans = "Yes"
    if A[0][2]+A[1][1]+A[2][0]==0:
        ans = "Yes"
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
def main():
    A = [list(map(int, input().split())) for i in range(3)]
    N = int(input())
    b = [int(i) for i in range(N)]
    
    for i in range(3):
        for j in range(3):
            for k in range(N):
                if (A[i,j] == b(k)):
                    A[i,j] = 0
    
    ans = "No"
    for i in range(3):
        if A[i,0]+A[i,1]+A[i,2]==0: ans = "Yes"
        if A[0,i]+A[1,i]+A[2,i]==0: ans = "Yes"
    if A[0,0]+A[1,1]+A[2,2]==0: ans = "Yes"
    if A[0,2]+A[1,1]+A[2,0]==0: ans = "Yes"
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
def main():
    A = [list(map(int, input().split())) for i in range(3)]
    N = int(input())
    b = [int(i) for i in range(N)]
    
    for i in range(3):
        for j in range(3):
            for k in range(N):
                if (A[i,j] == b(k)):
                    A[i,j] = 0
    
    ans = "No"
    for i in range(3):
        if A[i,0]==A[i,1]==A[i,2]==0: ans = "Yes"
        if A[0,i]==A[1,i]==A[2,i]==0: ans = "Yes"
    if A[0,0]==A[1,1]==A[2,2]==0: ans = "Yes"
    if A[0,2]==A[1,1]==A[2,0]==0: ans = "Yes"
    print(ans)
main()
Problem p02761 (python)

Fixed submission:
def main():
    n , m = map(int, input().split())
    con = list(set([tuple(map(int, input().split())) for i in range(m)]))
    if (len(con) > n) or (m != 0 and n != 1 and con[0] == (1,0)):
        print(-1)
        return
    if (n == 1 and m == 0):
        print(0)
        return
    ans = 10**(n-1)
    if (m == 0):
        print(ans)
        return
    tmp = -1
    for s,c in con:
        if (s == tmp):
            print(-1)
            return
        else:
            tmp = s
        if (s==1):
            ans += (c-1)*10**(n-1)
        else:
            ans += c*10**(n-s)
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
def main():
    n , m = map(int, input().split())
    con = list(set([tuple(map(int, input().split())) for i in range(m)]))
    if (len(con) > n) or (n != 1 and con[0] == (1,0)):
        print(-1)
        return
    ans = 10**(n-1)
    if (m == 0):
        print(ans)
        return
    tmp = -1
    for s,c in con:
        if (s == tmp):
            print(-1)
            return
        else:
            tmp = s
        if (s==1):
            ans += (c-1)*10**(n-1)
        else:
            ans += c*10**(n-s)
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
def main():
    n , m = map(int, input().split())
    con = list(set([tuple(map(int, input().split())) for i in range(m)]))
    if (len(con) > n) or (n != 1 and con[0] == (1,0)):
        print(-1)
        return
    ans = 10**(n-1)
    tmp = -1
    for s,c in con:
        if (s == tmp):
            print(-1)
            return
        else:
            tmp = s
        if (s==1):
            ans += (c-1)*10**(n-1)
        else:
            ans += c*10**(n-s)
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
def main():
    n , m = map(int, input().split())
    con = list(set([tuple(map(int, input().split())) for i in range(m)]))
    if (len(con) > n) or (con[0] == (1,0)):
        print(-1)
        return
    ans = 10**(n-1)
    tmp = -1
    for s,c in con:
        if (s == tmp):
            print(-1)
            return
        else:
            tmp = s
        if (s==1):
            ans += (c-1)*10**(n-1)
        else:
            ans += c*10**(n-s)
    print(ans)
main()
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
ans = "Odd"
if(a*b%2==0):
	ans = "Even"
print(ans)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if (a*b%2==0):
  ans = "Even"
else:
  ans = "Odd"
printf(ans)
Problem p03470 (python)

Fixed submission:
def main():
    n = int(input())
    r = [int(input()) for i in range(n)]
    r.sort()
    counter = 0
    tmp = 0
    for i in range(n):
        if (r[i] > tmp):
            tmp = r[i]
            counter += 1
    print(counter)
main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    r = [input() for i in range(n)]
    r.sort()
    counter = 0
    tmp = 0
    for i in range(n):
        if (r[i] > tmp):
            tmp = r[i]
            counter += 1
    print(counter)
main()
Problem p03493 (python)

Fixed submission:
data = input()
ans = int(data[0])+int(data[1])+int(data[2])
print(ans)

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

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

Buggy submission (verdict: Runtime Error):
a, b, c= map(int, input().split())
print(a+b+c)
Problem p02760 (python)

Fixed submission:
# coding: utf-8
# Your code here!
ls = []
count = [0]*9
for i in range(3):
    ls.extend(input().split(' '))
for i in range(int(input())):
    s = input()
    if s in ls:
        i = ls.index(s)
        count[i]="1"
flag = 0
for i in range(3):
    if count[i] == count[i+3] == count[i+6]=="1":
        flag = 1
        break
for i in range(0,8,3):
    if count[i] == count[i+1] == count[i+2] == "1":
        flag = 1
        break
if count[0]==count[4]==count[8]=="1":
    flag = 1
if count[2] == count[4] == count[6] == "1":
    flag = 1
if flag == 1:
    print("Yes")
elif flag == 0:
    print("No")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
ls = []
count = [0]*9
for i in range(3):
    ls.extend(input().split(' '))
for i in range(int(input())):
    s = input()
    if s in ls:
        i = ls.index(s)
        count[i]="1"
flag = 0
for i in range(3):
    if count[i] == count[i+3] == count[i+6]=="1":
        flag = 1
        break
if flag == 0:
	for i in range(0,8,3):
    	if count[i] == count[i+1] == count[i+2] == "1":
       		flag = 1
        	break
if count[0]==count[4]==count[8]=="1":
    flag = 1
if count[2] == count[4] == count[6] == "1":
    flag = 1
if flag == 1:
    print("Yes")
elif flag == 0:
    print("No")
Problem p02765 (python)

Fixed submission:
n,r=map(int,input().split(' '))
if n<10:
  print(100*(10-n)+r)
else:
  print(r)

Buggy submission (verdict: Runtime Error):
n,r=map(int(input().split(' ')))
if n<10:
  print(100*(10-n)+r)
else:
  print(r)

Buggy submission (verdict: Runtime Error):
n,r=map(int(input().split(' ')))
if n<10:
  print(100*(10-n))
else:
  print(r)
Problem p02767 (python)

Fixed submission:
n=int(input())
ls=input().split(' ')
mp=[]
for i in range(100):
    hp=0
    for j in range(n):
        hp+=(i-int(ls[j]))**2
    mp.append(hp)
print(min(mp))

Buggy submission (verdict: Runtime Error):
n=int(input())
ls=input().split(' ')
mp=[]
for i in range(min(ls),max(ls)+1):
    hp=0
    for j in range(n):
        hp+=(i-int(ls[j]))**2
    mp.append(hp)
print(min(mp))
Problem p02741 (python)

Fixed submission:
Input_list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(Input_list[int(input())-1])

Buggy submission (verdict: Runtime Error):
Input_list = list(input())

print(Input_list[int(input())-1])
Problem p02741 (python)

Fixed submission:
li=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k=int(input())

print(li[k-1])

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
cnt=0
 
if w%2==0:
  print((w//2)*h)
elif w%2!=0 and w!=1:
  if h%2==0:
    print(w*(h//2))
  else:
    print(w*((h-1)//2)+(w+1)//2)
elif w==1:
  print(1)
Problem p02742 (python)

Fixed submission:
h,w=map(int,input().split())
 
if w%2==0:
  if h==1:
    print(1)
  else:
    print((w//2)*h)
elif w==1:
  print(1)
elif w%2!=0:
  if h%2==0:
    print(w*(h//2))
  else:
    print(w*((h-1)//2)+(w+1)//2)

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
 
if w%2==0:
  if h==1:
    print(1)
  elif:
    print((w//2)*h)
elif w==1:
  print(1)
elif w%2!=0:
  if h%2==0:
    print(w*(h//2))
  else:
    print(w*((h-1)//2)+(w+1)//2)
Problem p02741 (python)

Fixed submission:
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
k -= 1
print(l[k])

Buggy submission (verdict: Runtime Error):
h, w = input().split()
n = int(h) * int(w)
a = n//2
if h==1 or w==1:
  print(1)
  
elif n%2==1:
  print(a+1)
  
else:
  print(a)
Problem p02742 (python)

Fixed submission:
h, w = input().split()
n = int(h) * int(w)
a = n//2
if int(h)==1 or int(w)==1:
  print(1)
  
elif n%2==1:
  print(a+1)
  
else:
  print(a)

Buggy submission (verdict: Runtime Error):
l = input()
h, w = l.split(" ")
n = h * w
a = n/2
if n%2==0:
  print(a)
  

else:
  print(a+0.5)

Buggy submission (verdict: Runtime Error):
h, w = int(input().split(" "))
n = h * w
a = n/2
if n%2==0:
  print(a)
  
else:
  print(a+0.5)

Buggy submission (verdict: Runtime Error):
h, w = int(input().split())
n = h * w
a = n/2
if n%2==0:
  print(a)
  
else:
  print(a+0.5)
Problem p02981 (python)

Fixed submission:
N,A,B = map(int,input().split())
alpha = N*A
if B <= alpha:
  print(B)
  
else:
  print(alpha)

Buggy submission (verdict: Runtime Error):
alpha = N * A
if B <= alpha:
  print(B)
  
elif B > alpha:
  prihnt(alpha)
Problem p02741 (python)

Fixed submission:
lst = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

k = int(input())

print(lst[k-1])

Buggy submission (verdict: Runtime Error):
import math
 
h,w = list(map(int, input().split()))
 
 
 
if h%2==1 and w%2==1:
 
    a = (h//2) * w
    b = math.ceil(w/2)

 
    print(a+b)
else:
 
    print(h*w//2)
Problem p03447 (python)

Fixed submission:
X = int(input())
A = int(input())
B = int(input())

X = X - A

while X >= B:
    X = X - B

print(X)

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

count = 0

for i in range(0, a+1):
    for j in range(0, b+1):
        for k in range(0, c+1):
            if i*500 + j*100 + k*50 == x:
                count += 1

print(count)
Problem p03477 (python)

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

if (A+B) > (C+D):
    print('Left')
elif (A+B) == (C+D):
    print('Balanced')
else:
    print('Right')

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

if (A+B) > (C+D):
    print('Left')
elif (A+B) == (C+D:
    print('Balanced')
else:
    print('Right')
Problem p02747 (python)

Fixed submission:
#1 question on hitachi contest
class Solution:
    def answer(self, str_in):
        n = len(str_in)
        if n == 1:
            return "No"
        if n%2 != 0:
            return "No"
        i = 1
        arr = []

        for i in range(0,len(str_in)):
            
            if str_in[i] == 'h' and str_in[i+1]== 'i':
                arr.append(i)
                
            elif str_in[i] == 'i' and str_in[i-1] == 'h':
                
                if arr == []:
                    return "No"
                else:
                    arr.pop()
            else:
                return "No"
        if arr == []:
            return "Yes"
        else:
            return "No"

str_in = input()

s = Solution()
print(s.answer(str_in))

Buggy submission (verdict: Runtime Error):
#1 question on hitachi contest
class Solution:
    def answer(self, str_in):
        n = len(str_in)
        if n == 1:
            return "No"
        
        i = 1
        arr = []

        for i in range(0,len(str_in)):
            
            if str_in[i] == 'h' and str_in[i+1]== 'i':
                arr.append(i)
                
            elif str_in[i] == 'i' and str_in[i-1] == 'h':
                
                if arr == []:
                    return "No"
                else:
                    arr.pop()
            else:
                return "No"
        if arr == []:
            return "Yes"
        else:
            return "No"

str_in = input()

s = Solution()
print(s.answer(str_in))
Problem p03106 (python)

Fixed submission:
from sys import stdin

a = [int(i) for i in stdin.readline().rstrip().split(' ')]

min = min([a[0], a[1]])
max = max([a[0], a[1]])

k = 0
for i in list(reversed(range(1, min + 1))):
    if max % i == 0 and min % i == 0:
        k += 1
        if k == a[2]:
            print(i)
            break

Buggy submission (verdict: Runtime Error):
from sys import stdin

a = [int(i) for i in stdin.readline().rstrip().split(' ')]

min = min([a[0], a[1]])
max = max([a[0], a[1]])

k = 0
for i in reversed(range()):
  if max % (i+1)==0:
    k += 1
    if k == a[2]:
      print(i)
      break

Buggy submission (verdict: Runtime Error):
from sys import stdin

a = [int(i) for i in stdin.readline().rstrip().split(' ')]

min = min([a[0], a[1]])
max = max([a[0], a[1]])

k = 0
res 
for i in reversed(range()):
  if max % (i+1)==0:
    k += 1
    if k == a[2]:
      print(k)
      break