Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = list(map(int, input().split()))
n = 0
for i in range(0,a):
    l = 0
    for j in range(0,i):
               if b[i] <= b[j]:
                    l += 1
    if l == i:
        n += 1
print(n)

Fixed submission:
n = int(input())
m = list(map(int, input().split()))
l = 0
s = m[0]
for i in range(0,n):
    if s >= m[i]:
        s = m[i]
        l += 1
print(l)

Buggy python submission (verdict: Runtime Error):
x = input().split()
n = int(x[0])
m = x[1:len(x)]
k = 0
for i in range(0,n):
    a = int(m[i])
    for j in range(0,i):
        if int(m[i]) > int(m[j]):
            a = int(m[j])
    if a == int(m[i]):
        k += 1
print(k)

Fixed submission:
n = int(input())
m = list(map(int, input().split()))
l = 0
s = m[0]
for i in range(0,n):
    if s >= m[i]:
        s = m[i]
        l += 1
print(l)

Buggy python submission (verdict: Runtime Error):
x = input().split()
n = 0
for i in range(1,int(x[0])+1):
    l = 0
    for j in range(1,i+1):
               if int(x[i]) <= int(x[j]):
                    l += 1
    if l == i:
        n += 1
print(n)

Fixed submission:
n = int(input())
m = list(map(int, input().split()))
l = 0
s = m[0]
for i in range(0,n):
    if s >= m[i]:
        s = m[i]
        l += 1
print(l)

Buggy python submission (verdict: Runtime Error):
x = input().split()
n = 0
for i in range(1,int(x[0])+1):
    l = 0
    for j in range(1,i+1):
               if x[i] <= x[j]:
                l += 1
    if l == i:
        n += 1
print(n)

Fixed submission:
n = int(input())
m = list(map(int, input().split()))
l = 0
s = m[0]
for i in range(0,n):
    if s >= m[i]:
        s = m[i]
        l += 1
print(l)
Buggy python submission (verdict: Runtime Error):
n=input()
n=n.replace('1','2')
n=n.replace('9','1')
print(n.replace('2','9')

Fixed submission:
n=input()
n=n.replace('1','2')
n=n.replace('9','1')
print(n.replace('2','9'))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = 1

for i in a:
  ans *= i
if ans > 1e18:
  print(-1)
else:
  print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 1
if 0 in a:
  print(0)

else:
  for i in a:
    ans *= i
    if ans > 1e18:
      print(-1)
      exit()
  print(ans)
Buggy python submission (verdict: Runtime Error):
from itertools import combinations

n = int(input())
a = list(map(int,input().split()))
b = list(range(1,n+1))
c = [0]*int(n*(n-1)/2)
d = [0]*int(n*(n-1)/2)
for i,j in enumerate(combinations(b,r=2)):
  x,y = map(int,j)
  c[i] = abs(x-y)
cnt = 0

for i,j in enumerate(combinations(a,r=2)):
  x,y = map(int,j)
  difh = x + y
  d[i] = x + y
  if difh == c[i]:
    cnt += 1
# print(c)
# print(d)
print(cnt)

Fixed submission:
from collections import defaultdict
 
n = int(input())
a = list(map(int, input().split()))
ap = defaultdict(int)
for i in range(n):
    ap[i - a[i]] += 1
 
ans = 0
for i in range(n):
    ans += ap[a[i] + i]
print(ans)
Buggy python submission (verdict: Runtime Error):


a,b,n = map(int,input().split())
ans = 0

for i in range(n+1,n-a,-1):
    ans = max(ans,(a*i)//b) - a*(i//b))

print(ans)

Fixed submission:
a,b,n = map(int,input().split())
i = min(b-1,n)
ans = a*i//b - a*(i//b)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):

s = input()
l = len(s)
cnt = 0

for i in range(l):
    for j in range(i+4,l):
            a = int(s[i:j+1])
            if a % 2019 == 0 and j < l:
                cnt += 1

print(cnt)


Fixed submission:
s = input()
p = 2019
t = 1
y = 0
c = [0] * p
c[0] = 1
for x in map(int, s[::-1]):
    y = (y + t*x) % p
    c[y] += 1
    t = (t*10) % p
print(sum(i*(i-1)//2 for i in c))

Buggy python submission (verdict: Time Limit Exceeded):

s = input()
l = len(s)
cnt = 0

for i in range(l):
    for j in range(i+1,l):
            a = int(s[i:j+1])
            if a % 2019 == 0 and j < l:
                cnt += 1

print(cnt)


Fixed submission:
s = input()
p = 2019
t = 1
y = 0
c = [0] * p
c[0] = 1
for x in map(int, s[::-1]):
    y = (y + t*x) % p
    c[y] += 1
    t = (t*10) % p
print(sum(i*(i-1)//2 for i in c))

Buggy python submission (verdict: Time Limit Exceeded):

s = input()
l = len(s)
cnt = 0

for i in range(l):
    for j in range(i+1,l):
            a = int(s[i:j+1])
            if a % 2019 == 0 and j < l:
                cnt += 1

print(cnt)


Fixed submission:
s = input()
p = 2019
t = 1
y = 0
c = [0] * p
c[0] = 1
for x in map(int, s[::-1]):
    y = (y + t*x) % p
    c[y] += 1
    t = (t*10) % p
print(sum(i*(i-1)//2 for i in c))
Buggy python submission (verdict: Time Limit Exceeded):
import math
import itertools
from functools import reduce
from itertools import product

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

l = int(input())
s = 0
li = list(range(1,l+1))
for i,j,k in product(li, repeat = 3):
  s += gcd(i,j,k)
print(s)

Fixed submission:
import math

l = int(input())
s = 0

for i in range(1, l+1):
  for j in range(1, l+1):
    tmp = math.gcd(i,j)
    for j in range(1, l+1):
      s += math.gcd(tmp,j)
  
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
import math
import itertools
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

l = int(input())
s = 0
li = list(range(1,l+1))
lis = list(itertools.product(li,repeat = 2))
for j in range(1,l+1):
  for i in range(len(lis)):
    s += gcd(lis[i][0],lis[i][1],j)
print(s)

Fixed submission:
import math

l = int(input())
s = 0

for i in range(1, l+1):
  for j in range(1, l+1):
    tmp = math.gcd(i,j)
    for j in range(1, l+1):
      s += math.gcd(tmp,j)
  
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(input())
cnt = 0
flag = 1
i = 0
for i in range(1,sys.maxsize):
  if i < 10:
    cnt += 1
  else:
    s = str(i)
    sn = len(s)
    judge = 0
    sj = int(s[0])
    sj1 = int(s[1])
    if sj in (sj1,sj1 + 1,sj1 - 1):
      for j in range(1,sn):
        sj = int(s[j])
        sj1 = int(s[j-1])
        if sj in (sj1,sj1 + 1,sj1 - 1):
          judge += 0
        else:
          judge += 1
    else:
      judge += 1
    if judge == 0:
      cnt += 1

  if n == cnt:
    print(i)
    exit()





Fixed submission:
k = int(input())
 
table = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in table:
  if len(table) > k:
    break
  x = i % 10
  for j in range(max(0, x - 1), min(x + 2, 10)):
    table.append(i * 10 + j)


print(table[k - 1])
Buggy python submission (verdict: Runtime Error):

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

if c - a - b < 0:
  print("No")
elif Decimal(c**0.5 - a**0.5 - b**0.5) > 0
  print("Yes")
else:
  print("No")

Fixed submission:

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

if 4*a*b - (c - a - b) ** 2 < 0 and c - a - b > 0:
  print("Yes")
  
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
import math
from decimal import Decimal, getcontext
getcontext().prec = 0
a,b,c = map(int,input().split())

if c - a - b < 0:
  print("No")
elif Decimal(c**0.5 - a**0.5 - b**0.5) < 0:
  print("No")
else:
  print("Yes")

Fixed submission:

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

if 4*a*b - (c - a - b) ** 2 < 0 and c - a - b > 0:
  print("Yes")
  
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
import math
from decimal import Decimal, getcontext
getcontext().prec = 0
a,b,c = map(int,input().split())

if Decimal(c**0.5 - a**0.5 - b**0.5) < 0:
  print("No")
else:
  print("Yes")

Fixed submission:

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

if 4*a*b - (c - a - b) ** 2 < 0 and c - a - b > 0:
  print("Yes")
  
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):

from collections import Counter

n = int(input())
s = [input() for i in range(n)]
c = Counter(s)
a = c.most_common()[0][1]
ans = []
for i in range(len(c)):
  if c.most_common()[i][1] == a:
    ans.append(c.most_common()[i][0])

ans.sort()
print(*ans,sep="\n")

Fixed submission:
import collections
n = int(input())
s = [input() for _ in range(n)]
c = collections.Counter(s)
C = c.most_common()
most_count = C[0][1]
answer = []

for i in range(len(C)):
  if most_count == C[i][1]:
    answer.append(C[i][0])

answer.sort()
for i in answer:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
n = int(input())
s = [input() for _ in range(n)]
c = collections.Counter(s)

most_count = c.most_common()[0][1]
answer = []
for i in range(len(c)):
  if most_count == c.most_common()[i][1]:
    answer.append(c.most_common()[i][0])
answer.sort()
for i in answer:
  print(i)

Fixed submission:
import collections
n = int(input())
s = [input() for _ in range(n)]
c = collections.Counter(s)
C = c.most_common()
most_count = C[0][1]
answer = []

for i in range(len(C)):
  if most_count == C[i][1]:
    answer.append(C[i][0])

answer.sort()
for i in answer:
    print(i)

Buggy python submission (verdict: Runtime Error):
from collections import Counter

n = int(input())
s = [input() for i in range(n)]
news = sorted(s)
c = Counter(news)
max = c.most_common()[0][1]
print(c)
for i in range(n):
  if max == c.most_common()[i][1]:
    print(c.most_common()[i][0])
  else:
    break

Fixed submission:
import collections
n = int(input())
s = [input() for _ in range(n)]
c = collections.Counter(s)
C = c.most_common()
most_count = C[0][1]
answer = []

for i in range(len(C)):
  if most_count == C[i][1]:
    answer.append(C[i][0])

answer.sort()
for i in answer:
    print(i)

Buggy python submission (verdict: Runtime Error):
import collections as co

n = int(input())
s = [input() for i in range(n)]

c = co.Counter(s)
max = c.most_common()[0][1]
r = 1
i = 0

while r == 1:
  if max == c.most_common()[i][1]:
    print(c.most_common()[i][0])
  else:
    r = 0
  i += 1


Fixed submission:
import collections
n = int(input())
s = [input() for _ in range(n)]
c = collections.Counter(s)
C = c.most_common()
most_count = C[0][1]
answer = []

for i in range(len(C)):
  if most_count == C[i][1]:
    answer.append(C[i][0])

answer.sort()
for i in answer:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

d = [[int((str(x))[0]),x % 10] for x in range(1,N + 1)] 
a = [[x % 10,int((str(x))[0])] for x in range(1,N + 1)]

count = 0
for i in range(0,N):
    for j in range(0,N):
        if d[i] == a[j]:
            count += 1
print(count)

Fixed submission:
N = int(input())
t = [[0] * 10 for _ in range(10)]
for i in range(1, N + 1):
    s = str(i)
    t[int(s[0])][int(s[-1])] += 1
result = 0
for i in range(1, 10):
    for j in range(1, 10):
        result += t[i][j] * t[j][i]
print(result)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
ps = [input().split() for _ in range(m)]


answer =["inf"]*m
count = 0

for i in range(len(ps)):
  if ps[i][0] not in answer:
    if ps[i][1] == "AC":
      answer[i] = ps[i][0]
    else:
      count += 1
answer.remove("inf")
print(len(answer),count)

Fixed submission:
n, m = map(int, input().split())
ac = 0
wa = 0
cnt = [0]*n

for i in range(m):
    p, s = input().split()
    p = int(p)
    p -= 1
    if cnt[p] == -1:
        continue
    elif s == 'AC':
        ac += 1
        wa += cnt[p]
        cnt[p] = -1
    else:
        cnt[p] += 1
print(ac, wa)
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))

l = list(range(1,n+1))
dic = {}

for i,j in enumerate(itertools.permutations(l)):
    dic[j] = i+1
print(abs(dic[p]-dic[q]))

Fixed submission:
import itertools
 
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))

l = list(range(1,n+1))
dic = {}

for i,j in enumerate(itertools.permutations(l)):
    dic[j] = i+1
print(abs(dic[p]-dic[q]))
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = map(int,input().split())

for i in range(k):
  if a >= 1:
    a -= 1
  elif b >= 1:
    b -= 1


print(a,b)

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

a_af = a - min(a,k)
b_af = max(0,b - (k - min(a,k)))
print(a_af,b_af)
Buggy python submission (verdict: Runtime Error):
import math
a,b=map(int, input().split())
print(a*b//math.gcd(a,b))

Fixed submission:
import fractions
a,b=map(int, input().split())
print(a*b//fractions.gcd(a,b))
Buggy python submission (verdict: Runtime Error):
import heapq

n, m = map(int,input().split())
A = list(map(lambda x: int(x)*(-1), input().split()))

heapq.heapify(A)

for i in range(m):
    a = heap.heappop(A)
    heapq.heappush(A,-1* (-a//2))
print(-sum(a))

Fixed submission:
s = input()

if s == "Sunny":
  print("Cloudy")
elif s == "Cloudy":
  print("Rainy")
elif s == "Rainy":
  print("Sunny")
Buggy python submission (verdict: Time Limit Exceeded):
n,k,q = map(int,input().split())
a = [int(input()) for i in range(q)]

ans = [k]*n
for i in range(q):
  ans = list(map(lambda x : x - 1,ans))
  ans[a[i] - 1] += 1

for i in range(n):
  if ans[i] > 0:
    print("Yes")
  else:
    print("No")

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

ans = [k-q]*n
for i in range(q):
  ans[a[i] - 1] += 1

for i in range(n):
  if ans[i] > 0:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
n = int(input())
anslist = []
for i in range(n):
    s = input()
    c = Counter(s)
    anslist.append(c)
cnt = 0
for i in range(n):
    for j in range(i+1,n):
        if anslist[i] == anslist[j]:
            cnt += 1
print(cnt)

Fixed submission:
from collections import Counter
n = int(input())
ans = []
cnt = 0
for i in range(n):
    s = input()
    l = list(s)
    l.sort()
    ans.append("".join(l))
c = Counter(ans)


for i in c.values():
    cnt += i*(i-1)//2

print(cnt)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
 
if (A+B)%2 == 0:
    print( int((A+B)/2) )
else:
    print('IMPOSSIBLE')

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

print(max(0,c-(a-b)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int,input().split())
b = map(int,input().split())

rest = 0
c = 0
for i in range(n):
    c += min(rest,a[i])
    c += min(max(0,a[i] - rest),b[i])
    rest = max(0, b[i] - a[i])
    
c += min(rest,a[i])
print(c)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
cnt = 0
for i in range(n):
  c = min(a[i] + a[i+1],b[i])
  if b[i] > a[i]:
    a[i+1] = a[i] + a[i+1] - c
  cnt += c
print(cnt)

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



c = [0]*n
for i in range(n):
    if  i > 0 and b[i - 1] > a[i] + a[i - 1]:
        c[i] = min(a[i] + a[i + 1] + a[i - 1] - c[i - 1], b[i])
    else:
        c[i] = min(a[i] + a[i + 1], b[i])

print(sum(c))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
cnt = 0
for i in range(n):
  c = min(a[i] + a[i+1],b[i])
  if b[i] > a[i]:
    a[i+1] = a[i] + a[i+1] - c
  cnt += c
print(cnt)

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



c = [0]*n
for i in range(n):
    if  i > 0 and b[i - 1] > a[i] + a[i - 1]:
        c[i] = min(a[i] + a[i + 1] + a[i - 1] - c[i - 1], b[i])
    else:
        c[i] = min(a[i] + a[i + 1], b[i])

print(c,sum(c))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
cnt = 0
for i in range(n):
  c = min(a[i] + a[i+1],b[i])
  if b[i] > a[i]:
    a[i+1] = a[i] + a[i+1] - c
  cnt += c
print(cnt)

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



c = [0]*(n)
for i in range(n):
    if i > 1 and a[i] < b[i]:
        c[i] = min(a[i] + a[i + 1], b[i])
    else:
        c[i] = min(a[i] + a[i + 1] - c[i - 1], b[i])
print(sum(c))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
cnt = 0
for i in range(n):
  c = min(a[i] + a[i+1],b[i])
  if b[i] > a[i]:
    a[i+1] = a[i] + a[i+1] - c
  cnt += c
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):


n = int(input())
a = [int(input()) for i in range(n)]
sorted_a = sorted(a)

for i in range(n):
  cal_a = sorted_a.copy()
  cal_a.remove(a[i])
  print(cal_a[-1])

Fixed submission:


n = int(input())
a = [int(input()) for i in range(n)]
a_sort = sorted(a)
amax = a_sort[-1]
asmas = a_sort[-2]

for i in range(n):
  if a[i] == amax:
    print(asmas)
  else:
    print(amax)
Buggy python submission (verdict: Time Limit Exceeded):

n,q = map(int,input().split())
s = input()

lr = [list(map(int,input().split())) for i in range(q)]

for i in range(q):
  teststring = s[lr[i][0]-1:lr[i][1]]
  print(teststring.count("AC"))


Fixed submission:

n,q = map(int,input().split())
s = input()

lr = [list(map(int,input().split())) for i in range(q)]
t = [0] * (n+1)
for i in range(n):
  
  t[i+1] = t[i] + (1 if s[i:i+2] == "AC" else 0)
for i in range(q):
  l = lr[i][0]
  r = lr[i][1]
  print((t[r-1]-t[l-1]))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

n = int(input())
a = list(map(int,input().split()))
ac = Counter(a)
an = len(ac)

cnt = 0
for i in range(an):
  num, count = ac.most_common()[i]
  if count > num:
    cnt += count - num
  elif count < num:
    cnt += count

print(cnt)

Fixed submission:
from collections import Counter

n = int(input())
a = list(map(int,input().split()))
ac = Counter(a)
an = len(ac)
a_mostcommon = ac.most_common()
cnt = 0
for i in range(an):
  num, count = a_mostcommon[i]
  if count > num:
    cnt += count - num
  elif count < num:
    cnt += count

print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
k = int(input())


for i in range(n):
    if 2 * s < s + k:
        s += s
    else:
        s += k
print(s)

Fixed submission:
n = int(input())
k = int(input())
s = 1
for i in range(n):
    if 2 * s < s + k:
        s += s
    else:
        s += k
print(s)
Buggy python submission (verdict: Runtime Error):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    # divisors.sort()
    return divisors

a = int(input())
ans = make_divisors(a)

print(len(str(max(ans[-1],ans[-2]))))

Fixed submission:
n = int(input())
 
ans = int(1e5)
 
for a in range(1, int(n ** 0.5) + 1):
    if n % a == 0:
        b = len(str(n // a))
        ans = min(b, ans)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,a,b = map(int,input().split())
s = input()
ans = ["0"]*n
bcnt = 0
for i in range(n):
  if s[i] == "a":
    if ans.count("Yes") < a+b:
      ans[i] = "Yes"
    else:
      ans[i] = "No"
  elif s[i] == "b":
    bcnt += 1
    if ans.count("Yes") < a+b and bcnt <= b:
      ans[i] = "Yes"
    else:
      ans[i] = "No"
  else:
    ans[i] = "No"
print(*ans,sep='\n')

Fixed submission:
n,a,b = map(int,input().split())
s = input()
ans = ["0"]*n
acnt = 0
bcnt = 0
for i in range(n):
  if s[i] == "a":
    if acnt < a+b:
      acnt += 1
      ans[i] = "Yes"
    else:
      ans[i] = "No"
  elif s[i] == "b":
    bcnt += 1
    if acnt < a+b and bcnt <= b:
      acnt += 1
      ans[i] = "Yes"
    else:
      ans[i] = "No"
  else:
    ans[i] = "No"
print(*ans,sep='\n')

Buggy python submission (verdict: Time Limit Exceeded):
n,a,b = map(int,input().split())
s = input()
ans = ["0"]*n
bcnt = 0
for i in range(n):
  if s[i] == "a":
    if ans.count("Yes") < a+b:
      ans[i] = "Yes"
    else:
      ans[i] = "No"
  elif s[i] == "b":
    bcnt += 1
    if ans.count("Yes") < a+b and bcnt <= b:
      ans[i] = "Yes"
    else:
      ans[i] = "No"
  else:
    ans[i] = "No"
print(*ans,sep='\n')

Fixed submission:
n,a,b = map(int,input().split())
s = input()
ans = ["0"]*n
acnt = 0
bcnt = 0
for i in range(n):
  if s[i] == "a":
    if acnt < a+b:
      acnt += 1
      ans[i] = "Yes"
    else:
      ans[i] = "No"
  elif s[i] == "b":
    bcnt += 1
    if acnt < a+b and bcnt <= b:
      acnt += 1
      ans[i] = "Yes"
    else:
      ans[i] = "No"
  else:
    ans[i] = "No"
print(*ans,sep='\n')
Buggy python submission (verdict: Runtime Error):
a = map(int, input().split())

if a%10==3:
  print("bon")
elif a%10 in [0,1,6,8]:
  print("pon")
else:
  print("hon")
  

Fixed submission:
a = int(input())

if a%10==3:
  print("bon")
elif a%10 in [0,1,6,8]:
  print("pon")
else:
  print("hon")
Buggy python submission (verdict: Runtime Error):
s, t map(str, input().split())
ans = t + s
print(ans)

Fixed submission:
s, t = map(str, input().split())
ans = t + s
print(ans)
Buggy python submission (verdict: Runtime Error):
N,A,B = map(int,input().split)
kake = N*A

print(min(kake,B))

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

print(min(kake,B))
Buggy python submission (verdict: Runtime Error):
x, y = int(input("Number")), int(input("Number"))
print(x*y)


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

Buggy python submission (verdict: Runtime Error):
x, y = input("Number")
print(x*y)

Fixed submission:
a,b = map(int,input(). split ())
print(a*b)
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    a_list = []
    for _ in range(n):
        a = int(input())
        a_list.append(a)

    for i in a_list:
        if i == max(a_list):
            a_list.sort()
            print(a_list[-2])
        else:
            print(max(a))

main()

Fixed submission:
def main():
    n = int(input())
    a_list = []
    for i in range(n):
        a = int(input())
        #[タグ、値]
        a_list.append([i,a])

    ans = sorted(a_list, key=lambda x:x[1])
    #print(ans)

    #print("-"*75)
    for i in range(n):
        #if 値 == max(ans)
        if a_list[i][1] == ans[-1][1]:
            #ansの最後から二番目の値
            print(ans[-2][1])
        else:
            print(ans[-1][1])

main()

Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    a_list = []
    for _ in range(n):
        a = int(input())
        a_list.append(a)

    for i in a_list:
        if i == max(a_list):
            a_list.sort()
            print(a_list[-2])
        else:
            print(max(a))

main()

Fixed submission:
def main():
    n = int(input())
    a_list = []
    for i in range(n):
        a = int(input())
        #[タグ、値]
        a_list.append([i,a])

    ans = sorted(a_list, key=lambda x:x[1])
    #print(ans)

    #print("-"*75)
    for i in range(n):
        #if 値 == max(ans)
        if a_list[i][1] == ans[-1][1]:
            #ansの最後から二番目の値
            print(ans[-2][1])
        else:
            print(ans[-1][1])

main()
Buggy python submission (verdict: Runtime Error):
def main():
    s = list(input())
    s_uniq = list(set(s))

    a = s.count(s_uniq[0])
    b = s.count(s_uniq[1])

    if a == 2 and b == 2:
        print("Yes")
    else:
        print("No")

main()

Fixed submission:
def main():
    s = list(input())
    s_unq = list(set(s))

    if len(s_unq) == 2:
        if s.count(s_unq[0]) == 2 and s.count(s_unq[1]):
            print("Yes")
    else:
        print("No")

main()