Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
As = [int(input()) for _ in range(N)]

def chop(As):
    res = []
    minibatch=[As[0]]
    for i in range(len(As)-1):
        if As[i]<As[i+1]:
            minibatch.append(As[i+1])
        else:
            res.append(minibatch)
            minibatch=[As[i+1]]
    if minibatch:
        res.append(minibatch)
    return res

def kakutei(remains):
    deletes = []
    for i in range (1,len(remains)):
        if remains[0][-1]<remains[i][0]:
            remains[0].extend(remains[i])
            deletes.append(i)
    x = remains[0].copy()
    for d in deletes[::-1]:
        del remains[d]
    del remains[0]
    return (x,remains)

chopped = chop(As)
remains = chopped
res = []
while remains:
    x, remains = kakutei(remains)
    res.append(x)
print(len(res))

Fixed submission:
R =int(input())
print(3*R**2)
Buggy python submission (verdict: Runtime Error):
M,N = [int(x) for x in input()]
print(M+N if M==N else 2*max(M,N)-1)

Fixed submission:
M,N = [int(x) for x in input().split()]
print(M+N if M==N else 2*max(M,N)-1)
Buggy python submission (verdict: Runtime Error):
    a,b = [int(x) for x in input().split()]     
    if a <= b:
        print(a)
    if a > b:
        print(a-1)
     

Fixed submission:
a,b = [int(x) for x in input().split()]     
if a <= b:
    print(a)
else:
    print(a-1)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = [int(x) for x in input()]
s = a+b
t = c+d
if s==t:
    print("Balanced")
elif s>t:
    print("Left")
else:
    print("Right")


Fixed submission:
a,b,c,d = [int(x) for x in input().split()]
s = a+b
t = c+d
if s==t:
    print("Balanced")
elif s>t:
    print("Left")
else:
    print("Right")
Buggy python submission (verdict: Runtime Error):
A,B=int(input().split())
print((A+B)%24)

Fixed submission:
A,B=map(int,input().split())
print((A+B)%24)

Buggy python submission (verdict: Runtime Error):
A,B=int(input())
print((A+B)%24)

Fixed submission:
A,B=map(int,input().split())
print((A+B)%24)
Buggy python submission (verdict: Runtime Error):
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)

N, K = map(int, input().split())
if K!=10:
  N = Base_10_to_n(N, K)
print( len(N) )

Fixed submission:
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
 
N, K = map(int, input().split())
if K!=10:
  N = Base_10_to_n(N, K)
print( len(str(N)) )
Buggy python submission (verdict: Runtime Error):
N = input()
S = input()
count = 0
for i in range(1,int(N)-1):
  if S[i-1] + S[i] + S[i+1] = "ABC":
    count = count + 1
print(count)

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
N = input()
S = input()
print(S.count("ABC"))

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
n = input()
s = input()
flag = 0
for i in range(1,int(n)-1):
  if s[i-1] + s[i] + s[i+1] = "ABC":
    flag += 1
print(flag)

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
n = input()
s = input()
count = 0
for i in range(1,int(n)-1):
  if s[i-1] + s[i] + s[i+1] = "ABC":
    count = count + 1
print(count)

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
    n = input()
    s = input()
    flag = 0
    for i in range(1,int(n)-1):
    	if s[i-1]+s[i]+[i+1] = "ABC":
        	flag += 1
    print(flag)      

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
n = input()
s = input()
flag = 0
for i in range(1,int(n)-1):
	if s[i-1]+s[i]+[i+1] = "ABC"
    	flag += 1
print(flag)      

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
n = input()
s = input()
flag = 0
for i in range(1,n-1):
	if s[i-1]+s[i]+[i+1] = "ABC"
    	flag=flag+1
print(flag)      

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
n = input()
s = input()
flag = 0
for i in range(1,n-1):
	if s[i-1]+s[i]+[i+1] = "ABC":
    	flag++
print(flag)      

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy python submission (verdict: Runtime Error):
n = input()
s = input()
flag = 0
for i in range(1,int(n)-1):
	if s[i-1]+s[i]+[i+1] = "ABC"
    	flag++
print(flag)      

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
h = list(map(int,input().split()))
sort_h = sorted(h, reverse=True)
if len(h) <= k:
  ans = 0
else:
  for i in range(0, k):
    del sort_h[0]
  ans = sum(sort_h)
print(ans)

Fixed submission:
n,k = map(int, input().split())
h = list(map(int,input().split()))
sort_h = sorted(h)
if len(h) <= k:
  ans = 0
else:
  for i in range(0, k):
    sort_h.pop()
  ans = sum(sort_h)
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,k = (int(x) for x in input().split())

if k >= a :
  if k >= b :
    if a + b >= k :
      a1 = 0
      b1 = b - k + a
    else :
      a1 = 0
      b1 = 0
  else :
    a1 = 0
    b1 = b - k + a
else :
  a1 = a - k
  b1 = b

print(a1,b1)

Fixed submission:
str1,str2 = input().split()
str3 = str2 + str1 
print(str3)
Buggy python submission (verdict: Runtime Error):
a,b,k = (int(x) for x in input().split())

if k >= a :
  if k >= b :
    if a + b >= k :
      a1 = 0
      b1 = b - k + a
    else :
      a1 = 0
      b1 = 0
  else :
    a1 = 0
    b1 = b - k + a
else :
  a1 = a - k

print(a1,b1)

Fixed submission:
a,b,k = (int(x) for x in input().split())

if k >= a :
  if k >= b :
    if a + b >= k :
      a1 = 0
      b1 = b - k + a
    else :
      a1 = 0
      b1 = 0
  else :
    a1 = 0
    b1 = b - k + a
else :
  a1 = a - k
  b1 = b

print(a1,b1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
str1 = input()
str2 = input()
str3 = ""

for i in range(0,n):
  str = (str1 + str2)[i::n]
  str3 += str

print(str3)

Fixed submission:
n = int(input())
str1,str2 = input().split()
str3 = ""

for i in range(0,n):
  str = (str1 + str2)[i::n]
  str3 += str

print(str3)
Buggy python submission (verdict: Runtime Error):
def is_upper(c):
  return ord('A') <= ord(c) and ord(c) <= ord('Z')
def shift(c, k):
  if is_upper(c):
    return chr((ord(c) - ord('A') + k) % 26 + ord('A'))
  else:
    return c
def caesar(s, k):
  return "".join([shift(c, k) for c in s])
N = int(input())
S = input()
enc = caesar(S, N)
print(enc)

Fixed submission:
s = input()
ans = 0
if s == 'SUN':
  ans = 7
elif s == "MON":
  ans = 6
elif s == "TUE":
  ans = 5
elif s == "WED":
  ans = 4
elif s == "THU":
  ans = 3
elif s == "FRI":
  ans = 2
elif s == "SAT":
  ans = 1
print(ans)
Buggy python submission (verdict: Runtime Error):
I=input().split()
c5=0
c7=0

for i in I:
  if i=="5":
    c5+=1
  elif i=="7":
    c7+=1
if c5==2 and c7=1:
  print("YES")
else:
  print("NO")

Fixed submission:
I=input().split()
c5=0
c7=0

for i in I:
  if i=="5":
    c5+=1
  elif i=="7":
    c7+=1
if c5==2 and c7==1:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
lines = [input().split() for i in range(3)]
 
num = int(input())
bs = []
for i in range(num):
  bs.append(input())
 
hits = []
for i in bs:
  for row_index in range(len(lines)):
    for col_index in range(len(line)):
      if lines[row_index][col_index] == i:
        hits.append((row_index,col_index))
row_hits = (0,0,0)
col_hits = (0,0,0)
stride_hits = (0,0)
 
for hit in hits:
  r = hit[0]
  c = hit[1]
  row_hits[r]+=1
  col_hits[c]+=1
  if r == c:
    stride_hits[0]+=1
  else if (r,c) == (0,2) or (r,c) == (1,1) or (r,c) == (2,0) :
    stride_hits[1]+=1
 
if max(row_hits)>= 3 or max(col_hits)>=3 or max(stride_hits)>= 3:
  print 'Yes'
else:
  print 'No'
  

Fixed submission:
lines = [input().split() for i in range(3)]
 
num = int(input())
bs = []
for i in range(num):
  bs.append(input())
 
hits = []
for i in bs:
  for row_index in range(len(lines)):
    for col_index in range(len(lines[row_index])):
      if lines[row_index][col_index] == i:
        hits.append((row_index,col_index))
row_hits = [0,0,0]
col_hits = [0,0,0]
stride_hits = [0,0]
 
for hit in hits:
  r = hit[0]
  c = hit[1]
  row_hits[r]+=1
  col_hits[c]+=1
  if r == c:
    stride_hits[0]+=1
  if (r,c) == (0,2) or (r,c) == (1,1) or (r,c) == (2,0) :
    stride_hits[1]+=1
 
if max(row_hits)>= 3 or max(col_hits)>=3 or max(stride_hits)>= 3:
  print ('Yes')
else:
  print ('No')

Buggy python submission (verdict: Runtime Error):
lines = [input().split() for i in range(3)]

num = int(input())
bs = []
for i in range(num):
  bs.append(input())

hits = []
for i in bs:
  for row_index in range(len(lines)):
    for col_index in range(len(line)):
      if lines[row_index][col_index] == i:
        hits.append((row_index,col_index))
row_hits = (0,0,0)
col_hits = (0,0,0)
stride_hits = (0,0)

for hit in hits:
  r = hit[0]
  c = hit[1]
  row_hits[r]++
  col_hits[c]++
  if r == c:
    stride_hits[0]++
  else if (r,c) == (0,2) or (r,c) == (1,1) or (r,c) == (2,0) :
    stride_hits[1]++

if max(row_hits)>= 3 or max(col_hits)>=3 or max(stride_hits)>= 3:
  print 'Yes'
else:
  print 'No'
  

Fixed submission:
lines = [input().split() for i in range(3)]
 
num = int(input())
bs = []
for i in range(num):
  bs.append(input())
 
hits = []
for i in bs:
  for row_index in range(len(lines)):
    for col_index in range(len(lines[row_index])):
      if lines[row_index][col_index] == i:
        hits.append((row_index,col_index))
row_hits = [0,0,0]
col_hits = [0,0,0]
stride_hits = [0,0]
 
for hit in hits:
  r = hit[0]
  c = hit[1]
  row_hits[r]+=1
  col_hits[c]+=1
  if r == c:
    stride_hits[0]+=1
  if (r,c) == (0,2) or (r,c) == (1,1) or (r,c) == (2,0) :
    stride_hits[1]+=1
 
if max(row_hits)>= 3 or max(col_hits)>=3 or max(stride_hits)>= 3:
  print ('Yes')
else:
  print ('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [c  for c in input()]

count = 0

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

print(count)

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

print(S.count("ABC"))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
outlet = 1
ans = 0
while outlet < B:
  outlet -= 1
  outlet += a
  ans += 1
  
print(ans)

Fixed submission:
a,b = map(int,input().split())
outlet = 1
ans = 0
while outlet < b:
  outlet -= 1
  outlet += a
  ans += 1
  
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
ans = round((a-1)/(b-1))  
print(ans)


Fixed submission:
a,b = map(int,input().split())
outlet = 1
ans = 0
while outlet < b:
  outlet -= 1
  outlet += a
  ans += 1
  
print(ans)
Buggy python submission (verdict: Runtime Error):
a = input()
s = input()

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

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

if a >= 3200:
  print(s)
else:
  print("red")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lst = []
for i in range(0,n):
  lst.append(int(input()))
  
ans = []
for i in range(0,len(lst)):
  sort_lst = lst[:]
  sort_lst.pop(i)
  sort_lst.sort(reverse=True)
  ans.append(sort_lst[0])
 
for d in ans:
  print(d)

Fixed submission:
n=int(input())
a=[int(input())for _ in range(n)]
b=sorted(a) # sortする降順に

for a in a:print(b[(a<b[-1])-2])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lst = []
for i in range(0,n):
  lst.append(int(input()))
  
for i in range(0,len(lst)):
  sort_lst = lst[:]
  sort_lst.pop(i)
  sort_lst.sort(reverse=True)
  print(sort_lst[0])
  

Fixed submission:
n=int(input())
a=[int(input())for _ in range(n)]
b=sorted(a) # sortする降順に

for a in a:print(b[(a<b[-1])-2])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lst = []
for i in range(0,n):
  lst.append(int(input()))
  

for i in range(0,len(lst)):
  sort_lst = []
  for j in range(0,len(lst)):
    if not i == j:
      sort_lst.append(lst[j])
  sort_lst = sorted(sort_lst, reverse=True)
  print(sort_lst[0])

Fixed submission:
n=int(input())
a=[int(input())for _ in range(n)]
b=sorted(a) # sortする降順に

for a in a:print(b[(a<b[-1])-2])

Buggy python submission (verdict: Runtime Error):
n = int(input())
list = []
for i in range(0,n):
  list.append(int(input()))
  
new_list = sorted(list, reverse=True)
print lst in new_list:
  print(lst)

Fixed submission:
n=int(input())
a=[int(input())for _ in range(n)]
b=sorted(a) # sortする降順に

for a in a:print(b[(a<b[-1])-2])
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())

print((int)a*b/2)

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

print((int)(a*b/2))
Buggy python submission (verdict: Runtime Error):
input = (int)input()

if input == 22:
  print("Christmas Eve Eve Eve")
else if input == 23:
  print("Christmas Eve Eve")
else if input == 24:
  print("Christmas Eve")
else if input == 25:
  print("Christmas")
else:
  print(null)

Fixed submission:
input = (int)(input())
 
if input == 22:
  print("Christmas Eve Eve Eve")
elif input == 23:
  print("Christmas Eve Eve")
elif input == 24:
  print("Christmas Eve")
elif input == 25:
  print("Christmas")
else:
  print(null)
Buggy python submission (verdict: Time Limit Exceeded):
from math import *
from collections import deque, defaultdict, Counter
from itertools import product, permutations, combinations, accumulate
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappush, heappop
from copy import copy, deepcopy

N = int(input())
xs = []
for i in range(N):
    x = input()
    xs.append(x)

us = "abcdefghijklmnopqrstuvwxyz"

cs = []
ess = []
for x in xs:
    c = Counter(x)
    es = [0,] * 26
    for i,u in enumerate(us):
        e = c[u]
        es[i] = e
    cs.append(c)
    ess.append(tuple(es))


g = Counter(ess)

re = 0
for k,v in g.items():
    re += v*(v-1)//2
print(re)

Fixed submission:
from math import *
from collections import deque, defaultdict, Counter
from itertools import product, permutations, combinations, accumulate
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappush, heappop
from copy import copy, deepcopy

N = int(input())
xs = []
for i in range(N):
    x = input()
    xs.append(x)

us = "abcdefghijklmnopqrstuvwxyz"

cs = []
ess = []
for x in xs:
    c = Counter(x)
    es = [0,] * 26
    for i,u in enumerate(us):
        e = c[u]
        es[i] = e
    cs.append(c)
    ess.append(tuple(es))


g = Counter(ess)

re = 0
for k,v in g.items():
    re += v*(v-1)//2
print(re)
Buggy python submission (verdict: Runtime Error):
r,d,x=map(int,input().split())
for i in range(10):
  x=r*x-D
  print(x)

Fixed submission:
r,d,x=map(int,input().split())
for i in range(10):
  x=r*x-d
  print(x)
Buggy python submission (verdict: Runtime Error):
el,dl = map(int,input().split())
es=list(input.split()).sorted()
ds=[]
for _ in range(dl)
  d = map(int,input().split())
  ds.append(d)
ds.sort(key=lambda d: -d[1])
fs=[]
for b,c in ds:
  for _ in b:
    fs.append(c)
re=0
for ei in range(el):
  re += max(es[ei],fs[ei])
print(re)

Fixed submission:
el,dl = map(int,input().split())
es=list(map(int,input().split()))
es.sort()
#print(es)
ds=[]
for _ in range(dl):
  d = list(map(int,input().split()))
  ds.append(d)
ds.sort(key=lambda d: -d[1])
#print(ds)
fs=[]
for b,c in ds:
  for _ in range(b):
    fs.append(c)
  if len(fs)>el:
    break
re=0
for ei in range(el):
  if ei>=len(fs):
    re += es[ei]
  else:
    re += max(es[ei],fs[ei])
print(re)
Buggy python submission (verdict: Time Limit Exceeded):
from math import *



class V:
    def __init__(self,si,parent):
        self.si = si
        self.parent = parent
    def isInnovator(self):
        return self.parent is None
    def findInnovator(self):
        re = self
        while True:
            if re.parent is None:
                return re
            re = re.parent


N,K = tuple(map(int,input().split()))
vs = [V(vi,None) for vi in range(N)]

for _ in range(K):
    ui,vi,w = tuple(map(int,input().split()))
    ui-=1
    vi-=1
    u = vs[ui]
    v = vs[vi]
    uInnov = u.findInnovator()
    vInnov = v.findInnovator()
    if uInnov == vInnov:
        continue
    vInnov.parent = uInnov

re = 0
for v in vs:
    if v.isInnovator():
        re += 1

print(re)


Fixed submission:
from math import *



class V:
    def __init__(self,si):
        self.si = si
        self.parent = self
    def isInnovator(self):
        return self.parent == self
    def findInnovator(self):
        re = self
        while True:
            if re.parent == re:
                self.parent = re
                return re
            re = re.parent


N,K = tuple(map(int,input().split()))
vs = [V(vi) for vi in range(N)]

for _ in range(K):
    ui,vi,w = tuple(map(int,input().split()))
    ui-=1
    vi-=1
    u = vs[ui]
    v = vs[vi]
    uInnov = u.findInnovator()
    vInnov = v.findInnovator()
    if uInnov == vInnov:
        continue
    vInnov.parent = uInnov

re = 0
for v in vs:
    if v.isInnovator():
        re += 1

print(re)

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



N,K = tuple(map(int,input().split()))
groupId_V = [v for v in range(N)]
vs_groupId = {v:[v] for v in range(N)}

for _ in range(K):
    u,v,w = tuple(map(int,input().split()))
    u-=1
    v-=1
    uGroupId = groupId_V[u]
    vGroupId = groupId_V[v]
    if uGroupId==vGroupId:
        continue
    uFriends = vs_groupId[uGroupId]
    vFriends = vs_groupId[vGroupId]
    for vFriend in vFriends:
        groupId_V[vFriend] = uGroupId
    vs_groupId[vGroupId] = []
    vs_groupId[uGroupId] = uFriends+vFriends

re = 0
for vs in vs_groupId.values():
    if len(vs) != 0:
        re += 1

print(re)


Fixed submission:
from math import *



class V:
    def __init__(self,si):
        self.si = si
        self.parent = self
    def isInnovator(self):
        return self.parent == self
    def findInnovator(self):
        re = self
        while True:
            if re.parent == re:
                self.parent = re
                return re
            re = re.parent


N,K = tuple(map(int,input().split()))
vs = [V(vi) for vi in range(N)]

for _ in range(K):
    ui,vi,w = tuple(map(int,input().split()))
    ui-=1
    vi-=1
    u = vs[ui]
    v = vs[vi]
    uInnov = u.findInnovator()
    vInnov = v.findInnovator()
    if uInnov == vInnov:
        continue
    vInnov.parent = uInnov

re = 0
for v in vs:
    if v.isInnovator():
        re += 1

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

j = 0

for i in range(1,n+1):
  lii = min(li[0:i])
  if lii == li[i-1]:
    j = j + 1
  if lii == 1:
    break

print(j)

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

i = 0
j = 0
a = 10**6
for i in range(i,n):
  a = min(a,li[i])
  if a == li[i]:
    j = j + 1

print(j)

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

j = 0

for i in range(1,n+1):
  lii = min(li[0:i])
  if lii == li[i-1]:
    j = j + 1
  if lii == 1:
    break

print(j)

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

i = 0
j = 0
a = 10**6
for i in range(i,n):
  a = min(a,li[i])
  if a == li[i]:
    j = j + 1

print(j)

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

j = 0

for i in range(1,n+1):
  lii = sorted(li[0:i])
  if lii[0] == li[i-1]:
    j = j + 1
  if lii[0] == 1:
    break

print(j)

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

i = 0
j = 0
a = 10**6
for i in range(i,n):
  a = min(a,li[i])
  if a == li[i]:
    j = j + 1

print(j)

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

j = 0

for i in range(1,n+1):
  lii = sorted(li[0:i])
  if lii[0] == li[i-1]:
    j = j + 1

print(j)


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

i = 0
j = 0
a = 10**6
for i in range(i,n):
  a = min(a,li[i])
  if a == li[i]:
    j = j + 1

print(j)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
import fractions

a = int(stdin.readline().rstrip())
b = int(stdin.readline().rstrip())

print(a * b // fractions.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):
from sys import stdin
import math

a = int(stdin.readline().rstrip())
b = int(stdin.readline().rstrip())

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):

from sys import stdin

n = int(stdin.readline().rstrip())
L = stdin.readline().rstrip()

j = 1
for i in range(n):
 if int(L[i]) == j:
  j = j + 1

if (j == 1):
 print(-1)
else:
 print (n - j + 1)


Fixed submission:

from sys import stdin

n = int(stdin.readline().rstrip())
L = list(map(int,input().split()))

j = 1
for i in range(n):
 if int(L[i]) == j:
  j = j + 1

if (j == 1):
 print(-1)
else:
 print (n - j + 1)
Buggy python submission (verdict: Runtime Error):
a,b=map(str,input().split())
ab:str=""
ba:str=""
for i in range(int(a)):
    ab+=b
for i in range(int(b)):
    ba+=a
#print(ab)
#print(ba)
if(ab>ba):
    print(int(ba))
elif(ab==ba):
    print(int(ab))
else:
    print(int(ab))

Fixed submission:
a,b=map(str,input().split())
ab=""
ba=""
for i in range(int(a)):
    ab+=b
for i in range(int(b)):
    ba+=a
#print(ab)
#print(ba)
if(ab>ba):
    print(int(ba))
elif(ab==ba):
    print(int(ab))
else:
    print(int(ab))

Buggy python submission (verdict: Runtime Error):
a,b=map(str,input().split())
ab:str=""
ba:str=""
for i in range(int(a)):
    ab+=b
for i in range(int(b)):
    ba+=a
#print(ab)
#print(ba)
if(ab>ba):
    print(ba)
elif(ab==ba):
    print(ab)
else:
    print(ab)

Fixed submission:
a,b=map(str,input().split())
ab=""
ba=""
for i in range(int(a)):
    ab+=b
for i in range(int(b)):
    ba+=a
#print(ab)
#print(ba)
if(ab>ba):
    print(int(ba))
elif(ab==ba):
    print(int(ab))
else:
    print(int(ab))

Buggy python submission (verdict: Runtime Error):
a,b=map(str,input().split())
ab:str=""
ba:str=""
for i in range(int(a)):
    ab+=b
for i in range(int(b)):
    ba+=a
#print(ab)
#print(ba)
if(int(ab)>int(ba)):
    print(int(ba))
elif(int(ab)==int(ba)):
    print(int(ab))
else:
    print(int(ab))

Fixed submission:
a,b=map(str,input().split())
ab=""
ba=""
for i in range(int(a)):
    ab+=b
for i in range(int(b)):
    ba+=a
#print(ab)
#print(ba)
if(ab>ba):
    print(int(ba))
elif(ab==ba):
    print(int(ab))
else:
    print(int(ab))
Buggy python submission (verdict: Runtime Error):
import math
A,B= map(int, input().split())
def lcm(A,B):
    return (A*B)//math.gcd(A,B)
print(lcm(A,B))

Fixed submission:
a,b = map(int, input().split())
 
 #最大公約数
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
#print(gcd(a,b))

 #最小公倍数
def lcm(a,b):
    return a*b//gcd(a,b)
print(lcm(a,b))