Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s = raw_input()
t = raw_input()

if sorted(*s) < sorted(*t, reverse=True):
  print 'Yes'
else:
  print 'No'

Fixed submission:
s = raw_input()
t = raw_input()

if sorted(s) < sorted(t, reverse=True):
  print 'Yes'
else:
  print 'No'
Buggy python submission (verdict: Runtime Error):
print('YES'if input()==input[::-1] else'NO')

Fixed submission:
print(['NO','YES'][input()==input()[::-1]])
Buggy python submission (verdict: Runtime Error):
X, A, B = map(int, raw_input().split())
if A <= B:
  print 'delicious'
else
  print 'dangerous' if X < B-A else 'safe'

Fixed submission:
X, A, B = map(int, raw_input().split())
if B-A > X:
  print 'dangerous'
else:
  print 'safe' if A < B else 'delicious'
Buggy python submission (verdict: Runtime Error):
print('YES' if sorted(input()) == [*'  557'] else 'NO')

Fixed submission:
print('YES' if sorted(input()[::2]) == ['5','5','7'] else 'NO')

Buggy python submission (verdict: Runtime Error):
print('YES' if sorted(input()) == [*'  557'] else 'No')

Fixed submission:
print('YES' if sorted(input()[::2]) == ['5','5','7'] else 'NO')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = 1
flag = 0
for i in range(n):
    ans *= a[i]
    if ans > 10**18:
        flag = 1

if flag == 1 and ans != 0:
    ans = -1

print(ans)


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

ans = 1
flag = 0
for i in range(n):
    ans *= a[i]
    if ans > 10**18:
        flag = 1
        break

if flag == 1 and (0 not in a):
    ans = -1
if 0 in a:
    ans = 0

print(ans)
Buggy python submission (verdict: Runtime Error):
t = list(input())
t.reverse()

tmptmp = "P"
for i in range(len(t)):
    if i == 0:
        tmp = t[i]
        continue
    if tmp == "?" and tmptmp == "P":
        t[i-1] = "D"
    elif tmp == "?" and tmptmp == "D" and t[i] == "P":
        t[i-1] = "D"
    elif tmp == "?" and tmptmp == "D" and t[i] == "D":
        t[i-1] = "P"
    tmptmp = t[i-1]
    tmp = t[i]

t.reverse()

if t[0] == "?" and t[1] == "D":
    t[0] = "P"
elif t[0] == "?" and t[1] == "P":
    t[0] = "D"

t = "".join(t)
print(t)


Fixed submission:
t = list(input())
t.reverse()

tmptmp = "P"
for i in range(len(t)):
    if i == 0:
        tmp = t[i]
        continue
    if tmp == "?" and tmptmp != "D":
        t[i-1] = "D"
    elif tmp == "?" and tmptmp == "D" and t[i] != "D":
        t[i-1] = "D"
    elif tmp == "?" and tmptmp == "D" and t[i] == "D":
        t[i-1] = "P"
    tmptmp = t[i-1]
    tmp = t[i]

t.reverse()

if len(t) > 1:
    if t[0] == "?" and t[1] == "D":
        t[0] = "P"
    elif t[0] == "?" and t[1] == "P":
        t[0] = "D"

if len(t) == 1:
    t[0] = "D"

t = "".join(t)
print(t)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = map(int, input().split())
ans = 0

for i in range(min(N+1, B)):
    p = A * i // B
    q = i // B * A
    ans = max(ans, p - q)

print(ans)

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

x = min(N, B-1)
p = A * x // B
q = x // B * A
ans = p - q

print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()

if S = 'AAA' or S = 'BBB':
    print('No')
else:
    print('Yes')

Fixed submission:
S = input()

if S == 'AAA' or S == 'BBB':
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
N,A,B = map(int, input().split())

moji = ''

while len(moji) < N:
    for i in range(A):
        moji += 'b'
    for j in range(B):
        moji += 'r'

moji = moji[:N]

print(moji.count('b'))

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

nn = N // (A+B)

amari = N % (A+B)

if amari < A:
    print(A*nn + amari)
else:
    print(A*nn + A)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int, input().split())

a = []
for i in range(m):
    a.append(int(input()))

dp = []
for dpi in range(n):
    dp.append(0)

for j in range(n):
    if j == 0 and j+1 not in a:
        dp[j] = 1
    elif j == 1 and j+1 not in a:
        dp[j] = dp[j-1] + 1
    elif j > 1 and j+1 not in a:
        dp[j] = dp[j-1] + dp[j-2]

print(dp[n-1] % 1000000007)

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

a = []
for i in range(m):
    a.append(int(input()))

dp = []
for dpi in range(n):
    dp.append(0)

k = 0
a.append(0)
for j in range(n):
    if j+1 == a[k]:
        k += 1
        continue
    if j == 0:
        dp[j] = 1
    elif j == 1:
        dp[j] = dp[j-1] + 1
    elif j > 1:
        dp[j] = dp[j-1] + dp[j-2]

print(dp[n-1] % 1000000007)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())

if(a >= 0 and d <= 0):
    print(a*d)
elif(b<= 0 and d <= 0):
    print(a*c)
elif((b <= 0 and c >= 0) or (b > 0 and d < 0)):
    print(b*c)
elif((b > 0 and c > 0):
    print(b*d)
elif(a*c > a*d):
    print(a*c)
elif(a*c < a*d):
    print(a*d)







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

if(a>= 0 and c>= 0):
    print(b*d)
elif(b<=0 and d<=0):
    print(a*c)
elif(a>=0 and d<=0):
    print(a*d)
elif(b<=0 and c>=0):
    print(b*c)
elif(a*c >= b*d):
    print(a*c)
elif(a*c < b*d):
    print(b*d)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(input()) 
a = list(map(int,input().split()))
c = 1

for i in range(n):
    c *= a[i]

if (c > (10**18)):
    print("-1")
    sys.exit()
else:
    print(c)





Fixed submission:
import sys
n = int(input()) 
a = list(map(int,input().split()))
c = 1

for i in range(n):
    if(a[i] == 0):
        print("0")
        sys.exit()
else:        
    for i in range(n):
        c *= a[i]
        if (c > (10**18)):
            print("-1")
            sys.exit()

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

if H == 1 or W == 1:
    print(1)

else:
    print(((h*W) + 1) // 2)


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

if H == 1 or W == 1:
    print(1)

else:
    print(((H*W) + 1) // 2)
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
x = list(map(int, input().split()))
 
s = float((x[0] + x[1])/2)
for i in range(2,N-1):
	s = (s + x[i]) / 2
 
min = math.floor(s)
 
print(min)

Fixed submission:
N = int(input())
x = list(map(int, input().split()))
 
t = 0
min = 0

for i in range(0,N):
     t += x[i]/N

s = round(t)
for i in range(0,N):
    min += (x[i] - s) **2

print(min)

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

s = float(x[0])
for i in range(N-1):
	t = (s + x[i+1]) / 2

min = math.floor(t)

print(min)

Fixed submission:
N = int(input())
x = list(map(int, input().split()))
 
t = 0
min = 0

for i in range(0,N):
     t += x[i]/N

s = round(t)
for i in range(0,N):
    min += (x[i] - s) **2

print(min)
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(0 if x else 0)

Fixed submission:
n = input()
if n=="0":
  print(1)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
l,d,r = map(int,input().split())
def div(n): 
  return True if n%r==0 else False
print(len(filter(div,range(l,d+1))))

Fixed submission:
l,d,r = map(int,input().split())
count = 0
for i in range(l,d+1):
  if i%r==0: count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
arr = list(int,input().split())
arr = arr[::2]
def odd(n) : return (n%2==1)
lst = filter(odd,arr)
print(len(lst))

Fixed submission:
n = int(input())
arr = list(map(int,input().split()))
def odd(n) : return (n%2==1)
lst = list(filter(odd,arr[0:n:2]))
print(len(lst))

Buggy python submission (verdict: Runtime Error):
n = int(input())
arr = list(int,input().split())
arr = arr[::2]
count = 0
for i in arr:
  if i%2==1: count+= 1
print(count)

Fixed submission:
n = int(input())
arr = list(map(int,input().split()))
def odd(n) : return (n%2==1)
lst = list(filter(odd,arr[0:n:2]))
print(len(lst))

Buggy python submission (verdict: Runtime Error):
n = int(input())
arr = list(int,input().split())
def mod(i): return i%2==1
lst = list(filter(mod==True,arr))
print(len(lst))

Fixed submission:
n = int(input())
arr = list(map(int,input().split()))
def odd(n) : return (n%2==1)
lst = list(filter(odd,arr[0:n:2]))
print(len(lst))

Buggy python submission (verdict: Runtime Error):
n = int(input())
arr = list(int,input().split())
def mod(i): return i%2==1
lst = list(filter(lambda x: mod(x),arr[::2]))
print(len(lst))

Fixed submission:
n = int(input())
arr = list(map(int,input().split()))
def odd(n) : return (n%2==1)
lst = list(filter(odd,arr[0:n:2]))
print(len(lst))

Buggy python submission (verdict: Runtime Error):
n = int(input())
arr = list(int,input().split())
def mod(i): return i%2==1
lst = list(filter(mod,arr[::2]))
print(len(lst))

Fixed submission:
n = int(input())
arr = list(map(int,input().split()))
def odd(n) : return (n%2==1)
lst = list(filter(odd,arr[0:n:2]))
print(len(lst))

Buggy python submission (verdict: Runtime Error):
n = int(input())
arr = list(int,input().split())
lst = filter(i%2==1,arr[::2])
print(len(lst))

Fixed submission:
n = int(input())
arr = list(map(int,input().split()))
def odd(n) : return (n%2==1)
lst = list(filter(odd,arr[0:n:2]))
print(len(lst))

Buggy python submission (verdict: Runtime Error):
n = int(input())
arr = list(int,input().split())
for i in range(0,n,2):
  if arr[i]%2 == 1 : count+=1
print(count)

Fixed submission:
n = int(input())
arr = list(map(int,input().split()))
def odd(n) : return (n%2==1)
lst = list(filter(odd,arr[0:n:2]))
print(len(lst))
Buggy python submission (verdict: Runtime Error):
#c
n,k = map(int,input().split())
a = list(map(int,input().split()))

for i in range(n-k):
    if a[i]<s[i+1]:
        print("Yes")
    else:
        print("No")

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

for i in range(n-k):
    if a[i]<a[i+k]:
        print("Yes")
    else:
        print("No")

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

num_list = []

for i in range(n-k+1):
    num = 1
    for j in range(i,i+k):
        num *= a[j]
    num_list.append(num)
    
for i in range(len(num_list)-1):
    if num_list[i] < num_list[i+1]:
        print("Yes")
    else:
        print("No")

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

for i in range(n-k):
    if a[i]<a[i+k]:
        print("Yes")
    else:
        print("No")

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

num_list = []

for i in range(n-k+1):
    num = 1
    for j in range(i,i+k):
        num *= a[j]
    num_list.append(num)
    
for i in range(len(num_list)-1):
    if num_list[i] < num_list[i+1]:
        print("Yes")
    else:
        print("No")

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

for i in range(n-k):
    if a[i]<a[i+k]:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
#c
n,k = map(int,input().split())
a = list(map(int,input().split()))
mul1 = 1
cnt = 0
for i in range(n-k+1):
    mul2 = 1
    for j in range(i,i+k):
        mul2 *= a[j]
    if cnt !=0:
        if mul2 >mul1:
            print("Yes")
        else:
            print("No")
    mul1 = mul2
    cnt+=1

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

for i in range(n-k):
    if a[i]<a[i+k]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
A,B = map(float,input().split())
B = B*100
print(int(A*B/100))

Fixed submission:
import sys
N = int(input())
An = []
mul = 1

An = list(map(int,input().split()))
if An.count(0) > 0:
    print("0")
    sys.exit()

for i in An:
    mul *= i
    if mul > 10**18:
        print("-1")
        sys.exit()

if mul <= 10**18:
    print(mul)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
An = []
mul = 1

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

for i in An:
    mul *= i

if mul >10**18:
    print("-1")
else:
    print(mul)

Fixed submission:
import sys
N = int(input())
An = []
mul = 1

An = list(map(int,input().split()))
if An.count(0) > 0:
    print("0")
    sys.exit()

for i in An:
    mul *= i
    if mul > 10**18:
        print("-1")
        sys.exit()

if mul <= 10**18:
    print(mul)
Buggy python submission (verdict: Runtime Error):
import math 
A,B = map(float,input().split())

B = decimal(B)
print(int(A*B))

Fixed submission:
from decimal import Decimal
a,b = map(str,input().split())
a = int(a)
b = Decimal(b)
print(int(a*b))
Buggy python submission (verdict: Runtime Error):
#6
H,W = map(int,input().split())
k = H*W
if k%2 == 0:
    print(int(k/2)
else:
    print(int(k/2)+1)

Fixed submission:
#6
import sys
H,W = map(int,input().split())
k = H*W

if H ==1 or W == 1:
    print(1)
    sys.exit()

if k%2 == 0:
    print(int(k/2))
else:
    print(int(k/2)+1)
Buggy python submission (verdict: Runtime Error):
#7
A = [list(map(int,input().split())) for i in range(3)]

N = int(input())

B = [int(input()) for i in range(N)]

C = [[0,0,0],[0,0,0],[0,0,0]]
Ans = "No"

for i in range(3):
    for j in range(3):
        if A[i][j] in B:         #AijはリストBに含まれるかどうか
            C[i][j] = 1

for i in range(3):
    if C[i][1]+C[i][2]+C[i][3] == 3:
        Ans ="Yes"

for i in range(3):
    if C[1][i]+C[2][i]+C[3][i] == 3:
        Ans ="Yes"
        
if C[1][1]+C[2][2]+C[3][2] == 3 or C[1][3]+C[2][2]+C[3][1] == 3:
    Ans = "Yes"
    
print(Ans)
            
        

Fixed submission:
#7
A = [list(map(int,input().split())) for i in range(3)]

N = int(input())

B = [int(input()) for i in range(N)]

C = [[0,0,0],[0,0,0],[0,0,0]]
Ans = "No"

for i in range(3):
    for j in range(3):
        if A[i][j] in B:         #AijはリストBに含まれるかどうか
            C[i][j] = 1

for i in range(3):
    if C[i][0]+C[i][1]+C[i][2] == 3:
        Ans ="Yes"

for i in range(3):
    if C[0][i]+C[1][i]+C[2][i] == 3:
        Ans ="Yes"
        
if C[0][0]+C[1][1]+C[2][2] == 3 or C[0][2]+C[1][1]+C[2][0] == 3:
    Ans = "Yes"
    
print(Ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
p = list(map(int,input().split()))
cou1 = 0
cou2 = 0
num1 = min(p)
num2 = p.count(num1) 


for i in range(N):
    num3 = min(p[0:i+1])
    if p[i] == num3:
        cou1 += 1
    if p[i] == num1:
        cou2 += 1
    if cou2 == num2:
        break
    
print(cou1)
    

Fixed submission:
#41
import math
N = int(input())
p = list(map(int,input().split()))

cou = 0
x = math.inf

for j in range(N):
    if min(x,p[j]) == p[j]:
        x = p[j]
        cou += 1

print(cou)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
p = list(map(int,input().split()))
cou = 0

for i in range(N):
    num = min(p[0:i+1])
    if p[i] == num:
        cou += 1
    
print(cou)
    

Fixed submission:
#41
import math
N = int(input())
p = list(map(int,input().split()))

cou = 0
x = math.inf

for j in range(N):
    if min(x,p[j]) == p[j]:
        x = p[j]
        cou += 1

print(cou)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
p = list(map(int,input().split()))
cou = 0

for i in range(N):
    num = min(p[0:i+1])
    if p[i] == num:
        cou += 1
    
print(cou)
    

Fixed submission:
#41
import math
N = int(input())
p = list(map(int,input().split()))

cou = 0
x = math.inf

for j in range(N):
    if min(x,p[j]) == p[j]:
        x = p[j]
        cou += 1

print(cou)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
p = list(map(int,input().split()))
cou = 0

for i in range(N):
    c = 0
    for j in range(i):
        if p[i] > p[j]:
            c+=1
            break
    if c == 0:
        cou += 1
    
print(cou)
    

Fixed submission:
#41
import math
N = int(input())
p = list(map(int,input().split()))

cou = 0
x = math.inf

for j in range(N):
    if min(x,p[j]) == p[j]:
        x = p[j]
        cou += 1

print(cou)
Buggy python submission (verdict: Runtime Error):
# 21
import sympy
x = int(input())

#エラトステネスの篩
n = [i for i in range(2,int(sympy.sqrt(x))+1)]

for i in n:
    for j in n:
        if j % i == 0 and j/i !=1:
            n.remove(j)
            
while x > 0:
    x +=1
    for i in n:
        if x % i == 0:
            break
    else:
        print(x)
        break


Fixed submission:
# 21   import sympyが最速だが、Atcoderには無い
import math
x = int(input())

#エラトステネスの篩
n = [i for i in range(2,int(math.sqrt(x))+1)]

for i in n:
    for j in n:
        if j % i == 0 and j/i !=1:
            n.remove(j)
            
while x > 0:
    for i in n:
        if x % i == 0:
            break
    else:
        print(x)
        break
    x+=1

Buggy python submission (verdict: Runtime Error):
## 21
import sympy
x = int(input())

#エラトステネスの篩
n = [i for i in range(2,int(sympy.sqrt(x))+1)]

for i in n:
    for j in n:
        if j % i == 0 and j/i !=1:
            n.remove(j)
            
while x > 0:
    x +=1
    for i in n:
        if x % i == 0:
            break
    else:
        print(x)
        break


Fixed submission:
# 21   import sympyが最速だが、Atcoderには無い
import math
x = int(input())

#エラトステネスの篩
n = [i for i in range(2,int(math.sqrt(x))+1)]

for i in n:
    for j in n:
        if j % i == 0 and j/i !=1:
            n.remove(j)
            
while x > 0:
    for i in n:
        if x % i == 0:
            break
    else:
        print(x)
        break
    x+=1

Buggy python submission (verdict: Runtime Error):
## 21
import sympy
x = int(input())

#エラトステネスの篩
n = [i for i in range(2,int(sympy.sqrt(x))+1)]

for i in n:
    for j in n:
        if j % i == 0 and j/i !=1:
            n.remove(j)
            
while x > 0:
    x +=1
    for i in n:
        if x % i == 0:
            break
    else:
        print(x)
        break


Fixed submission:
# 21   import sympyが最速だが、Atcoderには無い
import math
x = int(input())

#エラトステネスの篩
n = [i for i in range(2,int(math.sqrt(x))+1)]

for i in n:
    for j in n:
        if j % i == 0 and j/i !=1:
            n.remove(j)
            
while x > 0:
    for i in n:
        if x % i == 0:
            break
    else:
        print(x)
        break
    x+=1
Buggy python submission (verdict: Runtime Error):
#4
N = int(input())
x,y,k = 0,0,0

x = int(0.8*N)

for i in range(x,N):
    k = str(i*108)
    if int(k[0:-2]) == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")

    

Fixed submission:
#4
import sys
N = int(input())
x,y,k = 0,0,0

if N == 1:
    print(1)
    sys.exit()
elif N <= 12:
    print(N)
    sys.exit()
x = int(0.8*N)

for i in range(x,N):
    k = str(i*108)
    if int(k[0:-2]) == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")

Buggy python submission (verdict: Runtime Error):
#4
N = int(input())
x,y,k = 0,0,0

x = int(0.8*N)

for i in range(x,N):
    k = str(int(i*108))
    if int(k[0:-2]) == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")


Fixed submission:
#4
import sys
N = int(input())
x,y,k = 0,0,0

if N == 1:
    print(1)
    sys.exit()
elif N <= 12:
    print(N)
    sys.exit()
x = int(0.8*N)

for i in range(x,N):
    k = str(i*108)
    if int(k[0:-2]) == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")

Buggy python submission (verdict: Runtime Error):
#4
N = int(input())
x,y,k = 0,0,0

x = int(0.8*N)

for i in range(x,N):
    k = str(int(i*108))
    if int(k[0:-2]) == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")


Fixed submission:
#4
import sys
N = int(input())
x,y,k = 0,0,0

if N == 1:
    print(1)
    sys.exit()
elif N <= 12:
    print(N)
    sys.exit()
x = int(0.8*N)

for i in range(x,N):
    k = str(i*108)
    if int(k[0:-2]) == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")

Buggy python submission (verdict: Runtime Error):
#4
N = int(input())
x,y,k = 0,0,0

x = int(0.8*N)

for i in range(x,N):
    k = int(i*108)
    if k[0:-2] == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")


Fixed submission:
#4
import sys
N = int(input())
x,y,k = 0,0,0

if N == 1:
    print(1)
    sys.exit()
elif N <= 12:
    print(N)
    sys.exit()
x = int(0.8*N)

for i in range(x,N):
    k = str(i*108)
    if int(k[0:-2]) == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")

Buggy python submission (verdict: Runtime Error):
#4
N = int(input())
x,y,k = 0,0

x = int(0.8*N)

for i in range(x,N):
    k = int(i*108)
    if k[0:-2] == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")


Fixed submission:
#4
import sys
N = int(input())
x,y,k = 0,0,0

if N == 1:
    print(1)
    sys.exit()
elif N <= 12:
    print(N)
    sys.exit()
x = int(0.8*N)

for i in range(x,N):
    k = str(i*108)
    if int(k[0:-2]) == N:
        print(i)
        y +=1
        break

if y !=1:
    print(":(")
Buggy python submission (verdict: Time Limit Exceeded):
#14
N =int(input())
a = list(map(int,input().split()))
b = ""

for i in range(N):
    b += str(a.index(i+1)+1) + " "
    
    
print(b)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
L = [[] for i in range(N)]
for i in range(N):
    L[i] = [A[i], i+1]
L.sort()
ans = [0 for i in range(N)]
for i in range(N):
    ans[i] = L[i][1]
print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
#14
N =int(input())
a = list(map(int,input().split()))
b = ""

for i in range(N):
    b += str(a.index(i+1)+1) + " "
    
    
print(b)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
L = [[] for i in range(N)]
for i in range(N):
    L[i] = [A[i], i+1]
L.sort()
ans = [0 for i in range(N)]
for i in range(N):
    ans[i] = L[i][1]
print(*ans)
Buggy python submission (verdict: Time Limit Exceeded):
#5
n = int(input())

num = [i for i in range(n)]
print(sum(num))

Fixed submission:
#5  [1,2,3,4,5]→[5,1,2,3,4]が最適解　等差数列の和の公式
n = int(input())

print(n*(n-1)//2)
Buggy python submission (verdict: Runtime Error):
#36
N,M = map(int,input().split())
li = []
ri = []
x = []
y = []
L,R = map(int,input().split())
for i in range(L,R+1):
    x.append(i)
for i in range(M-1):
    L,R = map(int,input().split())
    if L < x[0]:
        L = x[0]
    if R > x[-1]:
        R = x[-1]
    for j in range(L,R+1):
        y.append(j)
    x = y
    y = []
          
cou = len(x)
print(cou)
        
    
    

Fixed submission:
#36
N,M = map(int,input().split())
li = []
ri = []
num = 0


for i in range(M):
    L,R = map(int,input().split())
    li.append(L)
    ri.append(R)
L = max(li)
R = min(ri)
num = R-L+1
if num <0:
    num= 0
    
print(num)

Buggy python submission (verdict: Time Limit Exceeded):
#36
N,M = map(int,input().split())
li = []
ri = []
x = []
y = [i for i in range(1,N+1)]
cou = 0
for i in range(M):
    L,R = map(int,input().split())
    for i in y:
        if L<=i and R>=i:
            x.append(i)
    y = x
    x = []
          
cou = len(y)
print(cou)
        
    

Fixed submission:
#36
N,M = map(int,input().split())
li = []
ri = []
num = 0


for i in range(M):
    L,R = map(int,input().split())
    li.append(L)
    ri.append(R)
L = max(li)
R = min(ri)
num = R-L+1
if num <0:
    num= 0
    
print(num)

Buggy python submission (verdict: Time Limit Exceeded):
#36
N,M = map(int,input().split())
li = []
ri = []
x = []
y = [i for i in range(1,N+1)]
cou = 0
for i in range(M):
    L,R = map(int,input().split())
    for i in y:
        if L<=i and R>=i:
            x.append(i)
    y = x
    x = []
          
cou = len(y)
print(cou)
        
    

Fixed submission:
#36
N,M = map(int,input().split())
li = []
ri = []
num = 0


for i in range(M):
    L,R = map(int,input().split())
    li.append(L)
    ri.append(R)
L = max(li)
R = min(ri)
num = R-L+1
if num <0:
    num= 0
    
print(num)