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

Fixed submission:
import math

a,b,x = (int(num) for num in input().split())
suf2 = a*b
vol = a*a*b
if (vol/2)>=x:
    l1 = x*2 / suf2
    x = float(b)/l1
    ans = math.degrees(math.atan(x))
else:
    l2 = (vol-x)*2 / (a*a)
    x = l2/float(a)
    ans = math.degrees(math.atan(x))
    
print(round(ans,6))

Buggy submission (verdict: Runtime Error):
import math

a,b,x = (int(num) for num in input().split())
suf2 = a*b
vol = a*a*b
if (vol/2)>=x:
    l1 = x*2 / suf2
    x = b/l1
    ans = math.degrees(math.atan(x))
else:
    l2 = (vol-x)*2 / (a*a)
    x = l/a2
    ans = math.degrees(math.atan(x))
    
print(round(ans,6))

Buggy submission (verdict: Runtime Error):
mport math

a,b,x = (int(num) for num in input().split())
suf2 = a*b
vol = a*a*b
if (vol/2)>=x:
    l = x*2 / suf2
    x = b/l
    ans = math.degrees(math.atan(x))
else:
    l = (vol-x)*2 / (a*a)
    x = l/a
    ans = math.degrees(math.atan(x))
    
print(round(ans,6))

Buggy submission (verdict: Runtime Error):
import math

a,b,x = (int(num) for num in input().split())
suf2 = a*b
vol = a*a*b
if (vol/2)>=x:
    l = x*2 / suf2
    x = b/l
    ans = math.degrees(math.atan(x))
else:
    l = (vol-x)*2 / (a*a)
    x = a/l
    ans = math.degrees(math.atan(x))
    
print(round(ans,6))

Buggy submission (verdict: Runtime Error):
import math

a,b,x = (int(num) for num in input().split())
suf2 = a*b
vol = a*a*b
if (vol/2)>=x:
    l = x*2 / suf2
    x = b/l
    ans = math.degrees(math.atan(x))
else:
    l = (vol-x) / (a*a)
    x = a/l
    ans = math.degrees(math.atan(x))
    
print(round(ans,6))

Buggy submission (verdict: Runtime Error):
import math
a,b,x = (int(num) for num in input().split())
suf2 = a*b
vol = a*a*b
if (vol/2)>=x:
    l = x*2 / suf2
    x = b/l
    ans = math.degrees(math.atan(x))
else:
    l = (vol-x) / (a*a)
    x = a/l
    ans = math.degrees(math.atan(x))
    
print(ans)
Problem p02952 (python)

Fixed submission:
n = int(input())
cnt = 0
for i in range(1,n+1):
  if (len(str(i))%2==1):
  	cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
cnt = 0
for i in range(1,n):
  if (len(str(i))%2==1)
  	cnt+=1
print(cnt)
Problem p03213 (python)

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

p = [i for i in range(2,N+1)]
q = []

for i in p:
    for j in range(2,i):
        if i%j==0:
            q.append(i)
            break
        
p = list(set(p)-set(q))

def div(n):
    ret=0
    a=math.factorial(N)
    while a%n == 0:
        a//=n
        ret+=1
    return ret

Ans=0

for n in p:
    if div(n)>=74:
        Ans+=1

for n in p:
    if div(n)>=24:
        for m in p:
            if div(m)>=2 and n!=m:
                Ans += 1

        
for n in p:
    if div(n)>=14:
        for m in p:
            if div(m)>=4 and n!=m:
                Ans += 1

for n in p:
    if div(n)>=2:
        for m in p:
            if n!=m and div(m)>=4:
                for l in p:
                    if l!=n and l>m and div(l)>=4:
                        Ans +=1

print(Ans)

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

for i in range(1,M+1):
    if M%i == 0:
        if  M//i >= N:
            ans = i
        else:
            break
    
print(ans)
Problem p02801 (python)

Fixed submission:
list_a=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
c=input()
print(list_a[list_a.index(c)+1])

Buggy submission (verdict: Runtime Error):
list_a=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
c=input()
print(l[l.index(c)+1])
Problem p02885 (python)

Fixed submission:
a, b = map(int,input().split(" "))
if 2*b>=a:
    print("0")
else:
    print(a-2*b)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if 2*b>=a:
    print("0")
else:
    print(a-2*b)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if 2*b>=a:
    print("0")
else:
    print(a-2*b)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if 2*b>=a:
    print("0")
else:
    print(a-2*b)
Problem p02786 (python)

Fixed submission:
n = int(input())
a = []
cur = 1
while cur <= n:
  a.append(cur)
  cur *= 2
print(sum(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
cur = 1
while cur <= n:
  a.append(cur)
  cur *= 2
print(sum(cur))
Problem p02791 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 1
tmp = a[0]
for i in a:
  if i < tmp:
    tmp = i
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input()))
ans = 1
tmp = a[0]
for i in a:
  if i < tmp:
    tmp = i
    ans += 1
print(ans)
Problem p02783 (python)

Fixed submission:
H_str, A_str = input().split(' ')
H = int(H_str)
A = int(A_str)

if H % A == 0:
  print(H // A)
else:
  print(H // A + 1)

Buggy submission (verdict: Runtime Error):
H_str, A_str = input().split('')

print(int(H_str) // int(A_str) + 1)
Problem p02783 (python)

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

i, m = divmod(H, A)

if m != 0:
    i += 1

print(i)

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

H, N = map(int, input().split())
A, B = np.zeros(N, dtype=np.int), np.zeros(N, dtype=np.int)

for i in range(N):
    A[i], B[i] = map(int, input().split())

C = np.zeros(H+1, dtype=np.int)
min_cost_A = int(A[B.argmin()])
C[1:min_cost_A+1] = min(B)
sa = np.zeros(N, dtype=np.int)

def hoggg(C, A, B, i, N):
    for j in range(N):
        if A[j] >= i:
            sa[j] = B[j]
        else:
            sa[j] = C[i - A[j]] + B[j]
    return min(sa)

for i in range(min_cost_A, H+1):
    C[i] = hoggg(C, A, B, i, N)

print(int(C[H]))
Problem p02811 (python)

Fixed submission:
# 高橋君は500円玉をK枚持っています。 これらの総額がX円以上である場合は Yes を、そうでない場合は No を出力してください。
# コマンドライン引数 K X
# 制約　1≤K≤100　1≤X≤10^5

import sys

inp_word = input()

# コマンドライン引数を変数に入れる
K,X = inp_word.split()

# 総額の保持
sum = 500 * int(K)

# 出力文の作成
if sum >= int(X):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
# 高橋君は500円玉をK枚持っています。 これらの総額がX円以上である場合は Yes を、そうでない場合は No を出力してください。
# コマンドライン引数 K X
# 制約　1≤K≤100　1≤X≤10^5

import sys

# コマンドライン引数を変数に入れる
if 1 < len(sys.argv) < 4:
    K = sys.argv[1]
    X = sys.argv[2]

# コマンドライン引数が想定外
else:
    print("引数の指定に誤りがあります")

# 総額の保持
sum = 500 * int(K)

# 出力文の作成
if sum >= int(X):
    print('Yes')
else:
    print('No')
Problem p02813 (python)

Fixed submission:
# 問題文： 大きさ N の順列 ((1, 2, ..., N) を並び替えてできる数列) P, Q があります。大きさ N の順列は N! 通り考えられます。
#         このうち、P が辞書順で a 番目に小さく、Q が辞書順で b 番目に小さいとして、|a−b| を求めてください。
# 注記： 2 つの数列 X, Y について、ある整数 k が存在して Xi=Yi (1≤i<k) かつ Xk<Yk が成り立つとき、X は Y より辞書順で小さいと定義されます。
# 制約: 2≤N≤8　P,Qは大きさNの順列である。入力は全て整数である。

import math

# 数列が何番目かを返却するメソッド
def junban(N, str):
    int_N = int(N)
    int_list = str.split() # 入力文字を配列化
    int_list = [int(i) for i in int_list]
    yet_list = str.split() # まだ出てきていない数字のリスト
    yet_list = [int(i) for i in yet_list]

    num = 1 # 何番目か保持する
    keta = 0 # 上から何桁目か保持する

    while keta < (int_N):
        # 該当桁の数字を確保する
        now_int = int_list[keta]

        # 未出数値のリストを更新する
        yet_list.remove(now_int)

        # 該当桁以下の階乗
   #     print('該当桁以下の桁数は：{}'.format(len(yet_list)))
        # 該当桁の数字より若い数字がいくつ残っているか
    #    print('該当桁の数字より若い数字はあと{}個'.format(len([i for i in yet_list if i < now_int])))

        # 順番をカウント
        # 該当桁以下の階乗 * 未出数値の内、現在より数値の小さいものの個数
        num += math.factorial(len(yet_list)) * len([i for i in yet_list if i < now_int])
        keta += 1

#    print('{}番目'.format(num))
    return num

# 大きさNを受け取る
N = input()
# 数列Pを受け取る
P = input()
# 数列Qを受け取る
Q = input()

# Pが何番目か求める
p_int = junban(N, P)
q_int = junban(N, Q)

print(abs(p_int - q_int))

Buggy submission (verdict: Runtime Error):
# 問題文：長さNの偶数からなる正の整数列A=a1,a2,...,aNと、整数Mが与えられます。
#        任意のk(1≤k≤N)に対して以下の条件を満たす正の整数XをAの「半公倍数」と定義します。
#        X=ak×(p+0.5)を満たす負でない整数pが存在する。
#        1以上M以下の整数のうちのAの半公倍数の個数を求めてください。
# 入力 : 以下の形式で標準入力から与えられる。
#       N M
#       a1 a2 ... aN
# 出力 : 1 以上 M 以下の整数のうちの A の半公倍数の個数を出力せよ。

# 最小半公倍数を求める
def min_hankobaisu(A, M):
    result = 1
    for a in A:
        result = result * a / 2
        if result > M:
            print(0)
            exit(0)
    return int(result)

# 正の整数列Aの長さN, 半公倍数の上限M
N, M = map(int, input().split())

# 正の整数列A
A = list(set(list(map(int, input().split()))))
A.sort(reverse=True)
# hankobaisu_list = []

# 与えられた数値が2*奇数と2*偶数なのであれば半公倍数はない
# → その場で終了
for i in range(0, len(A) - 1):
    if (A[i] / 2 % 2) != (A[i + 1] / 2 % 2):
        print(0)
        exit(0)

# A[i] が2*偶数の場合はだめ？
if (A[0] / 2) % 2 == 0:
    print(0)
    exit(0)

# 半公倍数の最小値を求める
min_hankobaisu = min_hankobaisu(A, M)
#print('最小半公倍数：{}'.format(min_hankobaisu))
print(int(M/min_hankobaisu+1)/2)
Problem p02817 (python)

Fixed submission:
S, T = input().split()
print(T + S)

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


if A + B <= K:
	print(0, 0)
elif A < K:
	print(0, B - (K - A))
else:
	print(K - A, B)

Buggy submission (verdict: Runtime Error):
S, T = map(str, input().split())
print(T + S).split('')
Problem p02783 (python)

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


count = 0

while H > 0:
    H -= A
    count +=1

print(count)

Buggy submission (verdict: Runtime Error):
H = int(input())
A = int(input())
count = 0


while H > 0:
    H -= A
    count +=1
print(count)

Buggy submission (verdict: Runtime Error):
H = int(input())
A = int(input())
count = 0


while H > 0:
    H -= A
    count +=1
else:
    print(count)

Buggy submission (verdict: Runtime Error):
H = input()
A = input()
count = 0


while H > 0:
    H -= A
    count +=1
else:
    print(count)

Buggy submission (verdict: Runtime Error):
H = input()
A = input()
count = 0


while H > A:
    H -= A
    count +=1
else:
    print(count)
Problem p02842 (python)

Fixed submission:
import math

N = int(input())
X = int(N / 1.08)

for X in range(1, N+1):
  if(int(1.08*X) == N):
    print(X)
    exit(0)

print(":(")

Buggy submission (verdict: Runtime Error):
floor(X = input(N / 1.08)
Problem p03369 (python)

Fixed submission:
s = input()
t = 0
for i in range(3):
    if s[i] == 'o':
        t+=1

print(700 + t * 100)

Buggy submission (verdict: Runtime Error):
def price():
    ramen_price = 700
    sa, st, sn = input().split() 
    if sa == 'o':
        ramen_price +=100
    if st == 'o':
        ramen_price +=100
    if sn == 'o':    
        ramen_price +=100
    print(ramen_price)

price()
Problem p02783 (python)

Fixed submission:
H, A = map(int, input().split())
print(int(H/A) if H % A == 0 else int(H/A)+1)

Buggy submission (verdict: Runtime Error):
[H, A] = input().split(" ")
return int(H/A)
Problem p04029 (python)

Fixed submission:
#coding:utf-8
 
value = int(input())
 
gokei = 0
 
for i in range(value):
    gokei += i + 1
    
print(gokei)

Buggy submission (verdict: Runtime Error):
coding: utf-8

value = int(input())

gokei = 0

for i in range(value):
    gokei += i + 1
    
print(gokei)
Problem p03378 (python)

Fixed submission:
Cost0 = 0
CostN = 0
length = 0

listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
X = listA[0][2]

for x in listA:
   length += len(x)

for i in range(length - 3):
    if (listA[1][i] < X):
        Cost0 = Cost0 +1
    else:
        CostN = CostN +1

if (Cost0 < CostN):
    print(Cost0)
else:
    print(CostN)

Buggy submission (verdict: Runtime Error):
Cost0 = 0
CostN = 0

listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
X = listA[0][2]

for x in listA:
   length += len(x)

for i in range(length - 3):
    if (listA[1][i] < X):
        Cost0 = Cost0 +1
    else:
        CostN = CostN +1

if (Cost0 < CostN):
    print(Cost0)
else:
    print(CostN)
Problem p03385 (python)

Fixed submission:
S = input()

chksum = 0
 
if ('a' in S):
    chksum+=1
if ('b' in S):
    chksum+=1
if ('c' in S):
    chksum+=1
    
if chksum == 3:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
S = raw_input()

chksum = 0
 
if ('a' in S):
    chksum+=1
if ('b' in S):
    chksum+=1
if ('c' in S):
    chksum+=1
    
if chksum == 3:
	print("yes")
else:
	print("no")

Buggy submission (verdict: Runtime Error):
S = raw_input()

n_a = S.find('a')
n_b = S.find('b')
n_c = S.find('c')

chksum = n_a + n_b + n_c

if chksum = 0:
	print("yes")
else:
	print("no")
Problem p03387 (python)

Fixed submission:
A,B,C = map(int,input().split())
max_val=(max([A,B,C]))
odd_chk =3 * max_val - A - B - C
if(odd_chk%2 == 0):
         print(int(odd_chk/2))
else:
         print(int((odd_chk+3)/2))

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
max_val=(max([A,B,C]))
odd_chk =3 * max_val - A - B - C
if(odd_chk%2 == 0):
         print("{:.0f}".format(odd_chk/2))
else:
         print("{:.0f}".format(odd_chk+3)/2)
Problem p04043 (python)

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

if a[0] == 5 and a[1] == 5 and a[2] == 7:
  print("YES")
else:
  print("NO")

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

if a[0] == 5:
  if a[1] == 5:
    if a[2] == 7:
      return "YES":

return "NO"
Problem p02783 (python)

Fixed submission:
i = list(map(int, input().split()))
count = 0
if i[0] <= i[1]:
    print("1")
else:
    while i[0] > 0:
        i[0] -= i[1]
        count += 1
    print(count)

Buggy submission (verdict: Runtime Error):
i = list(map(int, input().split()))
count: int = 0
if i[0] <= i[1]:
    print("1")
else:
    while i[0] > 0:
        i[0] -= i[1]
        count += 1
    print(count)
Problem p02801 (python)

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

Buggy submission (verdict: Runtime Error):
print chr(ord(input())+1)
Problem p02786 (python)

Fixed submission:
h = int(input())

def count1(h):
    if(h==0):
        return 0
    if(h==1):
        return 1
    return 1 + 2*count1(h//2)
    
print(count1(h))

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

def count(h):
    if(h==0):
        return 0
    if(h==1):
        return 1
    return 1 + 2*count(h/2)
    
print(count(h))

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

def count(h):
    if(h<=0):
        return 0
    else:
        return 1 + 2*count(h/2)

print(count(h))
Problem p02789 (python)

Fixed submission:
n,m = [int(x) for x in input().split()]
if n==m:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
m,n = [int(x) for x in input().split()]
if m==n:
	print("Yes")
else
	print("No")
Problem p02813 (python)

Fixed submission:
import itertools
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
length = [i+1 for i in range(n)]
permut = list(itertools.permutations(length))
print(max((permut.index(p)) - (permut.index(q)) , (permut.index(q)) - permut.index(p)))

Buggy submission (verdict: Runtime Error):
import itertools
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
length = [i+1 for i in range(n)]
permut = list(itertools.permutations(length))
print(max((permut.index(p)) - (permut.index(q)) , (mm.index(q)) - mm.index(p)))
Problem p02837 (python)

Fixed submission:
n=int(input())
shogen=[]
for _ in range(n):
  a=int(input())
  t=[]
  for __ in range(a):
    s=list(map(int,input().split()))
    t.append(s)
  shogen.append(t)

ans=0

for i in range(2**n):
  flag=True
  for j in range(n):
    if not flag:
      break
    if ((i>>j) & 1):
      for s in shogen[j]:
        if ((i>>s[0]-1)&1) !=s[1]:
          flag=False
  if flag:
    mnt = bin(i).count("1")
    ans=max(ans,mnt)
print(ans)

Buggy submission (verdict: Runtime Error):
ans=0
shogen=[]
n=int(input())
for _ in range(n):
  t=[]
  a=int(input())
  for __ in range(a):
    h=list(map(int,input().split()))
    t.append(s)
  shogen.append(t)
for i in range(2**n):
  flag=True
  for j in range(n):
    if not flag:
      break
    if ((i>>j) & 1):
      for h in shogen[j]:
        if ((i>>h[0]-1)&1) !=h[1]:
          flag=False
  if flag:
    mnt = bin(i).count("1")
    ans=max(ans,mnt)
print(ans)
Problem p02783 (python)

Fixed submission:
import math

H, A = list(map(int, input().split()))

N = math.ceil(H/A)

print(N)

Buggy submission (verdict: Runtime Error):
import sys

H, N = list(map(int, input().split()))
AB = [list(map(int, input().split())) for n in range(N)]

dp = [sys.maxsize for i in range(H+1)]
dp[0] = 0

# 各ダメージ段階の最小値を求める
for i in range(H):
    if dp[i] == sys.maxsize:
        continue
    # 各魔法を使って最小値なら更新
    for j in range(N):
        a = min(i + AB[j][0], H)
        b = dp[i] + AB[j][1]
        if dp[a] > b:
            dp[a] = b

print(dp[H])

Buggy submission (verdict: Runtime Error):
import sys

def use_dp():
    max_a = max([ab[0] for ab in AB])
    dp = [sys.maxsize for i in range(H+max_a)]
    dp[0] = 0

    # 各ダメージ段階の最小値を求める
    for i in range(H):
        if dp[i] == sys.maxsize:
            continue
        # 各魔法を使って最小値なら更新
        for j in range(N):
            a = i + AB[j][0]
            b = dp[i] + AB[j][1]
            if dp[a] > b:
                dp[a] = b

    # H < i < H+max(Ai)の範囲で最小値を求める
    min_mp = sys.maxsize
    for i in range(H, H+max_a):
        min_mp = min(dp[i], min_mp)

    print(min_mp)


if __name__ == '__main__':
    H, N = list(map(int, input().split()))
    AB = []
    for n in range(N):
        AB.append(list(map(int, input().split())))

    use_dp()
Problem p02784 (python)

Fixed submission:
H, N = list(map(int, input().split()))
A_list = list(map(int, input().split()))

win = sum(A_list) >= H
print('Yes' if win else 'No')

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

win: bool = sum(A_list) >= H
print('Yes' if win else 'No')
Problem p02787 (python)

Fixed submission:
import sys

H, N = list(map(int, input().split()))
AB = [list(map(int, input().split())) for n in range(N)]

dp = [sys.maxsize for i in range(H+1)]
dp[0] = 0

# 各ダメージ段階の最小値を求める
for i in range(H):
    if dp[i] == sys.maxsize:
        continue
    # 各魔法を使って最小値なら更新
    for j in range(N):
        a = min(i + AB[j][0], H)
        b = dp[i] + AB[j][1]
        if dp[a] > b:
            dp[a] = b

print(dp[H])

Buggy submission (verdict: Runtime Error):
def use_dp():
    max_a = max([ab[0] for ab in AB])
    dp = [sys.maxsize for i in range(H+max_a)]
    dp[0] = 0

    # 各ダメージ段階の最小値を求める
    for i in range(H):
        if dp[i] == sys.maxsize:
            continue
        # 各魔法を使って最小値なら更新
        for j in range(N):
            a = i + AB[j][0]
            b = dp[i] + AB[j][1]
            if dp[a] > b:
                dp[a] = b

    # H < i < H+max(Ai)の範囲で最小値を求める
    min_mp = sys.maxsize
    for i in range(H, H+max_a):
        min_mp = min(dp[i], min_mp)

    print(min_mp)


if __name__ == '__main__':
    H, N = list(map(int, input().split()))
    AB = []
    for n in range(N):
        AB.append(list(map(int, input().split())))

    use_dp()

Buggy submission (verdict: Runtime Error):
from functools import lru_cache


@lru_cache(maxsize=1000)
def attack(h, mp):
    """
    毎回Nパターン選択肢がある
    最小値を返す
    """
    min_mp = 999999
    for a, b in sorted_ab_list:
        new_h = h - a
        new_mp = mp + b

        if new_mp >= min_mp:
            # 既に最小値超えてたら中断
            continue

        if new_h > 0:
            min_mp = min(min_mp, attack(new_h, new_mp))
        else:
            min_mp = min(min_mp, new_mp)

    # 最小値をとる
    return min_mp


if __name__ == '__main__':
    H, N = list(map(int, input().split()))
    AB_list = []
    for n in range(N):
        a, b = list(map(int, input().split()))
        AB_list.append([a, b])

    sorted_ab_list = sorted(AB_list, key=lambda x: x[0]/x[1], reverse=True)

    print(attack(H, 0))
Problem p02783 (python)

Fixed submission:
h,a = map(int, input().split())
print(-(-h//a))

Buggy submission (verdict: Runtime Error):
h,a = map(int, input().split())
print(h//a if !h%a else h//a + 1)

Buggy submission (verdict: Runtime Error):
h,a = map(int, input().split())
print(int(h/a) if !h%a else int(h/a) + 1)
Problem p02801 (python)

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

Buggy submission (verdict: Runtime Error):
print(chr(ord(input()+1)))
Problem p02811 (python)

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

if 500 * int(k) >= int(x):
    print("Yes")
else:
    print("No")

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

if 500 * int(k) >= int(x):
    print("Yes")
else:
    print("No")

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

if 500 * int(k) >= int(x):
    print("Yes")
else:
    print("No")
Problem p02817 (python)

Fixed submission:
s, t = input().split()
print(t+s)

Buggy submission (verdict: Runtime Error):
    s, t = input().split()
    print(t+s)

Buggy submission (verdict: Runtime Error):
from lib2to3.fixer_util import String
s, t = map(String, input().split())
print(s + t)

Buggy submission (verdict: Runtime Error):
s, t = map(String, input(),split())
	print(s+t)
Problem p02783 (python)

Fixed submission:
def c(i):
    return i

H,A = map(int, input().split())
a,b = map(c,divmod(H,A))
if b==0:
    print(a)
else:
    print(a+1)

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())
T = list(map(int, input().split()))
T.sort()
if K>=N:
    print(0)
else:
    for i in range(K):
        T.pop()
    
    print(sum(T))
Problem p02861 (python)

Fixed submission:
import math
 
def factorial(n):
    if n == 0:
        return 1.0
    else:
        return n*factorial(n-1)
 
 
n = int(raw_input())
k = n
arr = []
while(k > 0):
    x, y = map(int, raw_input().split())
    arr.append((x, y))
    k -= 1
 
total = 0.0
for i in range(n):
    x1 = arr[i][0]
    x2 = arr[i][1]
    for j in range(i+1, n, 1):
        y1 = arr[j][0]
        y2 = arr[j][1]
        dist = (x1-y1)*(x1-y1) + (x2-y2)*(x2-y2)
        dist = float(math.sqrt(dist))
        dist = dist * float((factorial(n-1)*2))
        total += dist * float(1/factorial(n))
 
print total

Buggy submission (verdict: Runtime Error):
def factorial(n):
    if n == 0:
        return 1.0
    else:
        return n*factorial(n-1)


n = int(raw_input())
k = n
arr = []
while(k > 0):
    x, y = map(int, raw_input().split())
    arr.append((x, y))
    k -= 1

total = 0.0
for i in range(n):
    x1 = arr[i][0]
    x2 = arr[i][1]
    for j in range(i+1, n, 1):
        y1 = arr[j][0]
        y2 = arr[j][1]
        dist = (x1-y1)*(x1-y1) + (x2-y2)*(x2-y2)
        print dist
        dist = float(math.sqrt(dist))
        dist = dist * float((factorial(n-1)*2))
        total += dist * float(1/factorial(n))

print total
Problem p02945 (python)

Fixed submission:
s = input().split()
a, b = int(s[0]), int(s[1])
x = [a+b, a-b, a*b]
print(max(x))

Buggy submission (verdict: Runtime Error):
s = input().split()
a, b = s[0], s[1]
x = [a+b, a-b, a*b]
print(max(x))
Problem p02783 (python)

Fixed submission:
class Main:
    s = list(map(int, input().split()))
    h = s[0]
    a = s[1]
    cnt = 0
    if h >= a:
        while h > 0:
            h -= a
            cnt += 1

    else:
        cnt = 1
    print(cnt)

Buggy submission (verdict: Runtime Error):
class Main:
    import math
    H = int(input())
    if H == 1:
        print(1)
    else:
        cnt = int(math.log(H, 2))
        num = 0
        for i in range(cnt+1):
            num += 2 ** i
    print(num)

Buggy submission (verdict: Runtime Error):
class Main:
    import math
    H = int(input())
    if H == 1:
        print(1)
    else:
        cnt = int(math.log(H, 2))
        num = 0
        for i in range(cnt+1):
            num += 2 ** i
            print(num)