Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
S=input()
Q=int(input())
Query=[list(input().split()) for i in range(Q)]

for i in Query:
    if int(i[0]) == 1:
        S = S[::-1]
    elif int(i[0]) == 2:
        if int(i[1]) == 1:
            tmp = [i[2],S]
            S = ''.join(tmp)
        elif int(i[1]) == 2:
            tmp = [S,i[2]]
            S = ''.join(tmp)
print(S)

Fixed submission:
S=input()
Q=int(input())
Query=[input().split() for i in range(Q)]
bf=''
af=''
Flag=True

for i in range(Q):
    if Query[i][0] == '1':
        Flag = not Flag
    else:
        if Query[i][1] == '1':
            if Flag:
                bf = bf + Query[i][2]
            else:
                af = af + Query[i][2]
        else:
            if Flag:
                af = af + Query[i][2]
            else:
                bf = bf + Query[i][2]

ans = bf[::-1] + S + af

if not Flag:
    ans = ans[::-1]

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
S=input()
Q=int(input())
Query=[list(input().split()) for i in range(Q)]

for i in Query:
    if int(i[0]) == 1:
        S = S[::-1]
    elif int(i[0]) == 2:
        if int(i[1]) == 1:
            S = i[2] + S
        elif int(i[1]) == 2:
            S = S + i[2]


print(S)

Fixed submission:
S=input()
Q=int(input())
Query=[input().split() for i in range(Q)]
bf=''
af=''
Flag=True

for i in range(Q):
    if Query[i][0] == '1':
        Flag = not Flag
    else:
        if Query[i][1] == '1':
            if Flag:
                bf = bf + Query[i][2]
            else:
                af = af + Query[i][2]
        else:
            if Flag:
                af = af + Query[i][2]
            else:
                bf = bf + Query[i][2]

ans = bf[::-1] + S + af

if not Flag:
    ans = ans[::-1]

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
N,M = map(int,input().split())
sc = [list(map(int,input().split())) for i in range(M)]

ans = [0] * N
checkd = [False] * N

for i in range(M):
    if not checkd[sc[i][0]-1]:
        checkd[sc[i][0]-1] = True
        ans[sc[i][0]-1] = sc[i][1]
    else:
        if ans[sc[i][0]-1] != sc[i][1]:
            print('-1')
            sys.exit()

if N >= 2 and checkd[0] and ans[0] == 0:
    print('-1')
    sys.exit()

real = 0
for i in ans:
    real = real * 10 + i
    
print(real)

Fixed submission:
N=int(input())
X=list(map(int,input().split()))
min = 9999999999
for i in range(1,101):
    sum = 0
    for j in range(N):
        sum += (X[j] - i)**2
        
    if sum < min:
        min = sum

print(min)
Buggy python submission (verdict: Runtime Error):
import math
H,N=map(int,input().split())
A=list(map(int,input().split()))

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

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

if H <= sum(A):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N=int(input())
P=list(map(int,input().split()))
ans=0
flag=True
for i in range(N):
  for j in range(i):
    if(P[i]>P[j]):
      flag=False
      break
  if flag:ans+=1
  flag=True
print(ans)

Fixed submission:
A,B=map(int,input().split())
if A==B:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
N=int(input())
P=[int(x) for x in stdin.readline().rstrip().split()]
ans=0
flag=True
for i in range(N):
  for j in range(i):
    if(P[i]>P[j]):
      flag=False
      break
  if flag:ans+=1
  flag=True
print(ans)

Fixed submission:
from sys import stdin
N=int(input())
P=[int(x) for x in stdin.readline().rstrip().split()]
ans=1
min=P[0]

for i in range(1,N):
  if(P[i] < min):
    ans+=1
    min=P[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
P=list(map(int,input().split()))
ans=0
flag=True
for i in range(N):
  for j in range(i):
    if(P[i]>P[j]):
      flag=False
      break
  if flag:ans+=1
  flag=True
print(ans)

Fixed submission:
from sys import stdin
N=int(input())
P=[int(x) for x in stdin.readline().rstrip().split()]
ans=1
min=P[0]

for i in range(1,N):
  if(P[i] < min):
    ans+=1
    min=P[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))
ans = 0
flag = True

for i in range(N):
  flag = True
  for j in range(i):
    if(P[i] > P[j]):
      flag = False
      break
  if(flag):
    ans += 1

print(ans)

Fixed submission:
from sys import stdin
N=int(input())
P=[int(x) for x in stdin.readline().rstrip().split()]
ans=1
min=P[0]

for i in range(1,N):
  if(P[i] < min):
    ans+=1
    min=P[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))
ans = 0
flag = True

for i in range(N):
  flag = True
  for j in range(i):
    if(P[i] > P[j]):
      flag = False
      break
  if(flag):
    ans += 1

print(ans)

Fixed submission:
from sys import stdin
N=int(input())
P=[int(x) for x in stdin.readline().rstrip().split()]
ans=1
min=P[0]

for i in range(1,N):
  if(P[i] < min):
    ans+=1
    min=P[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))

print(a[1],a[0])

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

print(a[1] + a[0])
Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int,input().split()))
 
for i in range(a[2]):
  if a[0] != 0:
    a[0] = a[0] - 1
  elif a[1] != 0:
    a[1] = a[1] - 1
 
print(a[0],a[1])

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

if A >= K:
  ans_A = A - K
  ans_B = B
elif A + B >= K:
  ans_A = 0
  ans_B = B - (K - A)
else:
  ans_A = 0
  ans_B = 0

print(ans_A,ans_B)

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

for i in range(a[2]):
  if a[0] != 0:
    a[0] = a[0] - 1
  elif a[1] != 0:
    a[1] = a[1] - 1

print(a[0],a[1])

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

if A >= K:
  ans_A = A - K
  ans_B = B
elif A + B >= K:
  ans_A = 0
  ans_B = B - (K - A)
else:
  ans_A = 0
  ans_B = 0

print(ans_A,ans_B)
Buggy python submission (verdict: Runtime Error):
import math
A,B = map(int,input().split())

def lcm(x,y):
    return (x*y) // math.gcd(x, y)

print(lcm(A,B))

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

def lcm(x,y):
    return (x*y) // fractions.gcd(x, y)

print(lcm(A,B))
Buggy python submission (verdict: Runtime Error):
print(int(input())*2)print(int(input())*2)

Fixed submission:
r=int(input())

print(r**2)
Buggy python submission (verdict: Time Limit Exceeded):
import math
K,S = map(int,input().split())
ans=0

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

print(ans)

Fixed submission:
import math
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 z >= 0 and K >= z:
            ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
x,y,z=map(int, input().split)
print("{} {} {}".format(z,x,y))

Fixed submission:
x,y,z=map(int, input().split())
print("{} {} {}".format(z,x,y))
Buggy python submission (verdict: Runtime Error):
N,K=map(int, input().split())
m=int(N/K)

min_0 = N
min_1 = abs(N-m*K)
min_2 = abs(min_1-K)

print(min(min_0, min_1, min_2))N,K=map(int, input().split())
m=int(N/K)

min_0 = N
min_1 = abs(N-m*K)
min_2 = abs(min_1-K)
m=int(min_2/K)
min_3 = abs(min_2-m*K)

print(min(min_0, min_1, min_2, min_3))

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

min_0 = N
min_1 = abs(N-m*K)
min_2 = abs(min_1-K)
m=int(min_2/K)
min_3 = abs(min_2-m*K)

print(min(min_0, min_1, min_2, min_3))
Buggy python submission (verdict: Runtime Error):
a,b = input().split()
if (a*b)%2==0:
  print('Even')
else:
  print('Odd')

Fixed submission:
a,b = map(int, input().split())
if (a*b)%2==0:
  print('Even')
else:
  print('Odd')
Buggy python submission (verdict: Runtime Error):
a, b = input().split()
l_a = len(a)
l_b = len(b)
if sqrt(int(a)*10**l_b + int(b)).is_integer():
  print('Yes')
else:
  print('No')

Fixed submission:
a, b = input().split()
l_a = len(a)
l_b = len(b)
if ((int(a)*(10**l_b) + int(b))**0.5).is_integer():
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
li=[]
for i in range(1000000):
  c=A*(i+1)%B
  if c  in li:
    break
  li += c

if C in li:
  print("YES")
else:
  print("NO")




Fixed submission:
A, B, C = map(int, input().split())
li=[]
for i in range(1000000):
  c=A*(i+1)%B
  if c  in li:
    break
  li.append(c)

if C in li:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
c=1
for i in range(N):
  c *= i+1
c = c % (10**9+7)
print(c)

Fixed submission:
N=int(input())
c=1
for i in range(N):
  c *= i+1
  c = c % (10**9+7) # ここで、掛け算のスケールを減らすのか！

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

c=0
for i in range(K+1):
  for j in range(K+1):
    if k > S-i-j:
        c+=1

print(c)
  

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

c=0
for i in range(K+1):
  for j in range(K+1):
    if S <= i+j+K and i+j<=S:
      # print("{} {}".format(i,j))
      c+=1

print(c)

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

c=0
for i in range(K+1):
  for j in range(K+1):
    for k in range(K+1):
      if i+j+k==S:
        c+=1

print(c)
  

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

c=0
for i in range(K+1):
  for j in range(K+1):
    if S <= i+j+K and i+j<=S:
      # print("{} {}".format(i,j))
      c+=1

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

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = [0] * n
count = 0
for i in range(n):
    if i + a[i] < n:
        b[i + a[i]] += 1
    if i - a[i] >= 0:
        count += b[i-a[i]]
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lis = []
count = 0
for _ in range(n):
    i = input()
    if not i in lis:
        count += 1
        lis.append(i)
print(count)

Fixed submission:
n = int(input())
lis = set()
count = 0
for _ in range(n):
    lis.add(input())

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

for i in range(n):
    print(len([j for j in a if j == i + 1]))

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

lis = [0] * n
for i in a:
    lis[i-1] += 1
for i in lis:
    print(i)
Buggy python submission (verdict: Runtime Error):

num = input()
s = input()
res = ""
for x in s:
    loc = ord(x) + num
    res += chr(loc - 26 if loc > 90 else loc)
print(res)

Fixed submission:
num = int(input())
s = input()
res = ""
for x in s:
    loc = ord(x) + num
    res += chr(loc - 26 if loc > 90 else loc)
print(res)
Buggy python submission (verdict: Runtime Error):

###
#main
if __name__ == "__main__":
    N = int(input())
    S = input()
#    count = 0
    countMin = 200001
    counttemp = 0
    isWhite = True
    numlist = []
    for t in S:
        if t == "#" and isWhite:
            isWhite = False
            numlist.append(counttemp)
            counttemp = 0
        if t == "." and not isWhite:
            isWhite = True
            numlist.append(counttemp)
            counttemp = 0
        counttemp += 1
    
    numlist.append(counttemp)
    if len(numlist) <= 2:
        countMin = 0
    else:
        j = 1
        while j < N:
            counttemp = 0
            i = 2
            while i < N:
                if i < j :
                    counttemp += numlist[i-1]
                else:
                    counttemp += numlist[i]
                i += 2
            if counttemp < countMin:
                countMin = counttemp
            j += 1    
#    print(numlist)           
    print(countMin)
    

Fixed submission:
###
#main
if __name__ == "__main__":
    N = int(input())
    S = input()
#    count = 0
    countMin = 200001
    counttemp = 0
    isWhite = True
    numlist = []
    for t in S:
        if t == "#" and isWhite:
            isWhite = False
            numlist.append(counttemp)
            counttemp = 0
        if t == "." and not isWhite:
            isWhite = True
            numlist.append(counttemp)
            counttemp = 0
        counttemp += 1
    
    numlist.append(counttemp)
    if len(numlist) <= 2:
        countMin = 0
    else:
        countMin = sum(numlist[2::2])
        temp = countMin
        i = 2
        while i < len(numlist):
            temp += numlist[i-1] - numlist[i]
            countMin = temp if temp < countMin else countMin
            i += 2
#    print(numlist)           
    print(countMin)

Buggy python submission (verdict: Runtime Error):

###
#main
if __name__ == "__main__":
    N = int(input())
    S = input()
    count = 0
    for t in S:
        if t == "#":
            keepColor = True
        if keepColor and t == ".":
            count += 1
    count2 = 0
    keepColor = False
    for t in S[::-1]:
        if t == ".":
            keepColor = True
        if keepColor and t == "#":
            count2 += 1
    print(min(count,count2))
    

Fixed submission:
###
#main
if __name__ == "__main__":
    N = int(input())
    S = input()
#    count = 0
    countMin = 200001
    counttemp = 0
    isWhite = True
    numlist = []
    for t in S:
        if t == "#" and isWhite:
            isWhite = False
            numlist.append(counttemp)
            counttemp = 0
        if t == "." and not isWhite:
            isWhite = True
            numlist.append(counttemp)
            counttemp = 0
        counttemp += 1
    
    numlist.append(counttemp)
    if len(numlist) <= 2:
        countMin = 0
    else:
        countMin = sum(numlist[2::2])
        temp = countMin
        i = 2
        while i < len(numlist):
            temp += numlist[i-1] - numlist[i]
            countMin = temp if temp < countMin else countMin
            i += 2
#    print(numlist)           
    print(countMin)
Buggy python submission (verdict: Runtime Error):
K = int(input())
a, b = map(int, input().split())
ans = 'NG'
for i in range(a, b+1):
  if i % K == 0:
    ans = 'OK'
	break
print(ans)

Fixed submission:
def resolve():
    K = int(input())
    a, b = map(int, input().split())
    ans = 'NG'
    for i in range(a, b + 1):
        if i % K == 0:
            ans = 'OK'
            break
    print(ans)

resolve()
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    N, X, Y = map(int, input().split())
    X -= 1
    Y -= 1
    from collections import defaultdict, deque
    matrix = [[0]*N for _ in range(N)]
    for i in range(N-1):
        matrix[i][i+1] = matrix[i+1][i] = 1
    matrix[X][Y] = matrix[Y][X] = 1

    ans = [0] * N
    for i in range(N):
        queue = deque([(i, 0)])
        d = [float('inf')] * N
        while queue:
            node, dist = queue.popleft()
            if d[node] != float('inf'):
                continue
            d[node] = dist
            for adj in range(N):
                if matrix[node][adj]:
                    queue.append([adj, dist+1])
        for j in range(N):
            ans[d[j]] += 1
    for i in range(1, N):
        print(ans[i]//2)
resolve()

Fixed submission:
def resolve():
    N, X, Y = map(int, input().split())
    from collections import defaultdict
    dist = defaultdict(int)
    for i in range(1, N):
        for j in range(i+1, N+1):
            _dist = min(j-i, abs(X-i) + 1 + abs(j-Y), abs(Y-i) + 1 + abs(j-X))
            dist[_dist] += 1
    for i in range(1, N):
        print(dist[i])

resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    N, X, Y = map(int, input().split())
    X -= 1
    Y -= 1
    from collections import defaultdict, deque
    ans = [0] * N
    for i in range(N):
        queue = deque([(i, 0)])
        d = [float('inf')] * N
        while queue:
            node, dist = queue.popleft()
            if d[node] != float('inf'):
                continue
            d[node] = dist
            if node == X:
                queue.append([Y, dist+1])
            if node == Y:
                queue.append([X, dist+1])
            if node + 1 < N:
                queue.append([node+1, dist+1])
            if node - 1 >= 0:
                queue.append([node-1, dist+1])
        for j in range(N):
            ans[d[j]] += 1
    for i in range(1, N):
        print(ans[i]//2)
resolve()


Fixed submission:
def resolve():
    N, X, Y = map(int, input().split())
    from collections import defaultdict
    dist = defaultdict(int)
    for i in range(1, N):
        for j in range(i+1, N+1):
            _dist = min(j-i, abs(X-i) + 1 + abs(j-Y), abs(Y-i) + 1 + abs(j-X))
            dist[_dist] += 1
    for i in range(1, N):
        print(dist[i])

resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
    X, Y, A, B, C = map(int, input().split())
    p = sorted(list(map(int, input().split())), reverse=True)
    q = sorted(list(map(int, input().split())), reverse=True)
    r = sorted(list(map(int, input().split())), reverse=True)
    pp, pq, pr = 0, 0, 0
    x, y = 0, 0
    ans = 0
    while X > 0 and Y > 0:
        while X > 0 and p[pp] > r[pr]:
            ans += p[pp]
            pp += 1
            X -= 1

        while Y > 0 and q[pq] > r[pr]:
            ans += q[pq]
            pq += 1
            Y -= 1
		
        if not X and not Y:
            break
        ans += r[pr]
        pr += 1
        if not X or X < Y:
            Y -= 1
        else:
            X -= 1

    print(ans)

resolve()

Fixed submission:
def resolve():
    X, Y, A, B, C = map(int, input().split())
    p = sorted(list(map(int, input().split())), reverse=True)
    q = sorted(list(map(int, input().split())), reverse=True)
    r = sorted(list(map(int, input().split())), reverse=True)
    pre = sorted(p[:X] + q[:Y])
    for i in range(min(X + Y, C)):
        if pre[i] < r[i]:
            pre[i] = r[i]
        else:
            break
    print(sum(pre))

resolve()
Buggy python submission (verdict: Runtime Error):
input = map(int, input().split())
N, A, B = input
base = 'b'*A+'r'*B
length = len(base)
base *= (int(N/length)+1)
print(base[:N].count('b'))

Fixed submission:
def resolve():
    N, A, B = map(int, input().split())
    div, mod = divmod(N, A+B)
    print(A*div + min(mod, A))

resolve()

Buggy python submission (verdict: Runtime Error):
input = map(int, input().split())
N, A, B = input
base = 'b'*A+'r'*B
base*=N
print(base[:N].count('b'))

Fixed submission:
def resolve():
    N, A, B = map(int, input().split())
    div, mod = divmod(N, A+B)
    print(A*div + min(mod, A))

resolve()

Buggy python submission (verdict: Runtime Error):
input = map(int, input().split())
N, A, B = input
string = ''
while len(string) < N:
  string += 'b'*A+'r'*B
print(string[:N].count('b'))

Fixed submission:
def resolve():
    N, A, B = map(int, input().split())
    div, mod = divmod(N, A+B)
    print(A*div + min(mod, A))

resolve()
Buggy python submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
nums = [list(map(int, input().split())) for i in range(M)]
if [1, 0] in nums:
  print('-1')
  quit()
dic = {}

for (s, c) in nums:
  if s in dic and dic[s] != c:
    print('-1')
    quit()
  else:
    dic[s] = c
if N == 1:
  total = 0
else:
  total = 10**(N-1)    
for key in sorted(dic.keys()):
    if key == 1:
   		total = 10**(N-key)*dic[key]
    else:
        total += 10**(N-key)*dic[key]
print(total)

Fixed submission:
N = int(input())
print((N+1)//2)

Buggy python submission (verdict: Runtime Error):
N = 3
S = [list(map(int, input().split())) for _ in range(N)]
n_guess = int(input())
guesses = set([int(input()) for _ in range(n_guess)])
dic = {}
for r in range(N):
  for c in range(N):
    dic[S[r][c]]=(r,c)

for g in guesses:
  if g in dic:
    (r, c) = dic[g]
    S[r][c] = -1

ans = 'No'
for i in range(N):
  if sum(S[i]) == -3:
    ans='Yes'
    
for i in range(N):
  if sum([S[_][i] for _ in range(N)]) == -3:
    ans='Yes'
    
if all([S[i][N-i-1]==-1 for i in range(N)]) or \
   all([S[i][i]==-1 for i in range(N)]):
   	ans = 'Yes'
print(ans)

Fixed submission:
N = int(input())
print((N+1)//2)

Buggy python submission (verdict: Runtime Error):
N = 3
S = [list(map(int, input().split())) for _ in range(N)]
n_guess = int(input())
guesses = set([int(input()) for _ in range(n_guess)])
dic = {}
for r in range(N):
  for c in range(N):
    dic[S[r][c]]=(r,c)

for g in guesses:
  if g in dic:
    (r, c) = dic[g]
    S[r][c] = -1
# print(S)
for i in range(N):
  if sum(S[i]) == -3:
    print('Yes')

    
for i in range(N):
  if sum([S[_][i] for _ in range(N)]) == -3:
    print('Yes')

    
if all([S[i][N-i-1]==-1 for i in range(N)]) or \
   all([S[i][i]==-1 for i in range(N)]):
   	print('Yes')
else:
	print('No')

Fixed submission:
N = int(input())
print((N+1)//2)

Buggy python submission (verdict: Runtime Error):
N = 3
S = [list(map(int, input().split())) for _ in range(N)]
n_guess = int(input())
guesses = set([int(input()) for _ in range(n_guess)])
dic = {}
for r in range(N):
  for c in range(N):
    dic[S[r][c]]=(r,c)

for g in guesses:
  if g in dic:
    (r, c) = dic[g]
    S[r][c] = -1
# print(S)
for i in range(N):
  if sum(S[i]) == -3:
    print('Yes')
    quit()
    
for i in range(N):
  if sum([S[_][i] for _ in range(N)]) == -3:
    print('Yes')
    quit()
    
if all([S[i][N-i-1]==-1 for i in range(N)]) or \
   all([S[i][i]==-1 for i in range(N)]):
   	print('Yes')
else:
	print('No')

Fixed submission:
N = int(input())
print((N+1)//2)

Buggy python submission (verdict: Runtime Error):
return int(int(input())/2)

Fixed submission:
N = int(input())
print((N+1)//2)

Buggy python submission (verdict: Runtime Error):
n = input()
return int(n/2)

Fixed submission:
N = int(input())
print((N+1)//2)
Buggy python submission (verdict: Runtime Error):
N, R = map(int, input())
if N >= 10:
  print(R)
else:
  print(R + 100 * (10 - N))

Fixed submission:
N, R = map(int, input().split())
if N >= 10:
  print(R)
else:
  print(R + 100 * (10 - N))

Buggy python submission (verdict: Runtime Error):
N, R = map(int, input())
if N >= 10:
  print(R)
else:
  print(R - 100 * (10 - N))N, R = map(int, input().split())
if N >= 10:
  print(R)
else:
  print(R + 100 * (10 - N))

Fixed submission:
N, R = map(int, input().split())
if N >= 10:
  print(R)
else:
  print(R + 100 * (10 - N))

Buggy python submission (verdict: Runtime Error):
N, R = map(int, input())
if N >= 10:
  print(R)
else:
  print(R - 100 * (10 - N))

Fixed submission:
N, R = map(int, input().split())
if N >= 10:
  print(R)
else:
  print(R + 100 * (10 - N))
Buggy python submission (verdict: Runtime Error):
def resolve():
    N = int(input())
    arr = list(map(int, input.split()))
    for num in arr:
        if not num % 2 and not (num % 3 == 0 or num % 5 == 0):
            print('DENIED')
            quit()
    print('APPROVED')

resolve()

Fixed submission:
def resolve():
    N = int(input())
    arr = list(map(int, input().split()))
    f = True
    for num in arr:
        if not num % 2 and not (num % 3 == 0 or num % 5 == 0):
            print('DENIED')
            f = False
            break
    if f:
        print('APPROVED')


resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
    N = int(input())
    arr = list(map(int, input().split()))
    for num in arr:
        if not num % 2 and not (num % 3 == 0 or num % 5 == 0):
            print('DENIED')
            quit()
    print('APPROVED')

resolve()

Fixed submission:
def resolve():
    N = int(input())
    from collections import defaultdict
    cnt = defaultdict(int)
    for _ in range(N):
        cnt[input()] += 1
    items = sorted(cnt.items(), key=lambda x: (-x[1], x[0]))
    max_v = items[0][1]
    for item in items:
        if max_v != item[1]:
            break
        print(item[0])

resolve()