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

Fixed submission:
n,m,c=map(int,input().split())
B=list(map(int,input().split()))
A=[list(map(int, input().split()))for i in range(n)]
cnt = 0
for i in range(n):
  total = 0
  for j in range(m):
    total += B[j] * A[i][j]
  total += c
  if total > 0:
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n,m,c=map(int,input().split())
B=list(map(int,input().split()))
A=[list(map(int, input().split()))for i in range(n)]
cnt = 0
for i in range(n):
  total = 0
  for j in range(m):
    total += b[j] * a[i][j]
  total += c
  if total > 0:
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n, m, c = map(int, input().split()
B = list(map(int, input().split()))
A = [list(map(int, input().split()))for i in range(n)]
cnt = 0
for i in range(n):
  total = 0
  for j in range(m):
    total += b[j] * a[i][j]
  total += c
  if total > 0:
    cnt += 1
print(cnt)
Problem p02684 (python)

Fixed submission:

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


s = []
ord = [-1] * (n+1)

v = 1
c = 1
l = 0
while ord[v] == -1:
    ord[v] = len(s)
    s.append(v)
    v = a[v-1]
c = len(s) - ord[v]
l = ord[v]

if l > k:
    print(s[k])
else:
    k -= l
    k %= c
    print(s[l+k])

Buggy submission (verdict: Runtime Error):

n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(n):
    a[i] -= 1

loop = [0]
loop_corr = []
while len(loop) < k:
    curr = loop[len(loop) - 1]
    if a[curr] not in set(loop):
        loop.append(a[curr])
        # print(loop)
    else:
        loop_corr = loop[loop.index(a[curr]):len(loop)]
        break
        # loop_idx.append(loop.index(a[curr]))
        # loop_idx.append(len(loop)-1)


# print(loop)
# print(loop_corr)
if len(loop) > k:
    print(loop[k]+1)
else:
    diff = k - len(loop) + 1
    mod = (diff % len(loop_corr)) -1
    # print(diff)
    # print(mod)
    print(loop_corr[mod]+1)

Buggy submission (verdict: Runtime Error):

n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(n):
    a[i] -= 1

loop = [0]
loop_corr = []
while len(loop) < k:
    curr = loop[len(loop) - 1]
    if a[curr] not in loop:
        loop.append(a[curr])
        # print(loop)
    else:
        loop_corr = loop[loop.index(a[curr]):len(loop)]
        break

if len(loop) > k:
    print(loop[k]+1)
else:
    diff = k - len(loop) + 1
    mod = (diff % len(loop_corr)) -1
    print(loop_corr[mod]+1)
Problem p02681 (python)

Fixed submission:
#!/usr/bin/env python3

s = input()
t = input()

le = len(s)

if t[0:le] == s:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

n, k = map(int, input().split())
A = list(map(int, input().split()))
a = [0]*n
b = A[0]
per = []
tes = -1

if n >= k:
    for _ in range(k-1):
        b = A[b-1]
    print(b)
    exit()

for _ in range(k*k):
    a[b-1] += 1
    tes += 1
    if 3 in a:
        tes -= len(per)*2
        break
    if 2 in a:
        per.append(b)
    b = A[b-1]

_len = len(per)

ans = (k - tes) % _len

print(per[ans-1])
Problem p02684 (python)

Fixed submission:
#!/usr/bin/env python3

N, K = map(int, input().split())
A = [int(a) - 1 for a in input().split()]

if K <= N:
    p = 0
    for _ in range(K):
        p = A[p]
    print(p + 1)
    exit()

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

d = i - t[p]
K -= i
K %= d

for i in range(K):
    p = A[p]
print(p + 1)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

n, k = map(int, input().split())
A = list(map(int, input().split()))
a = [0]*n
b = A[0]
per = []
tes = -1

if n <= k:
    for _ in range(k-1):
        b = A[b-1]
    print(b)
    exit()

for _ in range(k+1):
    a[b-1] += 1
    tes += 1
    if 3 in a:
        tes -= len(per)*2
        break
    if 2 in a:
        per.append(b)
    b = A[b-1]

_len = len(per)

ans = (k - tes) % _len

print(per[ans-1])
Problem p02945 (python)

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

plus = A + B
minus = A - B
cross = A * B
test = [plus, minus, cross]
print(max(test))

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

plus = A + B
minus = A - B
cross = A * B

if plus >= minus:
	if plus >= cross:
		print(plus)
    else:
		print(cross)
else:
	print(minus)

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

plus = A + B
minus = A - B
cross = A * B

if plus >= minus:
	if plus >= cross:
      print(plus)
    else:
      print(cross)
else:
	print(minus)
Problem p03852 (python)

Fixed submission:
#!/usr/bin/env python3

lis = ["a", "e", "i", "o", "u"]

if input() in lis:
    print("vowel")
else:
    print("consonant")

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

lis = [a, e, i, o, u]

if input() in lis:
    print("vowel")
else:
    print("consonant")
Problem p04011 (python)

Fixed submission:
#!/usr/bin/env python3

n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n <= k:
    print(n*x)
else:
    print(k*x + (n-k)*y)

Buggy submission (verdict: Runtime Error):
lis = [int(input()) for _ in range(3)]

print(lis[1]*lis[2] + (lis[0]-lis[1])*lis[3])
Problem p03160 (python)

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

cost = [0] * (n + 1)
cost[0] = 0
cost[1] = abs(h[1] - h[0])

for i in range(2, n):
  cost1 = cost[i-2] + abs(h[i] - h[i-2])
  cost2 = cost[i-1] + abs(h[i] - h[i-1])
  cost[i] = min(cost1, cost2)
print(cost[n-1])

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

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

memo = [-1] * n
def cost(i):
    if i == 0:
        return 0
    elif i == 1:
        return abs(h[i]-h[i-1])
    else:
        if memo[i-1] == -1:
            return min(cost(i-1)+abs(h[i-1]-h[i]), cost(i-2)+abs(h[i-2]-h[i]))
print(cost(n-1))

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

memo = [-1] * n
def cost(i):
  if i == 0:
    memo[i] = 0
  elif i == 1:
    memo[i] = abs(h[1] - h[0])
  else:
    if memo[i] == -1:
      cost1 = cost(i-2) + abs(h[i] - h[i-2])
      cost2 = cost(i-1) + abs(h[i] - h[i-1])
      memo[i] = min(cost1, cost2)
  return memo[i]
print(cost(n-1))

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

memo = [-1] * n
def cost(i):
  if i == 0:
    return 0
  elif i == 1:
    return abs(h[1] - h[0])
  else:
    if memo[i] == -1:
      cost1 = cost(i-2) + abs(h[i] - h[i-2])
      cost2 = cost(i-1) + abs(h[i] - h[i-1])
      memo[i] = min(cost1, cost2)
    return memo[i]
print(cost(n-1))

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

memo = [-1] * (n + 1)
def cost(i):
  if i == 0:
    return 0
  elif i == 1:
    return abs(h[1] - h[0])
  else:
    if memo[i] == -1:
      cost1 = cost(i-2) + abs(h[i] - h[i-2])
      cost2 = cost(i-1) + abs(h[i] - h[i-1])
      memo[i] = min(cost1, cost2)
    return memo[i]
print(cost(n-1))
Problem p02706 (python)

Fixed submission:
n, m = map(int, input().split())
a = sum([int(i) for i in input().split()])

print(n-a if n-a>=0 else '-1')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input())
a = sum([int(i) for i in input().split()])

print(n-a if n-a>=0 else '-1')
Problem p02988 (python)

Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]

count = 0

for i in range(n-2):
    if p[i] <= p[i+1] < p[i+2] or p[i+2] <= p[i+1] < p[i] or (p[i] == p[i+2] and p[i+1] < p[i]):
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
s = sorted(input())

if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
    print('Yes')
else:
    print('No')
Problem p02696 (python)

Fixed submission:
import math


nums = [int(e) for e in input().split()]

a = nums[0]
b = nums[1]
n = nums[2]

max_score = -1
score = -1

# for x in range(1, n+1):
#     score = math.floor(a*x/b) - a* math.floor(x/b)
#     if max_score < score:
#         max_score = score
#     elif x > b:
#         break

if b > n:
    max_score = math.floor(a*n/b)
else:
    max_score = math.floor(a*(b-1)/b)

print(max_score)

Buggy submission (verdict: Runtime Error):
import math


nums = [int(e) for e in input().split()]

a = nums[0]
b = nums[1]
n = nums[2]

max_score = -1
score = -1

while True:
    score = math.floor(a*x/b) - a* math.floor(x/b)
    if max_score < score:
        max_score = score
    elif x > n:
        break

print(max_score)
Problem p02853 (python)

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

list = [500000,300000,200000,100000,0]

if(A>3):
    A = 4
if(B>3):
    B = 4
elif(A==1 and B==1):
    A=B=0
money = list[A]+list[B]
print(money)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
list = [500000,300000,200000,100000,0]
if(A>3):
    A = 4
elif(B>3):
    B = 4
elif(A==1 and B==1):
    A=B=0
money = list[A]+list[B]
print(money)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
list = [300000,200000,100000,0]
if(A>3 or A<0):
    A = 4
elif(B>3 or B<0):
    B = 4
money = list[A-1]+list[B-1]
if(A==1 and B==1):
    money = 1000000
print(money)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
list = [300000,200000,100000,0]
if(A>3):
    A = 4
elif(B>3):
    B = 4
money = list[A-1]+list[B-1]
if(A==1 and B==1):
    money = 1000000
print(money)

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

list = [300000,200000,100000,0]

if(A>3):
    A = 4
elif(B>3):
    B = 4

money = list[A-1]+list[B-1]


if(A==1 and B==1):
    money = 1000000

print(money)
Problem p02885 (python)

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

if(A-B*2>0):
    print(A-B*2)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())if(A-B*2>0):print(A-B*2)else:print(0)
Problem p02899 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split(" ")))
dic = {}
i = 0
for a_s in a:
    dic.setdefault(i, a_s)
    i += 1
for k, v in sorted(dic.items(), key=lambda x: x[1]):
    print(k + 1)

Buggy submission (verdict: Runtime Error):
n = int(input())a = list(map(int, input().split(" ")))i = 0list = []for a_s in a:list.insert(0, (a.index(n - i) + 1))i += 1print(*list)

Buggy submission (verdict: Runtime Error):
n = int(input())a = list(map(int, input().split(" ")))i = 0list = []for a_s in a:list.insert(0, x = a.index(n - i) + 1)i += 1print(*list)
Problem p03624 (python)

Fixed submission:
import sys
S = sorted(set(input()))

alp = ['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']

for i in range(len(alp)):
  if (i>len(S)-1):
    print(alp[i])
    sys.exit()
  elif S[i] != alp[i]:
    print(alp[i])
    sys.exit()

print('None')

Buggy submission (verdict: Runtime Error):
import sys
S = sorted(set(input()))

alp = ['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']

for i in range(len(alp)):
  if S[i] != alp[i]:
    print(alp[i])
    sys.exit()

print('None')
Problem p03680 (python)

Fixed submission:
import sys
input = sys.stdin.readline


N = int(input().rstrip())
a_dict = {}
for i in range(N):
  a_dict[i+1] = int(input().rstrip())

target = 1
next_target = a_dict[target]
cont = True
ans = 0

if next_target == 2:
  cont = False
  ans += 1

while cont:
  target = next_target
  next_target = a_dict[target]
  ans += 1
  del a_dict[target]
  if next_target not in a_dict:
    ans = -1
    cont = False
  elif next_target == 2:
    ans += 1
    cont = False
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline


N = int(input().rstrip())
a_dict = {}
for i in range(N):
  a_dict[i+1] = int(input().rstrip())

target = 1
next_target = a_dict[target]
cont = True
ans = 0

while cont:
  del a_dict[target]
  target = next_target
  next_target = a_dict[target]
  ans += 1
  if next_target not in a_dict:
    ans = -1
    cont = False
  elif next_target == 2:
    ans += 1
    cont = False

print(ans)
Problem p04001 (python)

Fixed submission:
def dfs(i, f):
    if i == n - 1:
        return sum(list(map(int, f.split("+"))))

    # 式 f の末尾に "+" を追加するかしないかして次の数字を追加
    return dfs(i + 1, f + s[i + 1]) + \
           dfs(i + 1, f + "+" + s[i + 1])


s = input()
n = len(s)

print(dfs(0, s[0]))

Buggy submission (verdict: Runtime Error):
def dfs(i, f):
    if i == n - 1:
        return sum(list(map(int, f.split("+"))))
    return dfs(i + 1, f + s[i + 1]) + dfs(i + 1, f + "+" + s[i + 1])s
s = input()
n = len(s)

print(dfs(0, s[0]))
Problem p02730 (python)

Fixed submission:
s = input()
if s == s[::-1]:
    flag = True
else:
    flag = False
N = len(s)
if flag:
    new = s[0:int((N-1)/2)]
    if new == new[::-1]:
        flag = True
    else: flag = False

if flag:
    new = s[int((N+2)/2):N]
    if new == new[::-1]:
        flag = True
    else:
        flag = False

if flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
L = int(input())/3
print(L**3)
Problem p02783 (python)

Fixed submission:
import math

H, A = [int(x) for x in input().split()]
print(math.ceil(H/A))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
Hs = map(int,input().split())
print(sum(sorted(Hs, reverse=True)[K::]))

Buggy submission (verdict: Runtime Error):
h = int(input())
result, i = 0, 1
while h > 0:
    h //= 2
    result += i
    i *= 2
    
print(result)
Problem p02700 (python)

Fixed submission:
def solve():
    items=list(input().split())
    T_health=int(items[0])
    T_strength=int(items[1])
    A_health=int(items[2])
    A_strength=int(items[3])
    while(T_health>0 and A_health>0):
        A_health-=T_strength
        if(A_health>0):
            T_health-=A_strength
    if(T_health<=0):
        print("No")
    if(A_health<=0):
        print("Yes")
    return
solve()

Buggy submission (verdict: Runtime Error):
items=list(input().split())
    T_health=int(items[0])
    T_strength=int(items[1])
    A_health=int(items[2])
    A_strength=int(items[3])
    while(T_health>0 and A_health>0):
        A_health-=T_strength
        if(A_health>0):
            T_health-=A_strength
    if(T_health<=0):
        print("No")
    if(A_health<=0):
        print("Yes")

Buggy submission (verdict: Runtime Error):
items=list(input.split())
    T_health=int(items[0])
    T_strength=int(items[1])
    A_health=int(items[2])
    A_strength=int(items[3])
    while(T_health>0 and A_health>0):
        A_health-=T_strength
        if(A_health>0):
            T_health-=A_strength
    if(T_health<=0):
        print("No")
    if(A_health<=0):
        print("Yes")
Problem p02789 (python)

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

print("Yes") if M == N else print("No")

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
print("Yes") if n == M else print("No")
Problem p03423 (python)

Fixed submission:
x=int(input())
print(x//3)

Buggy submission (verdict: Runtime Error):
x=int,input()
print(x//3)
Problem p03543 (python)

Fixed submission:
a,b,c,d=map(int,input())
print('Yes' if a==c==b or b==c==d else 'No')

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split(''))
print('Yes' if a==c==b or b==c==d else 'No')
Problem p03635 (python)

Fixed submission:
n,m = input().split()

n = int(n)
m = int(m)


print((m-1)*(n-1))

Buggy submission (verdict: Runtime Error):
n,m = input().split()

int(n)
int(m)


print((m-1)*(n-1))

Buggy submission (verdict: Runtime Error):
n,m = input().split()

int(n)
int(m)


print(m*n)

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


print(m*n)

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

print(m*n)
Problem p03729 (python)

Fixed submission:
a,b,c=input().split()
print('YES' if a[-1]==b[0] and b[-1]==c[0] else 'NO')

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
print('YES' if a[-1]==b[1] and b[-1]==c[1] else 'NO')

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
print('YES' if a[::-1]==b[1] and b[::-1]==c[1] else 'NO')
Problem p02677 (python)

Fixed submission:
import math
t = input().split()
t = [int(i) for i in t]
r = math.sqrt(t[0]*t[0]+ t[1]*t[1])
h = t[2]
m = t[3]
if (h == 12):
    h = 0
if (m == 60):
    m = 0
hour_angle = 0.5 * (h * 60 + m) 
minute_angle = 6 * m 
angle = abs(hour_angle - minute_angle) 
angle = min(360 - angle, angle)
print(math.sqrt(r*r - 2*t[0]*t[1]*math.cos(angle*(2*math.pi/360))))

Buggy submission (verdict: Runtime Error):
import math
t = input().split()
t = [int(i) for i in t]
r = math.sqrt(t[0]*t[0]+ t[1]*t[1])
h = t[2]
m = t[3]
if (h == 12):
    h = 0
if (m == 60):
    m = 0
hour_angle = 0.5 * (h * 60 + m) 
minute_angle = 6 * m 
angle = abs(hour_angle - minute_angle) 
angle = min(360 - angle, angle)
print(math.sqrt(r*r - 2*t[0]t[1]*math.cos(angle(2*math.pi/360))))
Problem p02687 (python)

Fixed submission:
S = input()

if S[1] == 'B':
  print('ARC')

if S[1] == 'R':
  print('ABC')

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

for i in range(K):
  d = int(input())
  a = list(map(int, input().split()))
  A.append(a)

ref = A[0]

for i in range(1, K):
  ref = list(set(ref) & set(A[i])) + list(set(ref) ^ set(A[i]))

len = len(ref)

print(N - len)
Problem p02730 (python)

Fixed submission:
S = input()
N = len(S)
kai = []
kai2 = []
kai3 = []
rev = []
rev2 = []
rev3 = []

for i in range(N):
  kai.append(S[i])

for i in range(0, int((N - 1) / 2)):
  kai2.append(S[i])

for i in range(int((N + 3) / 2) - 1, N):
  kai3.append(S[i])

kai.reverse()
kai2.reverse()
kai3.reverse()

for i in range(N):
  rev.append(S[i])

for i in range(0, int((N - 1) / 2)):
  rev2.append(S[i])

for i in range(int((N + 3) / 2) - 1, N):
  rev3.append(S[i])

if kai == rev:
  if kai2 == rev2:
    if kai3 == rev3:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S = input()
N = len(S)
kai = []
kai2 = []
kai3 = []

for i in range(N):
  kai.append(S[i])

for i in range(1, ((N - 1) / 2 + 1)):
  kai2.append(S[i])

for i in range(((N + 3) / 2), N + 1):
  kai3.append(S[i])

rev = kai.reverse
rev2 = kai2.reverse
rev3 = kai3.reverse

if kai == rev:
  if kai2 == rev2:
    if kai3 == rev3:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S = input()
N = len(S)
kai = []
kai2 = []
kai3 = []

for i in range(N):
  kai.append(S[i])

for i in range(1, ((N - 1) / 2 + 1)):
  kai2.append(S[i])

for i in range(((N + 3) / 2), N + 1):
  kai3.append(S[i])

rev = kai.reverse
rev2 = kai2.reverse
rev3 = kai3.reverse

if kai == rev:
  if kai2 = rev2:
    if kai3 = rev3:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')
Problem p02741 (python)

Fixed submission:
K = int(input())
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]

print(l[(K-1)])

Buggy submission (verdict: Runtime Error):
K = int(input())
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]

print(l[K])

Buggy submission (verdict: Runtime Error):
K = int(input())
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]

print(l[K])
Problem p02742 (python)

Fixed submission:
H, M = map(int,input().split())
l = [H, M]

max = max(l)
min = min(l)

if min == 1:
  N = 1
  
else:
  if max == min:
    if max % 2 == 0:
      N = (H * M) / 2
    else:
      N = (((H * M) - 1)/2)+1

  else:
    r = max - min
    r2 = max - r
    r3 = r * min
    if r2 % 2 == 0:
      n1 = (r2 * r2) / 2
    else:
      n1 = (((r2 * r2) - 1)/2)+1
 
    if r3 % 2 == 0:
      n2 = r3 / 2
    else:
      n2 = (r3 - 1) / 2

    N = n1 + n2
    
print(int(N))

Buggy submission (verdict: Runtime Error):
H, M = map(int,input().split())
l = [H, M]

max = max(l)
min = min(l)

if max == min:
  if max % 2 == 0:
    N = (H * M) / 2
  else:
    N = ((H * M) - 1)/2)+1

else:
  r = max - min
  r2 = max - r
  r3 = r * min
  if r2 % 2 == 0:
    n1 = (r2 * r2) / 2
  else:
    n1 = (((r2 * r2) - 1)/2)+1
 
  if r3 % 2 == 0:
    n2 = r3 / 2
  else:
    n2 = (r3 - 1) / 2

  N = n1 + n2

print(N)

Buggy submission (verdict: Runtime Error):
H, M = map(int,input().split())
l = [H, M]

max = max(l)
min = min(l)

if max == min:
  if max % 2 == 0:
    N = (H * M) / 2
  else:
    N = ((H * M) - 1)/2)+1

else:
  r = max - min
  r2 = max - r
  r3 = r * min
  if r2 % 2 == 0:
    n1 = (r2 * r2) / 2
  else:
    n1 = (((r2 * r2) - 1)/2)+1
 
  if r3 % 2 == 0:
    n2 = r3 / 2
  else:
    n2 = (r3 - 1) / 2

  N = n1 + n2

print(N)
Problem p02743 (python)

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

if m <= 0:
  print('No')

else:
  X = (m * m) - (4 * a * b)
  if X > 0:
    print('Yes')
  else:
    print('No')

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

if m <= 0:
 　print('No')

else:
  X = ((c - a - b)^2) - (4 * a * b)
  if X > 0:
    print('Yes')
  else:
    print('No')
Problem p02747 (python)

Fixed submission:
h = input()
l = len(h)
n = 0
hitachi = False

if l % 2 == 1:
  hitachi = False
  
else:
  m = int(l / 2)
  for i in range(m):
    if h[(2 * i)] == "h":
      n += 1
    if h[(2 * i)+1] == "i":
      n += 1
  
  if n == l:
    hitachi = True
  else:
    hitachi = False
    
if hitachi:
  print("Yes")
else:
  print("No")

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

la = list(map(int, input().split()))
lb = list(map(int, input().split()))

d = []
for i in range(M):
  d.append(list(map(int, input().split())))
           
for i in range(M):
  d[i] = la[(d[i][0]-1)] + lb[(d[i][1]-1)] - d[i][2]
  
o = min(la) + min(lb)
d.append(o)

print(min(d))

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

la = list(map(int, input().split()))
lb = list(map(int, input().split()))

d = []
for i in range(M):
  d.append(list(map(int, input().split())))
           
for i in range(M):
  d[i] = la[(d[i][0]-1)] + lb[(d[i][1]-1)] - d[i][2]

print(min(d))

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

la = list(map(int, input().split()))
lb = list(map(int, input().split()))

d = []
for i in range(M):
  d.append(list(map(int, input().split())))
           
for i in range(M):
  d[i] = la[(d[i][0]-1)] + lb[(d[i][1]-1)] - d[i][2]

print(min(d))
Problem p02885 (python)

Fixed submission:
MK = input()
mado = int(MK.split(" ")[0])
katen = int(MK.split(" ")[1])
 
n = mado - (katen*2)
 
if n >= 0:
  print(n)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = int(input())
L = list(map(int, input().split()))
tri = 0
ran = list(range(N-2))

for i in ran:
    for j in ran:
        for k in range(N-2-i-j):
            if ((L[i] + L[i+j+1]) > L[i+j+k+2]) and ((L[i] + L[i+j+k+2]) > L[i+j+1]) and ((L[i+j+k+2] + L[i+j+1]) > L[i]):
                tri += 1
print(tri)

Buggy submission (verdict: Runtime Error):
mado = int(input())
ka-ten = int(input())
 
n = mado - (ka-ten*2)
 
if n >= 0:
  print(n)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
mado = input()
ka-ten = input()

n = mado - (ka-ten*2)

if n >= 0:
  print(n)
else:
  print(0)
Problem p02909 (python)

Fixed submission:
W = input()
 
if W[0] == "S":
  print("Cloudy")
elif W[0] == "C":
  print("Rainy")
else:
  print("Sunny")

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

if W[0] == "S":
  print("Cloudy")
else if W[0] == "C":
  print("Rainy")
else:
  print("Sunny")
Problem p02706 (python)

Fixed submission:
n,m = map(int,input().split())
a = list(map(int,input().split()))
s = sum(a)
if s>n:
    print(-1)
else:
    print(n-s)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
print("{0:.20f}".format(2*n*math.pi))