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

Fixed submission:
n = int(input())
a = []
b  =[]
for i in range(n):
    A, B = map(int, input().split())
    a.append(A)
    b.append(B)

num = 0
for i in reversed(range(n)):
    a[i] += num
    p = a[i] % b[i]
    if p == 0:
        continue
    p = b[i] - p
    num += p

print(num)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**7)

n = int(input())
rev_g = [[] for _ in range(n+1)]
for i in range(n-1):
    a = int(input())
    rev_g[a].append(i+2)

def f(v):
    m = len(rev_g[v])
    if m == 0:
        return 0
    q = []
    for nv in rev_g[v]:
        q.append(f(nv))
    q.sort()
    dp = [0] * (m+1)
    for i in range(m):
        dp[i+1] = max(q[i]+1, dp[i]+1)
    return dp[m]


print(f(1))
Problem p03822 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**7)

n = int(input())
rev_g = [[] for _ in range(n+1)]
for i in range(n-1):
    a = int(input())
    rev_g[a].append(i+2)

def f(v):
    m = len(rev_g[v])
    if m == 0:
        return 0
    q = []
    for nv in rev_g[v]:
        q.append(f(nv))
    q.sort()
    dp = [0] * (m+1)
    for i in range(m):
        dp[i+1] = max(q[i]+1, dp[i]+1)
    return dp[m]


print(f(1))

Buggy submission (verdict: Runtime Error):
import heapq

n = int(input())
rev_g = [[] for _ in range(n+1)]
for i in range(n-1):
    a = int(input())
    rev_g[a].append(i+2)

def f(v):
    if len(rev_g[v]) == 0:
        return 0
    q = []
    for nv in rev_g[v]:
        heapq.heappush(q, f(nv))
    max_count = 0
    max_num = -1
    while q:
        num = heapq.heappop(q)
        if max_num == num:
            max_count += 1
        else:
            max_num += max_count
            max_count = 0
            if num > max_num:
                max_num = num
            elif num == max_num:
                max_count = 1
            else:
                heapq.heappush(q, max_num)
                max_num = num
                max_count = 0
    return max_num + max_count + 1

print(f(1))

Buggy submission (verdict: Runtime Error):
import heapq

n = int(input())
rev_g = [[] for _ in range(n+1)]
for i in range(n-1):
    a = int(input())
    rev_g[a].append(i+2)

def f(v):
    if len(rev_g[v]) == 0:
        return 0
    q = []
    for nv in rev_g[v]:
        heapq.heappush(q, f(nv))
    max_count = 0
    max_num = 0
    while q:
        num = heapq.heappop(q)
        if num > max_num + max_count:
            max_num = num
            max_count = 0
        elif num == max_num + max_count:
            max_num = num
            max_count = 1
        elif max_num == num:
            max_count += 1
        else:
            max_num += max_count
            if max_num > num:
                heapq.heappush(q, max_num)
                max_num = num
                max_count = 0

    max_num += max_count
    return max_num

print(f(1)+1)
Problem p03839 (python)

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

cum = []
abscum = []

cu = 0
acu = 0
for i in range(n):
    cu += a[i]
    acu += max(0, a[i])
    cum.append(cu)
    abscum.append(acu)

ans = 0
for i in range(n-k+1):
    if i == 0:
        ans = max(ans, abscum[n-1] - abscum[i+k-1] + max(0, cum[i+k-1]))
    else:
        ans = max(ans, abscum[n - 1] - (abscum[i + k - 1] - abscum[i-1]) + max(0, cum[i + k - 1] - cum[i-1]))

print(ans)

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

cum = []
abscum = []

cu = 0
acu = 0
for i in range(n):
    cu += a[i]
    acu += abs(a[i])
    cu.append(cum)
    acu.append(abscum)

ans = 0
for i in range(n-k):
    if i == 0:
        ans = max(ans, abscum[n-1] - abscum[i+k-1] + abs(cum[i+k-1]))
    else:
        ans = max(ans, abscum[n - 1] - (abscum[i + k - 1] - abscum[i-1]) + abs(cum[i + k - 1] - cum[i-1]))
        
print(ans)
Problem p02723 (python)

Fixed submission:
x = input()

if x[2] == x[3] and x[4]==x[5]:
  print("Yes")
else:
  print("No")

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

if x[2] == x[3] && x[4] == x[5]:
  print("Yes")
else:
  print("No")
Problem p02754 (python)

Fixed submission:
N, A, B =[int(x) for x in input().split()]

if A!=0:
    ans = N//(A+B)*A
    mod = N%(A+B)
    plus = min(mod, A)
    c = ans + plus 
else:
    c = 0
print(c)

Buggy submission (verdict: Runtime Error):
N, A, B =[int(x) for x in input().split()]
line = []

for i in range(N/(A+B)):
    for x in range(A):
        line.append("b")
    for y in range(B):
        line.append("r")

print(line[0:N:].count("b"))
Problem p02753 (python)

Fixed submission:
N = list(input())
if N[0] == N[1] == N[2]:
	print("No")
else :
	print("Yes")

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

T = int(N/(A+B))
S = N%(A+B)


if S<A:
	print(T*A+S)
else:
	print(T*A+A)
Problem p02847 (python)

Fixed submission:
S = str(input())
D = ["SUN","MON","TUE","WED","THU","FRI","SAT"] 
print(7-D.index(S))

Buggy submission (verdict: Runtime Error):
S = str(input())
D = ["SUN","MUN","TUE","WED","THU","FRI","SAT"] 
print(7-D.index(S))
Problem p02860 (python)

Fixed submission:
import sys
N = int(input())
# S = list(map(str,input().split()))
S = list(input())
if N % 2 == 0:
	T_1 = S[:int(len(S)/2)]
	T_2 = S[int(len(S)/2):]
	# print(T_1)
	# print(T_2)
	for i in range(len(T_1)):
		if T_1[i] != T_2[i]:
			print("No")
			sys.exit()	
	print("Yes")
	sys.exit()
else:
	print("No")

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
S = list(map(str,input().split()))
if N % 2 == 0:
	T_1 = S[:int(len(S)/2)]
	T_2 = S[int(len(S)/2):]
	for i in range(len(T_1)):
		if T_1[i] != T_2[i]:
	 		print("No")
	 		sys.exit()
		
	 print("Yes")
	 sys.exit()
else:
	print("No")
Problem p02879 (python)

Fixed submission:
A,B = (int(x) for x in input().split())
if A >=10 or B >=10:
	print(-1)
else:
    print(A*B)

Buggy submission (verdict: Runtime Error):

A,B = (int(x) for x in input().split())
if A >=10 or B >:
	print(-1)
else:
    print(A*B)
Problem p02725 (python)

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

box = []
for i in range(N):
    d = abs(A[i-1]-A[i])
    if d>K/2:
        d = K - d
    box.append(d)
print(K-max(box))

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

box = []
for i in range(N):
    d = abs(A[i-1]-A[i])
    if d>K/2:
        d = K - d
    box.append(d)
print(K-max(d))
Problem p02773 (python)

Fixed submission:
n=int(input())
dic = dict()

a = 0
for i in range(n):
    s = str(input())
    if s in dic:
        dic[s] += 1
    else:
        dic[s] = 1
    if dic[s] > a:
        a = dic[s]
box= []
for i in dic:
    if dic[i] == a:
        box.append(i)

ans = sorted(box)
for i in range(len(ans)):
    print(ans[i])

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

a = 0
for i in range(n):
    if s in dic:
        dic[s] += 1
    else:
        dic[s] = 1
    if dic[s] > a:
        a = dic[s]
box= []
for i in dic:
    if dic[i] == a:
        box.append(i)

ans = sorted(box)
for in in range(len(ans)):
    print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
n=int(input())
s = []
for _ in range(n):
    s.append(input())
#print(s)
#s = list(itertools.chain.from_iterable(s))
#print(s)
s_u = list(set(s))
box = []
box.append([s_u[0],s.count(s_u[0])])
for i in range(1,len(s_u)):
    if max(box) < s.count(s_u[i]):
        box.remove(max(box))
        box.append([s_u[i],s.count(s_u[i])])
    elif max(box) == s.count(s_u[i]):
        box.append([s_u[i],s.count(s_u[i])])
            
ans_box = sorted(box)
for i in range(len(ans_box)):
    print(ans_box[i])
Problem p02771 (python)

Fixed submission:
import sys
A, B, C = list(map(str, input().split()))

if A == B and A != C and B != C:
    print("Yes")
elif B == C and B != A and C != A:
    print("Yes")
elif C == A and C != B and A != B:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import sys
N, K = list(map(int, input().split()))
A_N = list(map(int, input().split()))
B = []
b = 0
for i in range(N-1):
    for j in range(N-1):
        if i <= j:
            b = A_N[i] * A_N[j+1]
            B.append(b)
            b = 0
B = sorted(B)
# print(B)
print(B[K-1])
Problem p02777 (python)

Fixed submission:
import sys

Ball = list(map(str, input().split()))
Quantity = list(map(int,input().split()))
U = str(input())

S = Ball[0]
T = Ball[1]
A = Quantity[0]
B = Quantity[1]

if not 1 <= len(S) or not len(S) <= 10:
    print("error:S_length")
    sys.exit()    
if not 1 <= len(T) or not len(T) <= 10:
    print("error:T_length")
    sys.exit()   
if S == T:
    print("error:S==T")
    sys.exit()
if S != U and T != U:
    print("error:S=U or S=T")
    sys.exit()
if not 1<= A or not B <= 10:
    print("error:A,B")
    sys.exit()

if U == S:
    A -= 1
if U == T:
    B -= 1
print(A,B)

Buggy submission (verdict: Runtime Error):
import sys
import collections

N = int(input())
A_i = list(map(int, input().split()))
A_i = [i for i in A_i if 1 <= i and i <= 10**9]

if not 2 <= N or not N <= 2*10**5:
    print("error:N")
    sys.exit()

if len(collections.Counter(A_i)) == len(A_i):
    print("Yes")
else:
    print("No")
Problem p02723 (python)

Fixed submission:
s=input()[2::];print('Yes' if len(set(s[:2]))==1 and len(set(s[2:]))==1 else 'No')

Buggy submission (verdict: Runtime Error):
s=input();
ans =0
for n in set(i for i in s[2::]):
  if s.count(n)==2:
    ans+=1
print('Yes' if ans>1 else 'No'
Problem p02723 (python)

Fixed submission:
S = str(input())
if (S[2]) == (S[3]):
    if (S[4]) == (S[5]):
        print("Yes")
    else:
        print("No")

else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = str(input())
if (S[3]) == (S[4]):
    if (S[5]) == (S[6]):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = str(input())
if (S[3]) == (S[4]):
    if (S[5]) == (S[6]):
        print("Yes")
else:
    print("No")
Problem p02729 (python)

Fixed submission:
import itertools

n,m = map(int, input().split())
print(len(list(itertools.combinations(range(m),2))) + len(list(itertools.combinations(range(n),2))))

Buggy submission (verdict: Runtime Error):
mport itertools

n,m = map(int, input().split())
print(len(list(itertools.combinations(range(m),2))) + len(list(itertools.combinations(range(n),2))))
Problem p02835 (python)

Fixed submission:
num = input().split()
result = list(map(int, num))
if sum(result) >= 22:
    print('bust')
else:
    print('win')

Buggy submission (verdict: Runtime Error):
num1 = int(input())
num2 = int(input())
num3 = int(input())
if num1+num2+num3 >= 22:
    print('bust')
else:
    print('win')
Problem p02836 (python)

Fixed submission:
S = input()
count = 0
first = S[:len(S)//2]
second = S[(len(S)+1)//2:]
if first == reversed(second):
    print(count)
else:
    for i in range(len(first)):
        if first[i] != second[len(second)-i-1]:
            count += 1
    print(count)

Buggy submission (verdict: Runtime Error):
S = input()
count = 0
first = S[:len(S)//2]
second = S[(len(S)+1)//2:]
if first == reversed(second):
    print(count)
else:
    for i in range(len(first)):
        if first[i] != second[len(second)-i-1]:
            count += 1
    print(count
Problem p02766 (python)

Fixed submission:
from math import log, floor
 
n, k = map(int, input().split())
 
print(floor(log(n)/log(k)) + 1)

Buggy submission (verdict: Runtime Error):
from math import log2, floor

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

print(floor(log2(n)/log2(k)) + 1)
Problem p02948 (python)

Fixed submission:
from heapq import heappush, heappop

n, m = map(int, input().split())

w = [[] for _ in range(10**5)]

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

money = 0
l = []
for i in range(m):
  for item in w[i]:
    heappush(l, item * (-1))
  if len(l) == 0:
    continue

  money += heappop(l) * (-1)

print(money)

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

w = [[] for _ in range(10001)]

for i in range(n):
  a, b = map(int, input().split())
  if a == 0:
    continue
  w[a-1].append(b)

money = 0
l = []
for i in range(m):
  l += w[i]
  if len(l) == 0:
    continue

  x = max(l)
  l.remove(x)
  money += x

print(money)

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

w = [[] for _ in range(10001)]

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

money = 0
l = []
for i in range(m):
  l += w[i]
  if len(l) == 0:
    continue

  x = max(l)
  l.remove(x)
  money += x

print(money)

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

w = [[0] for _ in range(10000)]

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

money = 0
l = []
for i in range(m):
  l += w[i]
  if len(l) == 0:
    continue
  
  x = max(l)
  l.remove(x)
  money += x

print(money)

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

w = [[0] for _ in range(10000)]

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

money = 0
l = []
for i in range(m):
  l += w[i]
  x = max(l)
  l.remove(x)
  money += x

print(money)
Problem p02970 (python)

Fixed submission:
from math import ceil

n, d = map(int, input().split())

t = 2 * d + 1

print(ceil(n/t))

Buggy submission (verdict: Runtime Error):
import math import ceil

n, d = map(int, input().split())

t = 2d + 1

print(ceil(n/t))
Problem p02835 (python)

Fixed submission:
a,b,c = map(int,input().split())
if a+b+c>= 22:
  print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
s = input()
arr = [int(i) for i in s.split('')]
result = 0
for j in range(arr):
  result += arr[j]
if(result>=22):
  print("bust")
else:
  print("win")
Problem p03307 (python)

Fixed submission:
i = int(input())

if i % 2 == 0:
    print(i)
else:
    print(i*2)

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

if i % 2 == 0:
    print(i)
else:
    print(i*2)
Problem p02793 (python)

Fixed submission:
import fractions
n=int(input())
l=list(map(int,input().split()))
b=0
c=0
for i in range(n):
    if (i==0):
        b=l[i]
    else:
        b=b*l[i]//fractions.gcd(l[i],b)
for i in range(n):
    c+=b//l[i]
print(c%1000000007)

Buggy submission (verdict: Runtime Error):
from math import gcd
n=int(input())
l=list(map(int,input().split()))
b=0
c=0
for i in range(n):
    if (i==0):
        b=l[i]
    else:
        b=b*l[i]//gcd(l[i],b)
for i in range(n):
    c+=b//l[i]
print(c%1000000007)
Problem p02880 (python)

Fixed submission:
list=[]
for i in range(1,10):
   for j in range(1,10):
      list.append(i*j)
a=int(input())
if a in list:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
list=[]
 for i in range(1,10):
    for j in range(1,10):
      list.append(i*j)
a=int(input())
if a in list:
  print('Yes')
else:
  print('No')
Problem p02777 (python)

Fixed submission:
if __name__ == "__main__":
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()

if U == S:
    A -= 1
else:
    B -= 1
print(A, B)

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
if len(set(A)) == N:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()

if c == a[0]:
  print(b[0]-1)
if U == S:
    A -= 1
else:
    B -= 1
print(A, B)
Problem p02779 (python)

Fixed submission:
if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
if len(A) == len(set(A)):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
  
if len(set(A)) == len(N):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
  
f len(set(A)) == len(A):
    print('Yes')
else:
    print('No')
Problem p02860 (python)

Fixed submission:
n = int(input())
s = input()

if n % 2 != 0:
    print("No")
elif s[0:(n//2)] == s[(n//2):n]:
    print("Yes")
else:
    print("No")

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

if n % 2 != 0:
    print("No")
elif s[0:(n/2)] == s[(n/2):n]:
    print("Yes")
else:
    print("No")
Problem p02725 (python)

Fixed submission:
import numpy as np

K,N = map(int, input().split())
An = list(map(int, input().split()))
arr = np.array(An)
arr = np.diff(arr)
ans = list(arr)
ans.append(K-An[-1]+An[0])
# print(ans)
ans.remove(max(ans))
print(sum(ans))

Buggy submission (verdict: Runtime Error):
import copy

K,N = map(int, input().split())
An = list(map(int, input().split()))
ans = [max(An) - min(An)]
for i in range(len(An)/2,len(An)):
    A_list = copy.copy(An)
    A_list[i] = A_list[i]-K
    ans.append(max(A_list) - min(A_list))
print(min(ans))
Problem p02951 (python)

Fixed submission:
a,b,c=map(int,input().split())
ans = -a+(b+c)
if ans>0:
    print(ans)
else:print(0)

Buggy submission (verdict: Runtime Error):
-a+(b+c)
Problem p02759 (python)

Fixed submission:
n = int(input())
print(int(n/2)+n%2)

Buggy submission (verdict: Runtime Error):
a = [int(j) for i in range(3) for j in input().split(' ')]
n = int(input())
nn = [int(input()) for i in range(n)]

for ni in nn:
  if ni in a:
    a[a.index(ni)] = 0

judge = Yes
if a[4]!=0 and a[2]!=0 and a[6]!=0:
  judge = No
  
print(judge)
Problem p02847 (python)

Fixed submission:
s = str(input())
lst = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

print(7-int(lst.index(s)))

Buggy submission (verdict: Runtime Error):
a, b, x = [int(i) for i in input().split()]
for i in range(1,10):
  n = (x-b*i)/float(a)
  if n<0:
    if i==9:
      print(0)
    continue
  if len(str(int(n)))==i:
    print(int(n)-1)
    break
  elif i==9:
    print(10**9)

Buggy submission (verdict: Runtime Error):
a, b, x = [int(i) for i in input().split()]
for i in range(1,10):
  n = (x-b*i)/float(a)
  if n<0:
    if i==9:
      print(0)
    continue
  if len(str(int(n)))==i:
    print(int(n)+1)
    break
  elif i==9:
    print(10**9)

Buggy submission (verdict: Runtime Error):
a, b, x = [int(i) for i in input().split()]
for i in range(1,10):
  n = (x-b*i)/float(a)
  if n<0:
    if i==9:
      print(0)
    continue
  if len(str(int(n)))==i:
    print(int(n))
    break
  elif i==9:
    print(10**9)
Problem p03011 (python)

Fixed submission:
A = [int(x) for x in input().split()]

print(sum(sorted(A)[:-1]))

Buggy submission (verdict: Runtime Error):
aaaa = input()
A = [int(x) for x in input().split()]


for i in range(len(A)-1):
  s1 = sum(A[:i+1])
  s2 = sum(A[i+1:])
  if s1 >= s2:
    print(abs(s1-s2))
    break

Buggy submission (verdict: Runtime Error):
aaaa = input()
A = [int(x) for x in input().split()]


for i in range(len(A)):
  s1 = sum(A[:i+1])
  s2 = sum(A[i+1:])
  if s1 >= s2:
    print(s1-s2)
    break
Problem p03242 (python)

Fixed submission:
n = str(input())
one_idx = []
nine_idx = []
for idx in range(len(n)):
	if n[idx]=='1':
		one_idx.append(idx)
	if n[idx]=='9':
		nine_idx.append(idx)

out = ''
for idx in range(len(n)):
	if idx in one_idx:
		out += '9'
	if idx in nine_idx:
		out += '1'
          
print(out)

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = str(input()).split(' ')

p1 = [0]*(max([int(i) for i in lst])+1)
p2 = [0]*(max([int(i) for i in lst])+1)
for idx in range(n):
	if idx%2 == 0:
		p1[int(lst[idx])] += 1
	else:
		p2[int(lst[idx])] += 1

pp1 = p1.index(max(p1))
pp2 = p2.index(max(p2))
if pp1 == pp2:
	if max(p1) >= max(p2):
		pp1 = p1.index(max(p1))
		pp2 = p2.index(sorted(p2)[-2])
	elif max(p2) > max(p1):
		pp1 = p1.index(sorted(p1)[-2])
		pp2 = p2.index(max(p2))

cnt1 = 0
cnt2 = 0
for idx in range(n):
	if idx%2 == 0:
		if not lst[idx] == str(pp1):
			cnt1 += 1
	else:
		if not lst[idx] == str(pp2):
			cnt2 += 1

print(cnt1 + cnt2)

Buggy submission (verdict: Runtime Error):
n = int(input())
lst = str(input()).split(' ')

p1 = lst[0]
p2 = lst[1]
new_lst = []
for idx in range(n):
	if idx%2 == 0:
  		new_lst.append(p1)
	else:
		new_lst.append(p2)

cnt = 0
for o, l in zip(lst, new_lst):
	if not o == l:
		cnt +=1
if p1 == p2:
  print(int(n/2))
else:
  print(cnt)

Buggy submission (verdict: Runtime Error):
n = str(input())
one_idx = []
nine_idx = []
for idx in range(n):
	if n[idx]=='1':
		one_idx.append(idx)
    if n[idx]=='9':
		nine_idx.append(idx)

for idx in range(n):
	if idx in one_idx:
		n[idx] = '9'
    if idx in nine_idx:
		n[idx] = '1'
          
print(n)
Problem p03072 (python)

Fixed submission:
n=int(input())
h_list=[int(i) for i in input().split()]
b = 1  # counter
c = 1  # answer
m = h_list[0]  # max height
while b != n:
    if h_list[b] >= m:
        m = h_list[b]
        c += 1
    b += 1
print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
h_list=[int(i) for i in input().split()]
b = 1  # counter
c = 1  # answer
m = h_list[0]  # max height
while b != (n - 1):
    if h_list[b] > m:
        c += 1
    b += 1
print(c)
Problem p02729 (python)

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

print(int((n*(n-1))/2 + ((m*(m-1))/2)))

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

print((n*(n-1))/2 + ((m*(m-1))/2)

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

print((n*(n-1))/2 + ((m*(m-1))/2)
Problem p02831 (python)

Fixed submission:
import sys

if sys.platform =='ios':
	sys.stdin=open('input_file.txt')
	
#+++++
import fractions
a,b = map(int, input().split())
#n = int(input().strip())
#s,t=input().split(' ')
ans = a*b//fractions.gcd(a,b)
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
	sys.stdin=open('input_file.txt')
	
#+++++
import math
a,b = map(int, input().split())
#n = int(input().strip())
#s,t=input().split(' ')
ans = a*b//math.gcd(a,b)
print(ans)
Problem p02723 (python)

Fixed submission:
S = input()
if S[2] == S[3]:
    if S[4] == S[5]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S[] = input()
if S[2] == S[3]:
    if S[4] == S[5]:
        print(Yes)
    else:
        print(No)
else:
    print(No)
Problem p02725 (python)

Fixed submission:
K, N = map(int, input().split())
A = list(map(int, input().split()))
max = 0
for i in range(N):
    len = 0
    if i == 0:
        len = int(A[i] + (K - A[N - 1]))
    else:
        len = int(A[i] - A[i - 1])

    if len > max:
        max = len

print(K - max)

Buggy submission (verdict: Runtime Error):
K = int(input())
N = int(input())
A = {}
for i in range(N):
    A[i] = int(input())
max = 0
for i in range(N):
    len = 0
    if i == 0:
        len = int(A[i] + (K - A[N - 1]))
    else:
        len = int(A[i] - A[i - 1])

    if len > max:
        max = len

print(K - max)
Problem p02753 (python)

Fixed submission:
S = input()

if S[0] == S[1] and S[1] == S[2]:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
S = input().split()

if S[0] == S[1] and S[1] == S[2]:
    print("No")
else:
    print("Yes")
Problem p02831 (python)

Fixed submission:
#!/usr/bin/env python3
import fractions
def main():
    A,B = map(int, input().split())
    print((A*B) // fractions.gcd(A,B))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import math
def main():
    A,B = map(int, input().split())
    print((A*B) // math.gcd(A,B))


if __name__ == "__main__":
    main()