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

Fixed submission:
import heapq

N, M =map(int, input().split())
A = list(map(int, input().split()))
A.sort()
reversed_A = [n * (-1) for n in A]
heapq.heapify(reversed_A)
for i in range(M):
    max_value = heapq.heappop(reversed_A) * (-1)
    half_value = max_value // 2
    heapq.heappush(reversed_A, (-1)*half_value)

discount_prices = [n * (-1) for n in reversed_A]
ans = sum(discount_prices)
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
for i in range(M):
    A[-1] //= 2
    for j in range(M):
        if A[j] > A[-1]:
            A[j], A[-1] = A[-1], A[j]
            break
ans = sum(A)
print(ans)
Problem p02987 (python)

Fixed submission:
S = list(input())
Ss = set(S)
count2 = 0
for alp in Ss:
    if S.count(alp) == 2:
        count2 += 1
if count2 == len(Ss):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = int(input())
print(S)
Problem p03042 (python)

Fixed submission:
S = int(input())
A = S // 100
B = S % 100
MMA = False
MMB = False
if 1 <= A and A <= 12:
  MMA = True
if 1 <= B and B <= 12:
  MMB = True

if MMA and MMB:
  print('AMBIGUOUS')
elif MMA and not(MMB):
  print('MMYY')
elif not(MMA) and MMB:
  print('YYMM')
else:
  print('NA')

Buggy submission (verdict: Runtime Error):
S = int(input())
A = S // 100
B = S % 100
MMA = False
MMB = False
if 1 <= A and A <= 12:
  MMA = True
if 1 <= B and B <= 12:
  MMB = True

if MMA and MMB:
  print(AMBIGUOUS)
elif MMA and not(MMB):
  print('MMYY')
elif not(MMA) and MMB:
  print('YYMM')
else:
  print('NA')
Problem p02623 (python)

Fixed submission:
M,N,K = [int(hoge) for hoge in input().split()]
A = [int(hoge) for hoge in input().split()]
B = [int(hoge) for hoge in input().split()]
S = 0
Abook = 0
Bbook = 0
curbook = 0
for a in A:
    if S + a <= K:
        Abook += 1
        curbook += 1
        S += a
    else:
        break
nextB = 0
for n,b in enumerate(B):
    if S + b <= K:
        Bbook += 1
        curbook += 1
        S += b
    else:
        nextB = n
        break
if Abook == len(A) and Bbook == len(B):
    print(len(A) + len(B))
    exit()

ans = curbook
for i in range(Abook):
    Abook -= 1
    curbook -= 1
    S -= A[Abook]
    for b_index in range(nextB,len(B)):
        if S + B[b_index] <= K:
            Bbook += 1
            curbook += 1
            S += B[b_index]
            nextB += 1
        else:
            nextB = b_index
            break
    ans = max(ans,curbook)
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
M,N,K = [int(hoge) for hoge in input().split()]
A = [int(hoge) for hoge in input().split()]
B = [int(hoge) for hoge in input().split()]
S = 0
Abook = 0
Bbook = 0
curbook = 0
for a in A:
    if S + a <= K:
        Abook += 1
        curbook += 1
        S += a
nextB = 0
for n,b in enumerate(B):
    if S + b <= K:
        Bbook += 1
        curbook += 1
        S += b
    else:
        nextB = n
        break
ans = curbook

for i in range(Abook):
    Abook -= 1
    curbook -= 1
    S -= A[Abook]
    for b_index in range(nextB,len(B)):
        if S + B[b_index] <= K:
            Bbook += 1
            curbook += 1
            S += B[b_index]
        else:
            nextB = b_index
            break
    ans = max(ans,curbook)
print(ans)
Problem p02629 (python)

Fixed submission:
# Python program to find Excel column name from a  
# given column number 
  
MAX = 50
  
# Function to print Excel column name  
# for a given column number 
def printString(n): 
  
    # To store result (Excel column name) 
    string = [" "] * MAX
  
    # To store current index in str which is result 
    i = 0
  
    while n > 0: 
        # Find remainder 
        rem = n % 26
  
        # if remainder is 0, then a  
        # 'Z' must be there in output 
        if rem == 0: 
            string[i] = 'Z'
            i += 1
            n = (n // 26) - 1
        else: 
            string[i] = chr((rem - 1) + ord('a')) 
            i += 1
            n = n // 26
    string[i] = ' '
  
    # Reverse the string and print result 
    string = string[::-1] 
    return(string)

T = printString(int(input()))
V = [t.lower() for t in T if t != " "]
print("".join(V))

Buggy submission (verdict: Runtime Error):
twesix = [26**i for i in range(1,20)] 

alphabet = "abcdefghijklmnopqrstuvwxyz"
N = int(input())
cur = 0
for n,t in enumerate(twesix):
    cur += t
    if cur >= N :
        keta = n+1
        break

for k in range(keta-1):
    N -= twesix[k]
#print(N)
K = list(reversed([26**k for k in range(keta)]))
ans = []
for k in K[:keta-1]:
   # print(N,k,N//k)
    Q = N//k
    N %= k
    ans.append(alphabet[Q])
ans.append(alphabet[N-1])
print("".join(ans))
Problem p02984 (python)

Fixed submission:
N=int(input())
A = [int(i) for i in input().split()]
Rzero = sum(A)
#雨[0]を求める
for i in range(1,N,2):
    Rzero -= A[i]*2
Rain = [0]*N
Rain[0] = Rzero
for i in range(1,N):
    Rain[i] = (2*A[i-1] - Rain[i-1])
print(*Rain)

Buggy submission (verdict: Runtime Error):
import numpy as np
N=int(input())
A = [int(i) for i in input().split()]
G = [[int(i in (j,(j+1)%N)) for i in range(N)] for j in range(N)]
kakudai = np.array(G)
X=np.linalg.solve(G,A)
print(*[int(x*2) for x in X])
Problem p03127 (python)

Fixed submission:
import fractions,functools
input()
A = [int(hoge) for hoge in input().split()]
print(functools.reduce(fractions.gcd,A))

Buggy submission (verdict: Runtime Error):
import math,functools
input()
A = [int(hoge) for hoge in input().split()]
print(functools.reduce(math.gcd,A))
Problem p03135 (python)

Fixed submission:
T,X=[int(i)for i in input().split()]
print(T/X)

Buggy submission (verdict: Runtime Error):
def itinokazu(A,i):#配列Aのi桁目の１の数を調べる
    kazu=0
    for a in A:
        bina=bin(a)
        if a>=2**(i-1):
            if bina[i*-1]=='1':
                kazu=kazu+1
    return kazu

import math
N,K=[int(i) for i in input().split()]
A=list(map(int,input().split()))
Maxkazu=max(max(A),K)#桁の上限を探す(Kの2進数での桁数を考える)
Keta=math.floor(math.log2(Maxkazu))+1
presentA=0
print(Keta)
presentAns=0
for i in reversed(range(Keta+1)):#i桁目(2^i-1)の位について
    ichinokazu=itinokazu(A,i)
    if (2*ichinokazu>N) or presentA+2**(i-1)>K:#i桁目が1のほうが多い、もしくは1にすると超えちゃう場合はAのi桁目は0
        presentAns=presentAns+((2**(i-1))*ichinokazu)
    else:
        presentA=presentA+2**(i-1)#そうでなければAのi桁目は1
        presentAns=presentAns+((2**(i-1))*(N-ichinokazu))
print(int(presentAns))
Problem p03307 (python)

Fixed submission:
N=int(input());print(N*(N%2+1))

Buggy submission (verdict: Runtime Error):
N=int(input);print(N*(N%2+1))
Problem p03745 (python)

Fixed submission:
N = int(input())
if N == 1:print(1);exit()
A = [int(hoge) for hoge in input().split()]
ans = 1
cur = A[0]
Decided = A[0] != A[1]
Flat = A[0] == A[1]
Up = A[0] < A[1]

for n in range(1,N):
    if Decided:
        if A[n] == cur:
            continue
        if (A[n]>=cur) == Up:#数列が続く
            cur = A[n]
        else:
            cur = A[n]
            Up = 1 - Up
            Decided = False
            ans += 1
    else:
        if A[n] != cur:
            Up = A[n] > cur
            cur = A[n]
            Decided = True
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(hoge) for hoge in input().split()]
ans = 1
cur = A[0]
Decided = A[0] != A[1]
Flat = A[0] == A[1]
Up = A[0] < A[1]
for n in range(1,N):
    if Decided:
        if (A[n]>=cur) == Up:#数列が続く
            cur = A[n]
        else:
            cur = A[n]
            Up = 1 -  Up
            Decided = False
            ans += 1
    else:
        if A[n] != cur:
            Up = A[n] > cur
            cur = A[n]
            Decided = True
print(ans)
Problem p02595 (python)

Fixed submission:
from math import sqrt
if __name__=='__main__':
  n,d=[int(i) for i in input().split()]
  c=0
  for i in range(n):
    x,y = [int(i) for i in input().split()]
    if sqrt(x**2 + y**2) <= d:
      c+=1
  print(c)

Buggy submission (verdict: Runtime Error):
feom collections import sqrt
if __name__=='__main__':
  n,d=[int(i) for i in input().split()]
  c=0
  for i in range(n):
    x,y = [int(i) for i in input().split()]
    if sqrt(x**2 + y**2) <= d:
      c+=1
  print(c)
Problem p02594 (python)

Fixed submission:
n = int(input())

if n >=30:
	print('Yes')
else:
	print('No')

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

if n >=30;
print('Yes')
else
print('No')
Problem p02766 (python)

Fixed submission:
n,k = map(int,input().split())
i = 0

while k**i <= n:
  i +=1
  
print(i)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = [int(i) for i in input().split()]
x.sort()

ans = 10000
for p in range(1,x[-1]+1):
  sum =0
  for i in range(n):
    sum += (x[i]-p)**2
    
  ans = min(ans,sum)
  
print(ans)
Problem p02836 (python)

Fixed submission:
S = input()

num = 0

for i in range(len(S)):
  if not(S[i] == S[-(1+i)]):
    
    num +=1
    
print(int(num/2))

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

num = 0

for i in range(len(S)):
  if not(S[i] == S[-(1+i)]):
    S[i] = S[-1+i]
    num +=1
    
print(num)
Problem p02880 (python)

Fixed submission:
list = []

for i in range(1, 10):
  for j in range(1, 10):
    list.append(i * j)

N = int(input())

if N in list:
  print('Yes')
else:
  print('No')

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

if N !=0 and N <10:
  print("Yes")
  exit()

for i in range(2:10):
  if N % i ==0:
    print("Yes")


    
print("No")
Problem p03042 (python)

Fixed submission:
s = input()

YYMM = False
MMYY = False
month = []
for i in range(1,13):
  if len(str(i))==1:
    month.append("0"+str(i))
  else:
    month.append(str(i))
    
if s[:2] in month:
  MMYY = True
  
if s[2:] in month:
  YYMM = True
  
if MMYY is True and YYMM is True:
  print("AMBIGUOUS")
elif MMYY is True and YYMM is False:
  print("MMYY")
elif MMYY is False and YYMM is True:
  print("YYMM")
else:
  print("NA")

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

YYMM = False
MMYY = False
month = []
for i in range(1,13):
  if len(str(i))==1:
    month.append("0"+str(i))
  else:
    month.append(str(i))
    
if s[:2] in month:
  MMYY = True
  
if[2:] in month:
  YYMM = True
  
if MMYY is True and YYMM is True:
  print("AMBIGUOUS")
elif MMYY is True and YYMM is False:
  print("MMYY")
elif MMYY is False and YYMM is True:
  print("YYMM")
else:
  print("NA")
Problem p03307 (python)

Fixed submission:
n = int(input())


if n % 2:
  print(n*2)
else:
  print(n)

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

a = [int(i) for i in input().split()]

i=0

max = 0
min = 0
for i in range(n):
  if a[i] >= max:
    max = a[i]
  elif a[i] <= min:
    min = a[i]
  else
    continue
    
print (max - min)
Problem p03631 (python)

Fixed submission:
N = input()

print("Yes" if N[0] == N[2] else "No")

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

if b <= c:
  print(0)
  exit()
  
if b <= d:
  print(b-c)
else:
  print(d-c)
Problem p03745 (python)

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

ans = 1
up, dn = False, False
for i in range(N-1):
    if A[i] < A[i+1]:
        up = True
    elif A[i] > A[i+1]:
        dn = True
    if up and dn:
        ans += 1
        up, dn = False, False
print(ans)

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

ans = 1
up,down = False,False
for i in range(N-1):
  if A[i] < A[i+1]:
    up = True
  elif A[i] > A[i+1]:
    down = True
  if up and dn:
    ans +=1
    up,down = False,False
    
print(ans)
Problem p03785 (python)

Fixed submission:
n,c,k = map(int,input().split())
t = [int(input()) for i in range(n)]
t.sort()

pas = 1
last_bus = t[0] + k
ans = 1

for i in t[1:]:
  if i <= last_bus and pas < c:
    pas +=1
  else:
    ans +=1
    pas =1
    last_bus = i + k
    
    
print(ans)

Buggy submission (verdict: Runtime Error):
n,c,k = map(int,input().split())
t = [int(input()) for i in range(n)]
t.sorted()

pas = 1
last_bus = t[0] + k
ans = 1

for i in t[1:]:
  if i <= last_bus and pas < c:
    pas +=1
  else:
    ans +=1
    pas =1
    last_bus = i + k
    
    
print(ans)
Problem p03804 (python)

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

for i in range(n-m+1):
  for j in range(n-m+1):
    c =0
    for k in range(m):
      for l in range(m):
        if a[i+k][j+l] == b[k][l]:
          c +=1
          
          
    
    if c == m**2:
      print("Yes")
      exit()
      
      
      
print("No")

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

for i in range(n-m+1):
  for j in range(n-m+1):
    c =0
    for k in range(n-m+1):
      for l in range(n-m+1):
        if a[i+k][j+l] == b[k][l]:
          c +=1
          
      
  if c == 2*m:
    print("Yes")
    exit()
      
      
      
print("No")
Problem p03835 (python)

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

ans = 0

for x in range(K + 1):
  for y in range (K + 1):
    z = S - (x + y)
    if 0 <= z <= K:
      ans += 1

print(ans)

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

ans = 0

for x in range(K + 1):
  for y in range (K + 1):
    z = S - (x + y)
    if 0 <= z <= k:
      ans += 1

print(ans)
Problem p02552 (python)

Fixed submission:
if 1 == int(input()):
  print(0)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
if 1 == int(input()):
  print(0)
else
  print(1)
Problem p03018 (python)

Fixed submission:
S = input()
L = [" "]
for s in S:
  if s == 'A':
    L.append('0')
  elif s == 'B':
    L.append('B')
  elif s == 'C' and L[-1] == 'B':
    L[-1] = '1'
  else:
    L.append('C')

def func(a,b):
#  print(a,b)
  return a * b

ans = 0
a,b = 0,0
i = 0
while i < len(S):
  if S[i] == 'A':
    if b != 0:
      ans += func(a,b)
      b = 0
    a += 1
  elif S[i:i + 2] == 'BC':
    b += 1
  elif S[i - 1:i + 1] == "BC":
    ()
  else:
    ans += func(a,b)
    a,b = 0,0
  i += 1
print(ans + func(a,b))

Buggy submission (verdict: Runtime Error):
S = input()
L = [" "]
for s in S:
  if s == 'A':
    L.append('0')
  elif s == 'B':
    L.append('B')
  elif s == 'C' and L[-1] == 'B':
    L[-1] = '1'
  else:
    L.append('C')

ans = 0
a = 0
while True:
  a = 0
  for i in range(1,len(L)):
    if L[i] == '0' and L[i + 1] == '1':
      L[i],L[i + 1] = L[i + 1],L[i]
      ans += 1
      a += 1
#      print("".join(L),i)
  if a == 0:
    print(ans)
    break
Problem p03137 (python)

Fixed submission:
N,M = map(int,input().split())
X = list(map(int,input().split()))
if M == 1:
  print(0)
else:
  X.sort()
  A = [X[a + 1] - X[a] for a in range(M - 1)]
  A.sort(reverse=True)
  ans = X[-1] - X[0]
  for i in range(min(N - 1,M - 1)):
    ans -= A[i]
  print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
X = list(map(int,input().split()))
if M == 1:
  print(0)
else:
  X.sort()
  A = [X[a + 1] - X[a] for a in range(M - 1)]
  A.sort(reverse=True)
  ans = X[-1] - X[0]
  for i in range(min(N - 1,M)):
    ans -= A[i]
  print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
X = list(map(int,input().split()))
if M == 1:
  print(0)
else:
  X.sort()
  A = [X[a + 1] - X[a] for a in range(M - 1)]
  A.sort(reverse=True)
  ans = X[-1] - X[0]
  for i in range(min(N - 1,M)):
    ans -= A[i]
  print(ans)
Problem p03272 (python)

Fixed submission:
i = list(map(int,input().split()))
print(i[0] - i[1] + 1)

Buggy submission (verdict: Runtime Error):
i = list(map(int,input(),split()))
print(i[0] - i[1] + 1)

Buggy submission (verdict: Runtime Error):
i = list(map(int,input(),split()))
print(i[0] - i[1] + 1)
Problem p02577 (python)

Fixed submission:

def check(st) : 

	n = len(st) 
	digitSum = 0
	
	for i in range(0,n) : 
		digitSum = digitSum + (int)(st[i]) 

	
	return (digitSum % 9 == 0) 


st =input()

if(check(st)) : 
	print("Yes") 
else : 
	print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
sum=0
while (n!=0):
  sum+=int(n%10)
  n/=10
if (sum%9==0):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
sum=0
while (n!=0):
  sum+=int(n%10)
  n/=10
print(sum)
if (sum%9==0):
  print("Yes")
else:
  print("No")
Problem p02552 (python)

Fixed submission:
a = int(input())
if a == 0:
    print(1)

if a == 1:
    print(0)

Buggy submission (verdict: Runtime Error):
a = input()
print(!a)
Problem p02688 (python)

Fixed submission:
N, K = map(int, input().split())
di = K * 2
l = []
for i in range (di):
    l.append(input().split())
l1 = []
x = 1
while x < di:
    for j in l[x]:
        l1.append(j)
    x += 2
l1 = set(l1)
print(N - len(l1))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
di = K * 2
l = []

for i in range (di):
    l.append(int(input()))

l1 = []
x = 1
while x < di:
    for j in l[x]:
        l1.append(j)
    x += 2
l1 = set(l1)
print(N - len(l1))

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

for i in range (K * 2):
    l.append(int(input())
l1 = []
x = 1
while x < K * 2:
    for j in l[x]:
        l1.append(j)
    x += 2
l1 = set(l)
print(N - len(l1))
Problem p02693 (python)

Fixed submission:
K = int(input())
A, B = map(int, input().split())
result = 'NG'
for i in range (A, B + 1):
    if i % K == 0:
        result = 'OK'
print(result)

Buggy submission (verdict: Runtime Error):
A, B, N = map(int, input().split())
if N < B:
    print(A*N//B)
else:
    l = [(A*i//B)-(A*(i//B)) for i in range(abs(N-5), N+1)]
    print(max(l))
Problem p02711 (python)

Fixed submission:
num = int(input())
N = [int(i) for i in str(num)]
if N[0] == 7:
    print("Yes")
elif N[1] == 7:
    print("Yes")
elif N[2] == 7:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = []
for n in range (3):
    n = int(input())
if n == 7:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = []
for n in range (3):
    n = int(input())
if n == 7:
    print('Yes')
else:
    print('No')
Problem p02723 (python)

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

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

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

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

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

Buggy submission (verdict: Runtime Error):
s = str(input("Enter a string: "))

if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")
Problem p02624 (python)

Fixed submission:
N = int(input())

ans = 0
for  i in range(1, N + 1):
    ans += i * ((N // i) * ((N // i) + 1))/2

print((int)(ans))

Buggy submission (verdict: Runtime Error):
import sympy
N = int(input())

def enzan(k, yakusu):
    return(k * yakusu)


# def make_divisor_list(num):
#     if num == 1:
#         return 1
#     else:
#         cnt = 2
#         # divisor_list = []
#         # divisor_list.append(1)
#         for i in range(2, num // 2 + 1):
#             if num % i == 0:
#                 # divisor_list.append(i)
#                 cnt += 1
#         # divisor_list.append(num)

#         # return len(divisor_list)
#         return cnt


# def num_divisors_table(n):
#     table = [0] * (n + 1)

#     for i in range(1, n + 1):
#         for j in range(i, n + 1, i):
#             table[j] += 1

#     return table


wa = 0
for k in range(1, N+1):
    wa += enzan(k, sympy.divisor_count(k))

print(wa)

# print(make_divisor_list(4))
Problem p03011 (python)

Fixed submission:
P, Q, R = map(int, input().split())
print(min(min(P + Q , P + R), Q + R))

Buggy submission (verdict: Runtime Error):
P, Q, R = map(int, input().split())
print(min(min(P + Q, PL R), Q + R)
Problem p02571 (python)

Fixed submission:
s = str(input())
t = str(input())

slen = len(s)
tlen = len(t)

i = tlen
n = 0
a = 0
# tuu = [0] * tlen
# ans = [0] * tlen
max_count = 0
while i <= slen:
    ps = s[ n : i + tlen -1 ]
    count = 0
    for j in range(tlen):
        if ps[j] == t[j]:
            count += 1
#             tuu[j] = "True"
#             print("通った")
#     print(count)
    if max_count < count:
        max_count = count
    n += 1
    i += 1
print(tlen - max_count)

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

slen = len(s)
tlen = len(t)

i = tlen
n = 0
a = 0
tuu = [0] * tlen
ans = [0] * tlen
max_count = 0
while i <= slen:
    ps = s[ n : i + tlen -1 ]
    count = 0
    for j in range(tlen):
        if ps[j] == t[j]:
            count += 1
            tuu[j] = "True"
#             print("通った")
#     print(count)
    if max_count < count:
        max_count = count
#         print("通った")
        a = n
        ans = tuu
        
#     print(a)    
    n += 1
    i += 1
# print(a)
# print(ans)

for h in range(tlen):
    if ans[h] == "True":
        pass
    else:
        t[h] = s[a + h]
Problem p02707 (python)

Fixed submission:
import numpy
N = int( input())
a = list(map(int, input().split(' ')))
l = [0]*N
numpy.sort(a)
for i in a:
    l[i-1] += 1
for i in l:
    print(i)

Buggy submission (verdict: Runtime Error):
N = int( input())
a = list(map(int, input().split(' ')))
l = [0]*N
numpy.sort(a)
for i in a:
    l[i-1] += 1
for i in l:
    print(i)

Buggy submission (verdict: Runtime Error):
N = int( input())
a = list(map(int, input().split(' ')))
l = [0]*N
numpy.sort(a)
for i in a:
  l[i-1] += 1
for i in l:
    print(i)
Problem p02790 (python)

Fixed submission:
N,M = input().split(" ")
if N > M:
  str = M
  print(str*int(N))
else:
  str = N
  print(str*int(M))

Buggy submission (verdict: Runtime Error):
N,M = input().split(" ")
if N > M:
  str = str(M)
  print(str*N)
else:
  str = str(N)
  print(str*M)

Buggy submission (verdict: Runtime Error):
N,M = input().split(" ")
if N > M:
  
    str = str(M)
    print(str*N)

else:
    str = str(N)
    print(str*M)
Problem p02933 (python)

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

if a < 3200:
  print('red')
else:
  print(s)

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
import bisect
s = input()
t = input()



count = 0
s_len = len(s)
s_list = np.zeros(len(s))
t_list = []*len(t)
indexes = []

for i in range(26):
  
  indexes.append([j for j, x in enumerate(s) if x == chr(i + ord('a')) ])
  

for i,k in enumerate(t):

  index = indexes[ord(k)-97]
  
  if len(indexes) == 0:
    print(-1)
    sys.exit(0)
  else:
    t_list.insert(i,index)
    


pre = -1
for i in range(len(t)):
  
  #high = [j  for j in t_list[i] if j > pre]
  high = bisect.bisect_left(t_list[i], pre) 

  if high >= len(t_list[i]):
    
    count += s_len - pre  + t_list[i][0]
    pre = t_list[i][0] 
  else:
    
    count += t_list[i][high] - pre 
    pre = t_list[i][high]

print(count)
Problem p02935 (python)

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

v.sort()

mean = v[0]
for i in v:
  mean = (mean + i)/2

  
print(mean)

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

v.sort()

mean = v[0]
for i in v:
  mean = (mean + v)/2

  
print(mean)