Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N,L=map(int,input().split())
S=[input() for n in range(N)]
for num in range(L):
    ans1=S[num]
    for num2 in range(L):

        ans2=S[num2]
        for i in range(L):
            if ans1[i]>ans2[i]:
                break
            elif ans1[i]==ans2[i]:
                continue
            else :
                S[num],S[num2]=S[num2],S[num]
                break
print("".join(S))

Fixed submission:
N,L=map(int,input().split())
S=[input() for n in range(N)]
S=sorted(S)
"""for num in range(L):
    ans1=S[num]
    for num2 in range(L):

        ans2=S[num2]
        for i in range(L):
            if ans1[i]>ans2[i]:
                break
            elif ans1[i]==ans2[i]:
                continue
            else :
                S[num],S[num2]=S[num2],S[num]
                break
"""
print("".join(S))

Buggy python submission (verdict: Runtime Error):
N,L=map(int,input().split())
S=[input() for n in range(N)]
for num in range(L):
    ans1=S[num]
    for num2 in range(L):

        ans2=S[num2]
        for i in range(L):
            if ans1[i]>ans2[i]:
                break
            elif ans1[i]==ans2[i]:
                continue
            else :
                S[num],S[num2]=S[num2],S[num]
print("".join(S))

Fixed submission:
N,L=map(int,input().split())
S=[input() for n in range(N)]
S=sorted(S)
"""for num in range(L):
    ans1=S[num]
    for num2 in range(L):

        ans2=S[num2]
        for i in range(L):
            if ans1[i]>ans2[i]:
                break
            elif ans1[i]==ans2[i]:
                continue
            else :
                S[num],S[num2]=S[num2],S[num]
                break
"""
print("".join(S))

Buggy python submission (verdict: Runtime Error):
N,L=map(int,input().split())
S=[input() for n in range(N)]
for num in range(L):
    ans1=S[num]
    for num2 in range(L):

        ans2=S[num2]
        for i in range(L):
            if ans1[i]>ans2[i]:
                True
            else :
                S[num],S[num2]=S[num2],S[num]
print("".join(S))

Fixed submission:
N,L=map(int,input().split())
S=[input() for n in range(N)]
S=sorted(S)
"""for num in range(L):
    ans1=S[num]
    for num2 in range(L):

        ans2=S[num2]
        for i in range(L):
            if ans1[i]>ans2[i]:
                break
            elif ans1[i]==ans2[i]:
                continue
            else :
                S[num],S[num2]=S[num2],S[num]
                break
"""
print("".join(S))
Buggy python submission (verdict: Time Limit Exceeded):
numOp = int(input())
intList = list(map(int, input().split()))
mark = False


for i in range(numOp):
    if intList.count(intList[i]) != 1:
        mark = True
        print('NO')
        break
    else:
        mark = False

if not mark:
    print('YES')


Fixed submission:
numOp = int(input())
intList = list(map(int, input().split()))

intList.sort()
for i in range(numOp):
    if intList[i] == intList[i - 1]:
        print('NO')
        break
    elif i == (numOp - 1):
        print('YES')
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input())
if N == M:
    print('Yes')
else:
    print('No')

Fixed submission:
N, M = map(int, input().split())
if N == M:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())
  
numberABC = 0

for i in range(N):
  if S[i] == 'A':
    if S[i + 1] == 'B':
      if S[i + 2] == 'C':
          numberABC += 1
      
print(numberABC)



Fixed submission:
N = int(input())
S = input()

count = 0 

for i in range (N - 2):
  if S[i:i + 3] == 'ABC':
    count += 1

print(count)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())
  
numberABC = 0

for i in range(0, N):
  if S[i] == 'A':
    if S[i + 1] == 'B':
      if S[i + 2] == 'C':
          numberABC += 1
print(numberABC)



Fixed submission:
N = int(input())
S = input()

count = 0 

for i in range (N - 2):
  if S[i:i + 3] == 'ABC':
    count += 1

print(count)

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

def main():
  numberABC = 0

  for i in range(0, N):
    if S[i] == 'A':
      if S[i + 1] == 'B':
        if S[i + 2] == 'C':
          numberABC += 1
  print(numberABC)
  return numberABC

if __name__ == '__main__':
  main()


Fixed submission:
N = int(input())
S = input()

count = 0 

for i in range (N - 2):
  if S[i:i + 3] == 'ABC':
    count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
import math
 
def resolve():
    n = int(input())
    a = [int(x) for x in input().split()]
 
    for k in range(n):
        # 初期化
        ak = [x for x in a] # deep copy
        del ak[k]
        kumi = 0
        ended = []
 
        # loop
        for i in range(n - 1):
            a0 = ak[i] # i番目の要素を検査
            if a0 in ended:
                continue
            cnt = ak.count(a0)
            if cnt >= 2:
                kumi += kumiawase(cnt ,2)
            ended.append(a0)
        print(kumi)
 
def kumiawase(n, r):
    return math.factorial(n) // (r * math.factorial(n - r))
 
resolve()

Fixed submission:
import math

a = [int(x) for x in input().split(" ")]
n = a[0]
m = a[1]
ans = 0
if n >= 2 :
    ans += math.factorial(n) // (2 * math.factorial(n - 2))
if m >= 2 :
    ans += math.factorial(m) // (2 * math.factorial(m - 2))
print(ans)
Buggy python submission (verdict: Runtime Error):
def kaibun(str):
    return True if str == str[::-1] else False

s = input()
if not kaibun(s) :
    print('No')
    return
n = len(s)
n1 = (n - 1) // 2
if not kaibun(s[:n1]) :
    print('No')
    return
n2 = (n + 3) // 2 - 1
if not kaibun(s[n2:]) :
    print('No')
    return
print('Yes')

Fixed submission:
def resolve():
    s = input()
    if not kaibun(s) :
        print('No')
        return
    n = len(s)
    n1 = (n - 1) // 2
    if not kaibun(s[:n1]) :
        print('No')
        return
    n2 = (n + 3) // 2 - 1
    if not kaibun(s[n2:]) :
        print('No')
        return
    print('Yes')

def kaibun(str):
    return True if str == str[::-1] else False

resolve()
Buggy python submission (verdict: Runtime Error):
a = [int(x) for x in input().split(" ")]
if a[1] <= 0:
  print(0)
  exit()
kisu = a[0] // 2 if a[0] % 2 == 0 else a[0] // 2 + 1
gusu = a[0] // 2
yokokisu = a[1] // 2 if a[1] % 2 == 0 else a[1] // 2 + 1
yokogusu = a[1] // 2
ans = kisu * yokokisu + gusu * yokogusu
print(ans)

Fixed submission:
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(a[int(input()) + -1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
import collections
mylist = []
for i in range(N):
  val = input("")
  if val:
    mylist.append(val)
if len(mylist) != len(set(mylist)):
    c = collections.Counter(mylist)
    A = [i for i in range(len(set(mylist))) if c.most_common()[0][1] == c.most_common()[i][1]]
    B = [c.most_common()[i][0] for i in range(len(A))]
    C = sorted(B)
    for item in C:
        print(item)
else:
    D = sorted(mylist)
    for item in D:
            print(item)


Fixed submission:
A, B, C = map(int, input().split())
if A == B and A != C:
    print('Yes')
elif A == C and A != B:
    print('Yes')
elif B == C and B != A:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
 nm = [int(i) for i in input().split()]
  2
  3 result = (nm[0] * (nm[0] - 1)) // 2
  4 result += (nm[1] * (nm[1] - 1)) // 2
  5
  6 print(result)

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

result = (nm[0] * (nm[0] - 1)) // 2
result += (nm[1] * (nm[1] - 1)) // 2

print(result)
Buggy python submission (verdict: Runtime Error):
ch = input()
out = char(ord(ch)+1)
print(out)

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

Buggy python submission (verdict: Runtime Error):
ch = input()
out = char(ord(ch)+1)
print(out)

Fixed submission:
ch = input()
out = chr(ord(ch)+1)
print(out)
Buggy python submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc081/tasks/abc081_b
import math

def div_list(list_num):
    _div_list = []
    can_iter = True
    for k in range(len(list_num)):
        if math.isclose(list_num[k]%2, 0) == False:
            can_iter = False
        _div_list.append(list_num[k] / 2)
    return can_iter, _div_list


n_input = int(input())
list_number = input().split()
list_number = list(map(float, list_number))

n_iter = 0
can_iter = True

while can_iter == True:
    can_iter, list_number = div_list(list_number)
    if can_iter == True:
        n_iter += 1

print(n_iter)



Fixed submission:
# https://atcoder.jp/contests/abc081/tasks/abc081_b

def div_list(list_num):
    _div_list = []
    can_iter = True
    for k in range(len(list_num)):
        if list_num[k] % 2 != 0:
                can_iter = False
        _div_list.append(list_num[k] / 2)
    return can_iter, _div_list


n_input = int(input())
list_number = input().split()
list_number = list(map(int, list_number))

n_iter = 0
can_iter = True

while can_iter == True:
    can_iter, list_number = div_list(list_number)
    if can_iter == True:
        n_iter += 1

print(n_iter)
Buggy python submission (verdict: Runtime Error):
L = input()
ans = (L//3)**3
print(ans)

Fixed submission:
N, M = map(int, input().split())
ans = N*(N-1)//2 + M*(M-1)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
L = map(int, input().split())
ans = (L/3)**3
print(ans)

Fixed submission:
L = int(input())
ans = (L/3)**3
print(ans)

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

Fixed submission:
L = int(input())
ans = (L/3)**3
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
if s[0] == s[1] or s[1] == s[2]: print('No')
  else: print('Yes')

Fixed submission:
S = input()
if S[0] == S[1] and S[1] == S[2]:
  print('No')
else: 
  print('Yes')

Buggy python submission (verdict: Runtime Error):
s = imput ()
if s [0] == s[1] or s[1] == s[2]:print('No')
else: print('Yes')

Fixed submission:
S = input()
if S[0] == S[1] and S[1] == S[2]:
  print('No')
else: 
  print('Yes')
Buggy python submission (verdict: Runtime Error):
from collections import Counter


def words_sort_ordered(words_list):
    word_cnt = Counter()
    for word in words_list:
        word_cnt[word] += 1

    word_written_max_time = 0
    for each_word_ct in word_cnt.values():
        if each_word_ct > word_written_max_time:
            word_written_max_time = each_word_ct

    answer_words_list = []
    for word, number in dict(word_cnt).items():
        if number == word_written_max_time:
            answer_words_list.append(word)

    return sorted(answer_words_list)


if __name__ == '__main__':
    words_num = int(input())
    words_list = [input() for i in range(words_num)]
    for w in words_sort_ordered(words_list):
        print(w)


Fixed submission:
def is_kawaisou(a, b, c):
    if a == b and a == c:
        return 'No'
    if a == b or b == c or a == c:
        return 'Yes'
    else:
        return 'No'


if __name__ == '__main__':
    a, b, c = map(int, input().split())
    print(is_kawaisou(a, b, c))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter


def words_sort_ordered(words_list):
    cnt = Counter()
    for word in words_list:
        cnt[word] += 1

    written_words_number = []
    for x in cnt.values():
        written_words_number.append(x)

    answer_words_list = []

    for word, number in dict(cnt).items():
        if number == max(written_words_number):
            answer_words_list.append(word)

    return sorted(answer_words_list)


if __name__ == '__main__':
    words_num = int(input())
    words_list = [input() for i in range(words_num)]
    for w in words_sort_ordered(words_list):
        print(w)


Fixed submission:
from collections import Counter


def words_sort_ordered(words_list):
    word_cnt = Counter()
    for word in words_list:
        word_cnt[word] += 1

    word_written_max_time = 0
    for each_word_ct in word_cnt.values():
        if each_word_ct > word_written_max_time:
            word_written_max_time = each_word_ct

    answer_words_list = []
    for word, number in dict(word_cnt).items():
        if number == word_written_max_time:
            answer_words_list.append(word)

    return sorted(answer_words_list)


if __name__ == '__main__':
    words_num = int(input())
    words_list = [input() for i in range(words_num)]
    for w in words_sort_ordered(words_list):
        print(w)
Buggy python submission (verdict: Runtime Error):
import sys
import math
import itertools

n = int(sys.stdin.readline())
total = math.factorial(n)
res = 0
acc = 0
lines = []

for i in range(n):
    lines.append(sys.stdin.readline().rstrip('\n'))
for y in itertools.combinations(lines, 2):
    acc += ((int(y[0][0]) - int(y[1][0]))**2) + ((int(y[0][1]) - int(y[1][1]))**2)
    acc += math.sqrt(acc)

res = acc/total
print(res)

Fixed submission:
n = int(input())

fin = n//2
s = input()

debut = s[0:fin]

if s == debut + debut:
    print("Yes")
else:
    print("No")

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

if s.endswith(s[:n/2]):
  print("Yes")
else:
  print("No")

Fixed submission:
n = int(input())

fin = n//2
s = input()

debut = s[0:fin]

if s == debut + debut:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import math

N=int(input())
A = list(map(int,input().split()))
cnt=[0]*(N+1)
for i in range(1,N+1):
	cnt[i-1]=(A.count(i))
ans=0
for i in range(1,N+1):
	if cnt[i-1]==0:
		ans+=0
	else:
		ans+=cnt[i-1]*(cnt[i-1]-1)//2

for i in range(0,N):
	point=A[i]
	deff=(cnt[point-1]*(cnt[point-1]-1))//2-((cnt[point-1]-1)*(cnt[point-1]-2))//2
	print(ans-deff)

Fixed submission:
import math

N=int(input())
A = list(map(int,input().split()))
cnt=[0]*(N+1)
for i in range(0,N):
	cnt[A[i]-1]+=1
ans=0
for i in range(0,N+1):
	if cnt[i]==0:
		ans+=0
	else:
		ans+=cnt[i]*(cnt[i]-1)//2

for i in range(0,N):
	point=A[i]
	deff=(cnt[point-1]*(cnt[point-1]-1))//2-((cnt[point-1]-1)*(cnt[point-1]-2))//2
	print(ans-deff)

Buggy python submission (verdict: Time Limit Exceeded):
import math

N=int(input())
A = list(map(int,input().split()))
cnt=[]
B=[]
for i in range(1,N+1):
	cnt.append(A.count(i))
ans=0
for i in range(1,N+1):
	if cnt[i-1]==0:
		ans+=0
	else:
		ans+=cnt[i-1]*(cnt[i-1]-1)//2

for i in range(0,N):
	point=A[i]
	deff=(cnt[point-1]*(cnt[point-1]-1))//2-((cnt[point-1]-1)*(cnt[point-1]-2))//2
	print(ans-deff)

Fixed submission:
import math

N=int(input())
A = list(map(int,input().split()))
cnt=[0]*(N+1)
for i in range(0,N):
	cnt[A[i]-1]+=1
ans=0
for i in range(0,N+1):
	if cnt[i]==0:
		ans+=0
	else:
		ans+=cnt[i]*(cnt[i]-1)//2

for i in range(0,N):
	point=A[i]
	deff=(cnt[point-1]*(cnt[point-1]-1))//2-((cnt[point-1]-1)*(cnt[point-1]-2))//2
	print(ans-deff)

Buggy python submission (verdict: Time Limit Exceeded):
import math

N=int(input())
A = list(map(int,input().split()))
cnt=[]
B=[]
for i in range(1,N+1):
	cnt.append(A.count(i))
	
for i in range(1,N+1):
	B.append((cnt[i-1]*(cnt[i-1]-1))//2)
	if cnt[i-1]==0:
		B[i-1]=0
ans=0
for i in range(1,N+1):
	ans+=B[i-1]

for i in range(0,N):
	point=A[i]
	deff=(cnt[point-1]*(cnt[point-1]-1))//2-((cnt[point-1]-1)*(cnt[point-1]-2))//2
	print(ans-deff)

Fixed submission:
import math

N=int(input())
A = list(map(int,input().split()))
cnt=[0]*(N+1)
for i in range(0,N):
	cnt[A[i]-1]+=1
ans=0
for i in range(0,N+1):
	if cnt[i]==0:
		ans+=0
	else:
		ans+=cnt[i]*(cnt[i]-1)//2

for i in range(0,N):
	point=A[i]
	deff=(cnt[point-1]*(cnt[point-1]-1))//2-((cnt[point-1]-1)*(cnt[point-1]-2))//2
	print(ans-deff)

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

N=int(input())
A = list(map(int,input().split()))
cnt=[]
B=[]
for i in range(1,N):
	cnt.append(A.count(i))
	
for i in range(1,N):
	B.append((cnt[i-1]*(cnt[i-1]-1))//2)
	if cnt[i-1]==0:
		B[i-1]=0
		
ans=0
for i in range(1,N):
	ans+=B[i-1]

for i in range(0,N):
	point=A[i]
	deff=(cnt[point-1]*(cnt[point-1]-1))//2-((cnt[point-1]-1)*(cnt[point-1]-2))//2
	print(ans-deff)

Fixed submission:
import math

N=int(input())
A = list(map(int,input().split()))
cnt=[0]*(N+1)
for i in range(0,N):
	cnt[A[i]-1]+=1
ans=0
for i in range(0,N+1):
	if cnt[i]==0:
		ans+=0
	else:
		ans+=cnt[i]*(cnt[i]-1)//2

for i in range(0,N):
	point=A[i]
	deff=(cnt[point-1]*(cnt[point-1]-1))//2-((cnt[point-1]-1)*(cnt[point-1]-2))//2
	print(ans-deff)
Buggy python submission (verdict: Time Limit Exceeded):
import math

def factorial(num):
    value = 1
    if num == 0:
        return 1
    else:
        for j in range(1, num+1):
            value *= j
        return value

def main():
    n, a, b = map(int, input().split())
    sum = 0

    for i in range(1, n+1):
        if i == a or i == b:
            continue
        sum += factorial(n)/(factorial(n-i)*factorial(i))
    
    print(int(sum%(10**9+7)))

main()

Fixed submission:
def comb(n, r, p):
    numer = 1
    denom = 1

    for i in range(n-r+1, n+1):
        numer = numer * i % p
    for i in range(1, r+1):
        denom = denom * i % p
    return numer * pow(denom, p-2, p)

def main():
    p = pow(10, 9) + 7
    n, a, b = map(int, input().split())
    print(((pow(2, n, p) - comb(n, a, p) - comb(n, b, p) - 1)) % p)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

if has_duplicates(A):
  print('NO')
else:
  print('YES')


Fixed submission:
def has_no_duplicates(seq):
  return len(seq) == len(set(seq))

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

if has_no_duplicates(A):
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
import math

A = []
sum = 0
H,N = (int(x) for x in input().split())

for i in range(N):
    A.append(int(input()))
    sum += A[i]

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

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

if sum(A)>=H:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int, input().split())
H =  list(map(int, input().split()))

for i in range(K):
    H[H.index(max(H))] = 0

print(sum(H))

Fixed submission:
N,K = map(int, input().split())
H =  list(map(int, input().split()))
H.sort(reverse=True)
sum = 0

for i in range(N):
    if i < K:
        pass
    else:
        sum += H[i]

print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int, input().split())
H =  list(map(int, input().split()))

for i in range(K):
    num = H.index(max(H))
    H[num] = 0

print(sum(H))

Fixed submission:
N,K = map(int, input().split())
H =  list(map(int, input().split()))
H.sort(reverse=True)
sum = 0

for i in range(N):
    if i < K:
        pass
    else:
        sum += H[i]

print(sum)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
count = 0

for i in range(N-2):
    if S[i]=='A' and S[i+1]=='B' and S[i+2]=='C':
        count += 1

print(count)

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

if K*500>=X:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
count = 0

for i in range(N-2):
    if S[i]=="A" and S[i+1]=="B" and S[i+2]=="C":
        count += 1

print(count)

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

if K*500>=X:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())
count = 0

for i in range(N-2):
    if S[i]==("A") and S[i+1]==("B") and S[i+2]==("C"):
        count += 1

print(count)

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

if K*500>=X:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())
count = 0

for i in range(N):
    if S[i]==("A"):
        if S[i+1]==("B"):
            if S[i+2]==("C"):
                count += 1


print(count)

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

while True:
    if 'ABC' in s:
        s = s.replace('ABC', '', 1)
        count += 1
    else:
        break

print(count)
Buggy python submission (verdict: Runtime Error):
import itertools

def AllPatern(n, all):
    numbers = []
    all = []
    for i in range(n):
        numbers.append(i+1)
    for i in itertools.permutations(numbers):
        all.append(list(i))

    return all


def WhichNumber(p, q, all):
    val_p = 0
    val_q = 0
    for i in range(len(all)):
        val_p += 1
        if p == all[i]:
            break
    for i in range(len(all)):
        val_q += 1
        if q == all[i]:
            break

    return val_p, val_q

def main():
    n = int(input())
    p = [int(i) for i in input().split()]
    q = [int(i) for i in input().split()]
    all_numbers=[]

    all_numbers = AllPatern(n, all_numbers)
    val_p, val_q = WhichNumber(p, q, all)
    print(abs(val_p - val_q))



if __name__ == '__main__':
    main()


Fixed submission:
import itertools

def AllPatern(n, all):
    numbers = []
    all = []
    for i in range(n):
        numbers.append(i+1)
    for i in itertools.permutations(numbers):
        all.append(list(i))

    return all


def WhichNumber(p, q, all):
    val_p = 0
    val_q = 0
    for i in range(len(all)):
        val_p += 1
        if p == all[i]:
            break
    for i in range(len(all)):
        val_q += 1
        if q == all[i]:
            break

    return val_p, val_q

def main():
    n = int(input())
    p = [int(i) for i in input().split()]
    q = [int(i) for i in input().split()]
    all = []

    all = AllPatern(n, all)
    val_p, val_q = WhichNumber(p, q, all)
    print(abs(val_p - val_q))



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
A,B,K = map(int, input().split())

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

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

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

Buggy python submission (verdict: Time Limit Exceeded):
A,B,K = map(int, input().split())

for i in range(K):
    if A>0:
        A -= 1
    elif B>0:
        B -= 1

print(A, B, sep=' ')

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

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

Buggy python submission (verdict: Time Limit Exceeded):
A,B,K = map(int, input().split())

for i in range(K):
    if A>0:
        A -= 1
    elif B>0:
        B -= 1
    else:
        pass

print(A, B, sep=' ')

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

if A>=K:
    print(A-K, B)
elif B>=K-A:
    print(0, B-K+A)
else:
    print(0,0)
Buggy python submission (verdict: Runtime Error):
x = int(input())
y = int(input())
z = int(input())

if x + y + z <= 21:
	print('win')
else:
	print('bust')


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

if (a+b+c<=21):
  print('win')
else:
  print('bust')
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
A = [K] * N
B = ['Yes'] * N

for i in range(Q):
    j = int(input())

    for k in range(N):

        if k+1 != j:
            A[k] -= 1
            if A[k] == 0:
                B[k] = 'No'

print(*B, sep='\n')

Fixed submission:
n, k, q = map(int, input().split())
point = [k-q] * n

for i in range(q):
    a = int(input())
    point[a-1] = point[a-1] + 1

ans = '\n'.join('Yes' if i > 0 else 'No' for i in point[0:])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
H = list(map(int, input().split()))
res = 0

for i in range(N):
    count = 0
    for j in range(i, N):
        if j == N-1:
            break
        elif H[j] >= H[j+1]:
            count += 1
        else:
            break
    if count > res:
        res = count

print(res)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
total = 0
max_total = 0

for i in range(N-1):
    if H[i] >= H[i+1]:
        total += 1
        max_total = max(total, max_total)
    else:
        total = 0

print(max_total)
Buggy python submission (verdict: Runtime Error):
import math
n, k = input().split(" ")
n= int(n)
k= int(k)
dig = (math.floor(math.log(n) / math.log(k)) + 1)
print(dig)

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