Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
w,h,x,y = map(int, input().split())
p = 0
if (x==0)|(x==w)|(y==0)|(y==h):
  mens = 0
  p = 0
if (x==(w/2))|(y==(h/2)):
  mens = w*h/2
  if (x==(w/2))&(y==(h/2)):
    p = 1
  else:
    p = 0
elif ((x/y)==(w/h))|(y == -(h/w)*x+h):
  p = 1
  mens = min(x,w-x)*h
else:
  if ((y<h/w*x)&(y<-(h/w)*x+h))|((y>h/w*x)&(y>-(h/w)*x+h)):
    p = 0
    mens = min(y,h-y)*w
  else:
    p = 0
    mens = min(x,w-x)*h
print(mens, p)

Fixed submission:
w,h,x,y = map(int, input().split())
p = 0
if (x==0)|(x==w)|(y==0)|(y==h):
  mens = w*h/2
  p = 0
elif (x==(w/2))|(y==(h/2)):
  mens = w*h/2
  if (x==(w/2))&(y==(h/2)):
    p = 1
  else:
    p = 0
elif ((x/y)==(w/h))|(y == -(h/w)*x+h):
  p = 1
  mens = w*h/2
else:
  if ((y<h/w*x)&(y<-(h/w)*x+h))|((y>h/w*x)&(y>-(h/w)*x+h)):
    p = 0
    mens = w*h/2
  else:
    p = 0
    mens = w*h/2
print(mens, p)
Buggy python submission (verdict: Runtime Error):
n,k = map(int, input().split())
if k=1:
  print(0)
else:
  print(n-k)

Fixed submission:
n,k = map(int, input().split())
if k==1:
  print(0)
else:
  print(n-k)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
x = ""
for i in range(n):
  if s[i] == s[k]:
    x = x+s[i]
  else:
    x = x+"*"
print(x)

Fixed submission:
n = int(input())
s = input()
k = int(input())
x = ""
for i in range(n):
  if s[i] == s[k-1]:
    x = x+s[i]
  else:
    x = x+"*"
print(x)
Buggy python submission (verdict: Runtime Error):
x, y = input().split(" ")
a = int(x)
b = int(y)

ans = {1, 2, 3}
not_ans = {a, b}

z = ans.difference(not_ans)

print(z)

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

ans = {1, 2, 3}
not_ans = {a, b}

for data in ans.difference(not_ans):
    print(data)
Buggy python submission (verdict: Runtime Error):
n = int(input())
w, x = input().split(" ")
s = str(w)
t = str(x)

new_str = ""

for i in range(0, 3):
    new_str += s[i]
    new_str += t[i]

print(new_str)

Fixed submission:
n = int(input())
w, x = input().split(" ")
s = str(w)
t = str(x)

new_str = ""

for i in range(0, n):
    new_str += s[i]
    new_str += t[i]

print(new_str)
Buggy python submission (verdict: Time Limit Exceeded):
w, x = input().split(" ")
a = int(w)
b = int(x)

def compute_lcm(x, y):
   if x > y:
       greater = x
   else:
       greater = y
   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1
   return lcm

print(compute_lcm(a, b))

Fixed submission:
w, x = input().split(" ")
a = int(w)
b = int(x)

def compute_gcd(x, y):
   while(y):
       x, y = y, x % y
   return x

def compute_lcm(x, y):
   lcm = (x*y)//compute_gcd(x,y)
   return lcm

print(compute_lcm(a, b))

Buggy python submission (verdict: Time Limit Exceeded):
w, x = input().split(" ")
a = int(w)
b = int(x)

min = False
i = 1
while(not min):
    if i%a == 0 and i%b == 0:
        min = True
        break
    i += 1

print(i)

Fixed submission:
w, x = input().split(" ")
a = int(w)
b = int(x)

def compute_gcd(x, y):
   while(y):
       x, y = y, x % y
   return x

def compute_lcm(x, y):
   lcm = (x*y)//compute_gcd(x,y)
   return lcm

print(compute_lcm(a, b))
Buggy python submission (verdict: Runtime Error):
A = list(map(int,input().split()))
for i in range(3):
    if sum(x==A[i] for x in A) == 1:
        continue
    elif sum(x==A[i] for x in A) ==2:
        print("Yes")
        return
print("No")


Fixed submission:
def solve():
    A = list(map(int,input().split()))
    for i in range(3):
        if sum(x==A[i] for x in A) == 1 or sum(x==A[i] for x in A) == 3:
            continue
        elif sum(x==A[i] for x in A) ==2:
            print("Yes")
            return
    print("No")

solve()

Buggy python submission (verdict: Runtime Error):
    A = list(map(int,input().split()))
    print(A)
    for i in range(3):
        if sum(x==A[i] for x in A) == 1:
            continue
        elif sum(x==A[i] for x in A) ==2:
            print("Yes")
            return
    print("No")


Fixed submission:
def solve():
    A = list(map(int,input().split()))
    for i in range(3):
        if sum(x==A[i] for x in A) == 1 or sum(x==A[i] for x in A) == 3:
            continue
        elif sum(x==A[i] for x in A) ==2:
            print("Yes")
            return
    print("No")

solve()
Buggy python submission (verdict: Runtime Error):
def solve():
    N = int(input())
    words = ["a"]*N
    for i in range(N):
        words[i] = list(input())
    A_list = []
    B_list = []
    AB_list = [] 
    AB_count = 0
    for i in range(N):
        tag_A = tag_B = tag_AB = 0
        for j in range(len(words[i])):
            if words[i][j] == "A" and j == len(words[i])-1:
                tag_A = 1
                tag_AB = 0
            elif words[i][j] == "A":
                tag_AB = 1
            elif words[i][j] == "B" and tag_AB == 1:
                tag_AB = 0
                AB_count += 1
            elif words[i][j] == "B" and j == 0:
                tag_B = 1
                tag_AB = 0
            else:
                tag_AB = 0
        if tag_A == 1 and tag_B == 1:
            AB_list.append(i)
        elif tag_A == 1:
            A_list.append(i)
        elif tag_B == 1:
            B_list.append(i)
        #print(tag_A,tag_B,AB_count,A_list,B_list,AB_list)

    if len(AB_list) > 0 and len(A_list) > 0 and len(B_list) > 0:
        count = AB_count + len(AB_list) + min(len(A_list),len(B_list))
    elif len(AB_list) > 0 and len(A_list) == 0 and len(B_list) == 0:
        count = AB_count + len(AB_list) -1
    elif len(AB_list) > 0 and (len(A_list) == 0 or len(B_list) == 0):
        count = AB_count + len(AB_list)
    else:
        count = AB_count + min(len(A_list),len(B_list))

    print(count)


 solve()


Fixed submission:
def solve():
    N = int(input())
    words = ["a"]*N
    for i in range(N):
        words[i] = list(input())
    A_list = []
    B_list = []
    AB_list = [] 
    AB_count = 0
    for i in range(N):
        tag_A = tag_B = tag_AB = 0
        for j in range(len(words[i])):
            if words[i][j] == "A" and j == len(words[i])-1:
                tag_A = 1
                tag_AB = 0
            elif words[i][j] == "A":
                tag_AB = 1
            elif words[i][j] == "B" and tag_AB == 1:
                tag_AB = 0
                AB_count += 1
            elif words[i][j] == "B" and j == 0:
                tag_B = 1
                tag_AB = 0
            else:
                tag_AB = 0
        if tag_A == 1 and tag_B == 1:
            AB_list.append(i)
        elif tag_A == 1:
            A_list.append(i)
        elif tag_B == 1:
            B_list.append(i)

    if len(AB_list) > 0 and len(A_list) > 0 and len(B_list) > 0:
        count = AB_count + len(AB_list) + min(len(A_list),len(B_list))
    elif len(AB_list) > 0 and len(A_list) == 0 and len(B_list) == 0:
        count = AB_count + len(AB_list) -1
    elif len(AB_list) > 0 and (len(A_list) == 0 or len(B_list) == 0):
        count = AB_count + len(AB_list)
    else:
        count = AB_count + min(len(A_list),len(B_list))

    print(count)


solve()
Buggy python submission (verdict: Runtime Error):
def solve():
    A,B,T = int(input().split())
    num = B*int(T/A)
    print(num)


solve()

Fixed submission:
def solve():
    A,B,T = map(int,input().split())
    num = B*int(T/A)
    print(num)


solve()
Buggy python submission (verdict: Runtime Error):
def solve():
    N = int(input())
    V = list(map(int,input().split()))
    C = list(map(int,input().split()))
    cnt=0
    for i in range(len(V)):
        if V < C:
            pass
        else:
            cnt += V(i)-C(i)
    print(cnt)


solve()


Fixed submission:
def solve():
    N = int(input())
    V = list(map(int,input().split()))
    C = list(map(int,input().split()))
    cnt=0
    for i in range(len(V)):
        if V[i] < C[i]:
            pass
        else:
            cnt += V[i]-C[i]
    print(cnt)


solve()
Buggy python submission (verdict: Runtime Error):
def solve():
    num_total = int(input())
    num_transport=[0]*5
    for i in range(5):
        num_transport[i]=int(input())
    time = math.ceil(num_total/num_transport[0])
    x = num_transport[0]
    for i in range(1,5):
        if num_transport[i] < x:
            time = i+ math.ceil(num_total/num_transport[i])
            x = num_transport[i]
        else:
            time += 1
    print(time)

solve()

Fixed submission:
import math

def solve():
    num_total = int(input())
    num_transport=[0]*5
    for i in range(5):
        num_transport[i]=int(input())
    time = math.ceil(num_total/num_transport[0])
    x = num_transport[0]
    for i in range(1,5):
        if num_transport[i] < x:
            time = i+ math.ceil(num_total/num_transport[i])
            x = num_transport[i]
        else:
            time += 1
    print(time)


solve()
Buggy python submission (verdict: Time Limit Exceeded):
s = input()

tag = 0
i = 1
num = [0]*1000000

while tag == 0:
    if int(s)%2 == 0:
        s = int(s)/2
    else:
        s = 3*int(s) + 1
    i += 1
    for j in range(i):
        if s == num[j]:
            tag = 1
            break
        else:
            continue

print (i)



Fixed submission:
s = input()

tag = 0
i = 1
num = []

while tag == 0:
    if i > 1000000:
        break
    num.append(int(s))
    if int(s)%2 == 0:
        s = int(s)/2
    else:
        s = 3*int(s) + 1
    i += 1
    for j in range(int(i)-1):
        if int(s) == int(num[j]):
            tag = 1
            print (i)
            break
        else:
            continue
Buggy python submission (verdict: Runtime Error):
H,A=int(input())
  
print((H // A)+1)

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

if H%A==0:
  print(H // A)
else:
  print((H // A)+1)
Buggy python submission (verdict: Runtime Error):
H,K=map(int,input().split())
 
ln=list(map(int,input().split()))
 
sum=0

if K!=0:
	ln.sort(reverse=True)
	for A in range(K):
		ln[A]=0
 
for A in ln:
  sum+=A
 
print(sum)

Fixed submission:
H,K=map(int,input().split())
 
s=list(map(int,input().split()))
 
sum=0

s.sort(reverse=True)

if K>=len(s):
  for A in range(len(s)):
    s[A]=0

else:
  for A in range(K):
    s[A]=0



for A in s:
  sum+=A
 
print(sum)

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

ln=list(map(int,input().split()))
 
sum=0

ln.sort(reverse=True)
for A in range(K):
	ln[A]=0
 
for A in ln:
  sum+=A
 
print(sum)

Fixed submission:
H,K=map(int,input().split())
 
s=list(map(int,input().split()))
 
sum=0

s.sort(reverse=True)

if K>=len(s):
  for A in range(len(s)):
    s[A]=0

else:
  for A in range(K):
    s[A]=0



for A in s:
  sum+=A
 
print(sum)

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

ln=list(map(int,input().split()))

sum=0

if K!=0:
	for A in range(K):
  		ln[ln.index(max(ln))]=0

for A in ln:
  sum+=A

print(sum)

Fixed submission:
H,K=map(int,input().split())
 
s=list(map(int,input().split()))
 
sum=0

s.sort(reverse=True)

if K>=len(s):
  for A in range(len(s)):
    s[A]=0

else:
  for A in range(K):
    s[A]=0



for A in s:
  sum+=A
 
print(sum)

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

ln=list(map(int,input().split()))

sum=0

for A in range(K):
  ln[ln.index(max(ln))]=0

for A in ln:
  sum+=A

print(sum)

Fixed submission:
H,K=map(int,input().split())
 
s=list(map(int,input().split()))
 
sum=0

s.sort(reverse=True)

if K>=len(s):
  for A in range(len(s)):
    s[A]=0

else:
  for A in range(K):
    s[A]=0



for A in s:
  sum+=A
 
print(sum)

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

ln=list(map(int,input().split()))

sum=0

for _ in range(K):
  ln[ln.index(max(ln))]=0

for A in range(ln):
  sum+=ln[A]

print(sum)


Fixed submission:
H,K=map(int,input().split())
 
s=list(map(int,input().split()))
 
sum=0

s.sort(reverse=True)

if K>=len(s):
  for A in range(len(s)):
    s[A]=0

else:
  for A in range(K):
    s[A]=0



for A in s:
  sum+=A
 
print(sum)
Buggy python submission (verdict: Runtime Error):
S, T = map(str(), input().split())
print(T + S)

Fixed submission:
S, T = map(str, input().split())
print(T+S)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int, input().split())

for k in range(K):
  if(A != 0):
    A-=1
  elif(B > 0):
    B-=1
  else:
    break
print(A, B)

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

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

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

for k in range(K):
  if(A != 0):
    A-=1
  elif(B > 0):
    B-=1
print(A, B)

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

if(A - K >= 0):
  A -= K
else:
  if(B+(A-K) >= 0):
    B += A - K
    A = 0
  else:
    A = 0
    B = 0
print(A, B)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
print(6-A-B)

Fixed submission:
print(6 - int(input())- int(input()))

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
l1 = [1,2,3]
l2 = [A, B]
l = l1 - l2
print(l[0])

Fixed submission:
print(6 - int(input())- int(input()))
Buggy python submission (verdict: Runtime Error):
days = ['SUN','MON','TUE','WED','THU','FRI','SAT'] 
i = str(input())
count = 7
for day in days:
  if i == day:
    print(count)
    break
   else:
    count-=1

Fixed submission:
days = ['SUN','MON','TUE','WED','THU','FRI','SAT'] 
i = str(input())
count = 7
for day in days:
  if i == day:
    print(count)
    break
  else:
    count-=1
Buggy python submission (verdict: Runtime Error):
r = input()
print(int(r*r))

Fixed submission:
r = int(input())
print(r**2)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))

value = 0
index = 0

for i in range(0, k):
    value += p[i]

max = value

for i in range(1, n - k + 1):
    value = value - p[i - 1] + p[i + k - 1]
    if value > max:
        max = value
        index = i

total = 0
for i in range(index, index + k):
    total += p[i] / 2 + 0.5

print(total)

Fixed submission:
s, t = input().split()
a, b = map(int, input().split())
u = input()

if s == u:
    a -= 1
else:
    b -= 1

print(str(a) + " " + str(b))
Buggy python submission (verdict: Time Limit Exceeded):
def merge(array):
    mid = len(array)
    if mid > 1:
        mid = mid // 2
        left = merge(array[:mid])
        right = merge(array[mid:])
        array = []
        while len(left) != 0 and len(right) != 0:
            if left[0] == right[0]:
                print("NO")
                exit()
            elif left[0] < right[0]:
                array.append(left.pop(0))
            else:
                array.append(right.pop(0))
        if len(left) != 0:
            array.extend(left)
        elif len(right) != 0:
            array.extend(right)
    return array

n = int(input())
a = list(map(int, input().split()))
a.sort()
merge(a)
print("YES")

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = {}
flag = 0

for i in A:
    if (ans.get(i) != None):
        flag = 1
        break
    else:
        ans[i] = 1

if (flag == 0):
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

for i in range(0, n):
    for j in range(i + 1, n):
        if a[i] == a[j]:
            print("NO")
            exit()

print("YES")

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = {}
flag = 0

for i in A:
    if (ans.get(i) != None):
        flag = 1
        break
    else:
        ans[i] = 1

if (flag == 0):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split())
if len(set(A))==1:
    print('No')
elif len(set(A)) == 2:
    print('Yes')
else:
    print('No')

Fixed submission:
a,b,c = map(int, input().split())
A = [a,b,c]
if len(set(A)) == 1 or len(set(A)) == 3:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
import itertools
def main():
    N = int(input())
    P = list(map(int, input().split()))
    S = list(map(int, input().split()))
    count = 1
    for i in itertools.permutations(list(range(1,N + 1))):
        if P == list(i):
            a = count
        elif S == list(i):
            b = count
        count += 1
    print(abs(a - b))
main()

Fixed submission:
import itertools
def main():
    N = int(input())
    P = list(map(int, input().split()))
    S = list(map(int, input().split()))
    count = 1
    if P == S:
        print(0)
    else:
        for i in itertools.permutations(list(range(1,N + 1))):
            if P == list(i):
                a = count
            elif S == list(i):
                b = count
            count += 1
        print(abs(a - b))
main()
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

print(T+S)

Fixed submission:
def main():
    S,T = map(str,input().split())
    print(T+S)
 
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    A,B,K = map(int,input().split())
    for i in range(0,K):
        if A > 0:
           A = A - 1
        elif B > 0:
            B = B - 1
    print(A,B)
 
if __name__ == '__main__':
    main()


Fixed submission:
def main():
    A,B,K = map(int,input().split())
    if A+B < K:
        print(0,0)
    else:
        if A < K:
            print(0, A+B-K)
        else:
            print(A-K, B)
 
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import itertools
def main():
    S = int(input())
    a = [int(i) for i in input().split()]
    x = 10**9
    
    xor = 0
    patern = list(itertools.combinations(a, 2))
    for p in patern:
        xor += p[0] ^ p[1]
    if xor >= x:
        print(xor % (x + 7))
    else:
        print(xor)

if __name__ == '__main__':
    main()

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

if(N + K + Q >= 22):
    print("bust")
else:
    print("win")
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))
ep = list(map(lambda x:(x+1)/2,p))
m = -1
for i in range(n-k+1):
  if (sum(ep[i:i+k])>m):
    m = sum(ep[i:i+k])
print(m)

Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
ep = list(map(lambda x:(x+1)/2,p))
m = -1
epp = [0 for i in range(n+1)]
for i in range(n):
  epp[i+1] = ep[i]+epp[i]
for i in range(n-k+1):
  if (epp[i+k]-epp[i]>m):
    m = epp[i+k]-epp[i]
print(m)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s,t = map(input().split())
for i in range(n):
  print(s[i]+t[i],end='')

Fixed submission:
n = int(input())
s,t = input().split()
for i in range(n):
  print(s[i]+t[i],end='')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s_list = []
for i in range(N):
  s_list.append(''.join(sorted(input())))
c = 0
for i in range(N):
  for j in range(i+1,N):
    if (s_list[i] == s_list[j]):
      c += 1
print(c)

Fixed submission:
import collections
N = int(input())
s_list = []
for i in range(N):
  s_list.append(''.join(sorted(input())))
s_list = collections.Counter(s_list)
def f(n):
  return int(n*(n+1)/2)
result = sum([f(n-1) for n in s_list.values()])
print(result)
Buggy python submission (verdict: Runtime Error):
N = int(input())
b_list = list(map(int,input().split()))
s = True
if (b_list[0] > 1):
  b_list -= 1
for i in range(1,len(b_list)):
  if (b_list[i-1] < b_list[i]):
    b_list[i] -= 1
for i in range(len(b_list)-1):
  if (b_list[i] > b_list[i+1]):
    s = False
if (s):
  print('Yes')
else:
  print('No')
  

Fixed submission:
N = int(input())
b_list = list(map(int,input().split()))
s = True
if (b_list[0] > 1):
  b_list[0] -= 1
for i in range(1,len(b_list)):
  if (b_list[i-1] < b_list[i]):
    b_list[i] -= 1
for i in range(len(b_list)-1):
  if (b_list[i] > b_list[i+1]):
    s = False
if (s):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
b_list = list(map(int,input().split()))
d_list = [True for i in range(N)]
s = True
b_list.append(1000000000)
for _ in range(N):
  for i in range(len(b_list)-1):
    if (b_list[i] > b_list[i+1]):
      if (d_list[i]):
        b_list[i] -= 1
        d_list[i] = False
      else:
        s = False
        break
if (s):
  print('Yes')
else:
  print('No')

Fixed submission:
N = int(input())
b_list = list(map(int,input().split()))
s = True
if (b_list[0] > 1):
  b_list[0] -= 1
for i in range(1,len(b_list)):
  if (b_list[i-1] < b_list[i]):
    b_list[i] -= 1
for i in range(len(b_list)-1):
  if (b_list[i] > b_list[i+1]):
    s = False
if (s):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
inf = 1e14
dp_table = [inf for i in range(n)]
dp_table[0] = 0
dp_table[1] = abs(a[0] - a[1])
for i in range(2,len(a)):
    dp_table[i] = min(dp_table[i-2]+abs(a[i-2]-a[i]),dp_table[i-1]+abs(a[i-1]-a[i]))
    print(dp_table)
print(dp_table[-1])


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

dp_table = [0 for i in range(n)]
dp_table[1] = abs(a[0] - a[1])
for i in range(2,len(a)):
    dp_table[i] = min(dp_table[i-2]+abs(a[i-2]-a[i]),dp_table[i-1]+abs(a[i-1]-a[i]))
print(dp_table[-1])
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


N = int(readline())
S = [int(x) - ord("A") for x in read().rstrip]
N = int(readline())

S = [(x + N) % 26 for x in S]

anser = "".join(chr(x + ord("A")) for x in S)

print(anser)


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

out = ""
for i in S:
    tmp = (ord(i) + N) % 91
    if tmp < 65:
        tmp = tmp + 65
    out = out + chr(tmp)

print(out)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


N = int(readline())
S = [int(x) - ord("A") for x in read().rstrip]
N = int(readline())

S = [(x + N) % 26 for x in S]

anser = "".join([chr(x + ord("A")) for x in S])

print(anser)


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

out = ""
for i in S:
    tmp = (ord(i) + N) % 91
    if tmp < 65:
        tmp = tmp + 65
    out = out + chr(tmp)

print(out)
Buggy python submission (verdict: Runtime Error):
s=input()
num=len(s)å
print("x"*(num))

Fixed submission:
s=input()
num=len(s)
print("x"*(num))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int, input().split()))
# n=5
# l=[4,2,5,1,3]
count=0

import heapq


for i in range(1,len(l)+1):
    s=l[:i]
    heapq.heapify(s) 
    if heapq.heappop(s[:i])==l[i-1]:
        count+=1
    
    
    
print(count)

Fixed submission:
n=int(input())
l=list(map(int, input().split()))
# n=5
# l=[4,2,5,1,3]
count=0

import heapq

tmp=l[0]
for i in range(1,len(l)+1):
    if tmp>=l[i-1]:
        count+=1
        tmp=l[i-1]
    
    
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int, input().split()))
# n=5
# l=[4,2,5,1,3]
count=0
for i in range(1,len(l)+1):
#     print(l[:i])
#     print(l[i-1])
    if min(l[:i])==l[i-1]:
        count+=1
    
    
    
print(count)

Fixed submission:
n=int(input())
l=list(map(int, input().split()))
# n=5
# l=[4,2,5,1,3]
count=0

import heapq

tmp=l[0]
for i in range(1,len(l)+1):
    if tmp>=l[i-1]:
        count+=1
        tmp=l[i-1]
    
    
print(count)

Buggy python submission (verdict: Runtime Error):
n=int(input())
l=map(int, input().split())
# n=5
# l=[4,2,5,1,3]
count=0
for i in range(1,len(l)+1):
#     print(l[:i])
#     print(l[i-1])
    if min(l[:i])==l[i-1]:
        count+=1
    
    
    
print(count)

Fixed submission:
n=int(input())
l=list(map(int, input().split()))
# n=5
# l=[4,2,5,1,3]
count=0

import heapq

tmp=l[0]
for i in range(1,len(l)+1):
    if tmp>=l[i-1]:
        count+=1
        tmp=l[i-1]
    
    
print(count)