Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def is_even(num):
    return num % 2 == 0
def goback(M, x):
    k = M // 2
    if M == 0:
        return L - x[0]
    elif M == 1:
        return 2 * (L - x[1]) + x[0]
    elif is_even(M):
        return 2 * sum(x[0:k]) - 2 * sum(x[M - k + 1:M + 1]) - x[M - k] + L * (2 * k + 1)
    else:
        return 2 * sum(x[0:k]) + x[k] - 2 * sum(x[M - k:M + 1]) + L * 2 * (k + 1)

L, N = (int(i) for i in input().split())
points = []
ans = []
for i in range(0, N):
    points.append(int(input()))

for i in range(0, N):
    ans.append((goback(i, points)))

revpoints = [L - p for p in points[::-1]]
for i in range(0, N):
    ans.append((goback(i, revpoints)))

print(max(ans))

Fixed submission:
def is_even(num):
    return num % 2 == 0
def goback(M, x, Sx):
    k = M // 2
    if M == 0:
        return L - x[0]
    elif M == 1:
        return 2 * (L - x[1]) + x[0]
    elif is_even(M):
        return 2 * Sx[k - 1] - 2 * (Sx[M] - Sx[M - k]) - x[M - k] + L * (2 * k + 1)
    else:
        return 2 * Sx[k - 1] + x[k] - 2 * (Sx[M] - Sx[M - k - 1]) + L * 2 * (k + 1)

L, N = (int(i) for i in input().split())
ans = 0

pl = []
for i in range(N):
    pl.append(int(input()))
sumpl = [pl[0]]
for i in range(1, N):
    sumpl.append(sumpl[i - 1] + pl[i])
for i in range(0, N):
    ans = max(ans, goback(i, pl, sumpl))

revpl = [L - p for p in pl[::-1]]
sumrevpl = [revpl[0]]
for i in range(1, N):
    sumrevpl.append(sumrevpl[i - 1] + revpl[i])
for i in range(0, N):
    ans = max(ans, goback(i, revpl, sumrevpl))

print(ans)
Buggy python submission (verdict: Runtime Error):
#B - Substring 
S = str(input())
T = str(input())
i = 0
j = 0

Slen = len(S)
Tlen = len(T)
change_min = Tlen

for i in range(Slen - Tlen):
    diff = 0
    for j in range(Tlen):
        if S[i] != T[i + j]:
            diff += 1
    change_min = min(change_min,diff)

# 出力
print(change_min)

Fixed submission:
#B - Substring 
S = str(input())
T = str(input())
i = 0
j = 0

Slen = len(S)
Tlen = len(T)
change_min = Tlen

for i in range(Slen - Tlen + 1):
    diff = 0
    for j in range(Tlen):
        if T[j] != S[i + j]:
            diff += 1
    change_min = min(change_min,diff)

# 出力
print(change_min)

Buggy python submission (verdict: Runtime Error):
#B - Substring 
S = str(input())
T = str(input())
i = 0
j = 0

k = len(S)
l = len(T)
change_min = l

for i in range(l):
    for m in range(l - i) :
        change = l
        for j in range(k - (l -i)+1):
            print(S[j+m:j +l-i],T[m:l-i],change,l-i-m)
            if S[j+m:j +l-i] == T[m:l-i]:
                print('Match !!')
                change -= l-i-m
        if change_min > change:
            change_min = change
# 出力
print(change_min)


Fixed submission:
#B - Substring 
S = str(input())
T = str(input())
i = 0
j = 0

Slen = len(S)
Tlen = len(T)
change_min = Tlen

for i in range(Slen - Tlen + 1):
    diff = 0
    for j in range(Tlen):
        if T[j] != S[i + j]:
            diff += 1
    change_min = min(change_min,diff)

# 出力
print(change_min)
Buggy python submission (verdict: Time Limit Exceeded):
#C - Sum of product of pairs
N = int(input())
A = list(map(int,input().split()))
SUM = 0
MOD = 1000000007
for i in range(N-1):
    for j in range(i+1,N):
            SUM = (SUM + (A[i] * A[j] % MOD) ) % MOD

# 出力
print(SUM)


Fixed submission:
#C - Sum of product of pairs
N = int(input())
A = list(map(int,input().split()))
SUM = 0
jsum= 0
MOD = 1000000007
for j in range(N):
    jsum = (jsum + A[j]) % MOD

for i in range(N-1):
    jsum = (jsum - A[i]) % MOD
    SUM = ( SUM + (jsum * A[i] % MOD ) ) % MOD

# 出力
print(SUM)

Buggy python submission (verdict: Time Limit Exceeded):
#C - Sum of product of pairs
N = int(input())
A = list(map(int,input().split()))
SUM = 0
MOD = 1000000007
for i in range(N-1):
    for j in range(i+1,N):
            SUM = (SUM + (A[i] * A[j] % MOD) ) % MOD

# 出力
print(SUM)



Fixed submission:
#C - Sum of product of pairs
N = int(input())
A = list(map(int,input().split()))
SUM = 0
jsum= 0
MOD = 1000000007
for j in range(N):
    jsum = (jsum + A[j]) % MOD

for i in range(N-1):
    jsum = (jsum - A[i]) % MOD
    SUM = ( SUM + (jsum * A[i] % MOD ) ) % MOD

# 出力
print(SUM)

Buggy python submission (verdict: Time Limit Exceeded):
#C - Sum of product of pairs
N = int(input())
A = list(map(int,input().split()))
SUM = 0
MOD = 1000000007
for i in range(N-1):
    for j in range(1,N):
        if i < j:
            SUM = (SUM + (A[i] * A[j] % MOD) ) % MOD

# 出力
print(SUM)


Fixed submission:
#C - Sum of product of pairs
N = int(input())
A = list(map(int,input().split()))
SUM = 0
jsum= 0
MOD = 1000000007
for j in range(N):
    jsum = (jsum + A[j]) % MOD

for i in range(N-1):
    jsum = (jsum - A[i]) % MOD
    SUM = ( SUM + (jsum * A[i] % MOD ) ) % MOD

# 出力
print(SUM)
Buggy python submission (verdict: Runtime Error):
#E_Coprime
import math
import functools

# エラトステネスの篩
        
def primes(n):
    is_prime = [1] * (n + 1)
    is_prime[0] = 0
    is_prime[1] = 0
    D_prime = [i for i in range(n+1)] 
    D_prime[0] = 0
    D_prime[1] = 1
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            D_prime[i] = i
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = 0
            D_prime[j] = i
    return D_prime

    

Fnum_list2 = []
# 入力
N = int(input())
A = list(map(int,input().split()))

#Fnum_list = eratosthenes(N)

A.sort()
Amax = A[-1]
Fnum_list2 = primes(Amax)

ans = 1
#Fnum_list = eratosthenes(N)
Ai_primes     = set()
Ai_primes_add = []
gcd_num = 0
for i in range(len(A) -1 ):
    p = A[i]
    while p != 1:
        j = p
        p = int (p / Fnum_list2[j])
        if Fnum_list2[j] in Ai_primes:
            ans = 0
        else:
            Ai_primes_add.append(Fnum_list2[j])
    if Fnum_list2[j] in Ai_primes:
        break
    else:
        Ai_primes |= set(Ai_primes_add)
        Ai_primes_add.clear()

gcd_num = functools.reduce(math.gcd,A)

if ans == 0:
    if gcd_num == 1:
        ans = 2

# 出力
if ans == 1:
    print("pairwise coprime")
else:
    if ans == 2:
        print("setwise coprime")
    else:
        print("not coprime")


Fixed submission:
#E_Coprime
import math
import functools

# エラトステネスの篩
        
def primes(n):
    is_prime = [1] * (n + 1)
    is_prime[0] = 0
    is_prime[1] = 0
    D_prime = [i for i in range(n+1)] 
    D_prime[0] = 0
    D_prime[1] = 1
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            D_prime[i] = i
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = 0
            D_prime[j] = i
    return D_prime

    

Fnum_list2 = []
# 入力
N = int(input())
A = list(map(int,input().split()))

#Fnum_list = eratosthenes(N)

A.sort()
Amax = A[-1]
Fnum_list2 = primes(Amax)
j = A[0]
ans = 1
#Fnum_list = eratosthenes(N)
Ai_primes     = set()
Ai_primes_add = []
gcd_num = 0
for i in range(len(A) ):
    p = A[i]
    while p != 1:
        j = p
        p = int (p / Fnum_list2[j])
        if Fnum_list2[j] in Ai_primes:
            ans = 0
        else:
            Ai_primes_add.append(Fnum_list2[j])
    if Fnum_list2[j] in Ai_primes:
        break
    else:
        Ai_primes |= set(Ai_primes_add)
        Ai_primes_add.clear()

gcd_num = functools.reduce(math.gcd,A)

if ans == 0:
    if gcd_num == 1:
        ans = 2

# 出力
if ans == 1:
    print("pairwise coprime")
else:
    if ans == 2:
        print("setwise coprime")
    else:
        print("not coprime")
Buggy python submission (verdict: Runtime Error):
#A - Rainy Season
Si = []
Si = list(str(input()))
i = 0
if Si.count('S') == 3:
    i = 0
else:
    if Si.count('R') == 3:
        i = 3
    else:
        if Si.count('R') == 1:
            i = 1
        else:
            if Si[1] == 'S':
                 = 1
            else:
                i = 2
# 出力
print(i)

Fixed submission:
#A - Rainy Season
Si = []
Si = list(str(input()))
i = 0
if Si == ['S','S','S']: i = 0
if Si == ['R','S','S']: i = 1
if Si == ['S','R','S']: i = 1
if Si == ['S','S','R']: i = 1
if Si == ['R','R','S']: i = 2
if Si == ['S','R','R']: i = 2
if Si == ['R','S','R']: i = 1
if Si == ['R','R','R']: i = 3
# 出力
print(i)
Buggy python submission (verdict: Time Limit Exceeded):
#E_Picking Goods
R,C,K = map(int,input().split())
A =     [[0  for j in range(C)] for i in range(R)]
varr = [[[0  for j in range(C)] for i in range(R)] for k in range(4)]

for inputk in range(K):
    r,c,v = map(int,input().split())
    A[r-1][c-1] = v

for i in range(R):  
    for j in range(C):
        for k in range(2,-1,-1):
            if varr[k][i][j] >= 0:
                if  varr[k+1][i][j] < varr[k][i][j] + A[i][j]:
                    varr[k+1][i][j] = varr[k][i][j] + A[i][j]
        for kk in range(0,4):
            if varr[kk][i][j] >= 0:
                if i +1 < R :
                    if  varr[0][i + 1][j] < varr[kk][i][j]:
                        varr[0][i + 1][j] = varr[kk][i][j] 
                if j +1 < C :
                    if  varr[kk][i][j + 1] < varr[kk][i][j]:
                        varr[kk][i][j + 1] = varr[kk][i][j] 
ans = 0
for k in range (4):
    if ans < varr[k][R-1][C-1]:
        ans = varr[k][R-1][C-1]

print(ans)


Fixed submission:
#E_Picking Goods
R,C,K = map(int,input().split())
A =     [[0  for j in range(C)] for i in range(R)]
varr = [[[0  for j in range(C)] for i in range(R)] for k in range(4)]

for inputk in range(K):
    r,c,v = map(int,input().split())
    A[r-1][c-1] = v

for i in range(R):  
    for j in range(C):
        for k in range(2,-1,-1):
            if varr[k][i][j] >= 0:
                if  varr[k+1][i][j] < varr[k][i][j] + A[i][j]:
                    varr[k+1][i][j] = varr[k][i][j] + A[i][j]
        for kk in range(0,4):
            if varr[kk][i][j] >= 0:
                if i +1 < R :
                    if  varr[0][i + 1][j] < varr[kk][i][j]:
                        varr[0][i + 1][j] = varr[kk][i][j] 
                if j +1 < C :
                    if  varr[kk][i][j + 1] < varr[kk][i][j]:
                        varr[kk][i][j + 1] = varr[kk][i][j] 
ans = 0
for k in range (4):
    if ans < varr[k][R-1][C-1]:
        ans = varr[k][R-1][C-1]

print(ans)
Buggy python submission (verdict: Runtime Error):
#C_Repsept
import math
K = int(input())
if K % 7 == 0 :
    L = 9 * K / 7
else:
    L = 9 * K
X = 0
kekka = 1
total = -1
if L % 2 == 1:
    if L % 5 != 0:
        for i in range(L): 
 #           X = pow(10,i) % L
            kekka = kekka * 10 % L
            if kekka == 1:
                total = i+1
                break
# 出力
print(total)


Fixed submission:
#C_Repsept
K = int(input())
if K % 7 == 0 :
    L = int( 9 * K / 7 )
else:
    L = 9 * K
X = 0
kekka = 1
total = -1
if L % 2 == 1:
    if L % 5 != 0:
        for i in range(L): 
            kekka = kekka * 10 % L
            if kekka == 1:
                total = i+1
                break
# 出力
print(total)

Buggy python submission (verdict: Time Limit Exceeded):
#C_Repsept
import math
K = int(input())
X = 0
kekka = -1
total = -1
if K % 2 == 1:
    for i in range(K): 
        X = X + pow(10,i) * 7
        kekka = X % K
        if kekka == 0:
            total = i+1
            break
# 出力
print(total)

Fixed submission:
#C_Repsept
K = int(input())
if K % 7 == 0 :
    L = int( 9 * K / 7 )
else:
    L = 9 * K
X = 0
kekka = 1
total = -1
if L % 2 == 1:
    if L % 5 != 0:
        for i in range(L): 
            kekka = kekka * 10 % L
            if kekka == 1:
                total = i+1
                break
# 出力
print(total)

Buggy python submission (verdict: Time Limit Exceeded):
#C_Repsept
import math
K = int(input())
X = 0
kekka = -1
total = -1
for i in range(K): 
    X = X + pow(10,i) * 7
    kekka = X % K
    if kekka == 0:
        total = i+1
        break
# 出力
print(total)

Fixed submission:
#C_Repsept
K = int(input())
if K % 7 == 0 :
    L = int( 9 * K / 7 )
else:
    L = 9 * K
X = 0
kekka = 1
total = -1
if L % 2 == 1:
    if L % 5 != 0:
        for i in range(L): 
            kekka = kekka * 10 % L
            if kekka == 1:
                total = i+1
                break
# 出力
print(total)
Buggy python submission (verdict: Time Limit Exceeded):
#D - Chat in a Circle
N = int(input())
A = list(map(int,input().split()))
#ソート
#B = []
arr = A.copy()
left = 0
right = N -1
#B = sorted(A,reverse = True)

def quicksort(arr,left,right):
    index = partition(arr,left,right)
    if left < index- 1 :
        quicksort(arr,left,index - 1)
    if index < right:
        quicksort(arr,index,right)

def partition(arr,left,right):
    pivot = arr[int((left + right) / 2)]
    while left <= right:
        while arr[left]  > pivot:
            left  += 1
        while arr[right] < pivot:
            right -= 1
        if left <= right:
             arr[left],arr[right] = arr[right],arr[left]
             left += 1
             right -= 1
    return left

quicksort(arr,left,right)

Chat = []
Friend_min = 0
Friend_min_max = 0
Friend_min_max_wa = 0
max_no = 0
i =0
Chat.append(arr[0])
for i in range(N):
    for j in range(i):
        if (Chat[j] > Chat[j+1]):
            Friend_min = Chat[j+1]
        else:
            Friend_min = Chat[j]
        if Friend_min >= Friend_min_max:
            Friend_min_max = Friend_min
            max_no = j + 1
        Friend_min = 0
    Chat.insert(max_no,arr[i])
    Friend_min_max_wa = Friend_min_max_wa + Friend_min_max
    Friend_min_max = 0
    max_no = 0
#    print(Chat)    
# 出力
print(Friend_min_max_wa)

Fixed submission:
#D - Chat in a Circle
N = int(input())
A = list(map(int,input().split()))
#ソート
arr = []
arr = sorted(A,reverse = True)

Friend_min_max_wa = 0
i =0
j = 0
for i in range(N -1):
    if i % 2 != 0 : j = j + 1
    Friend_min_max_wa = Friend_min_max_wa + arr[j]

# 出力
print(Friend_min_max_wa)

Buggy python submission (verdict: Time Limit Exceeded):
#D - Chat in a Circle
N = int(input())
A = list(map(int,input().split()))
#ソート
B = []
B = sorted(A,reverse = True)
Chat = []
Friend_min = 0
Friend_min_max = 0
Friend_min_max_wa = 0
max_no = 0
i =0
Chat.append(B[0])
for i in range(N):
    for j in range(i):
        if (Chat[j] > Chat[j+1]):
            Friend_min = Chat[j+1]
        else:
            Friend_min = Chat[j]
        if Friend_min >= Friend_min_max:
            Friend_min_max = Friend_min
            max_no = j + 1
        Friend_min = 0
    Chat.insert(max_no,B[i])
    Friend_min_max_wa = Friend_min_max_wa + Friend_min_max
    Friend_min_max = 0
    max_no = 0
#    print(Chat)    
# 出力
print(Friend_min_max_wa)

Fixed submission:
#D - Chat in a Circle
N = int(input())
A = list(map(int,input().split()))
#ソート
arr = []
arr = sorted(A,reverse = True)

Friend_min_max_wa = 0
i =0
j = 0
for i in range(N -1):
    if i % 2 != 0 : j = j + 1
    Friend_min_max_wa = Friend_min_max_wa + arr[j]

# 出力
print(Friend_min_max_wa)
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
print a if a<=b else a-1

Fixed submission:
a,b = map(int, input().split())
if a <= b:
    print(a)
else:
    print(a-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())

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

print(len(list(set(d_i_list))))

Fixed submission:
s=input()
print('2018'+s[4:])
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = [0]*10000
 
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            a = x**2+y**2+z**2+x*y+y*z+z*x
            if a <10000:
                A[a] += 1
                
for i in range(n):
    print(A[i+1])
        


Fixed submission:
n = int(input())
A = [0]*10050
 
for x in range(1,105):
    for y in range(1,105):
        for z in range(1,105):
            a = x**2+y**2+z**2+x*y+y*z+z*x
            if a <10050:
                A[a] += 1
                
for i in range(n):
    print(A[i+1])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

for i in range(1,n+1):
    cnt = 0
    for x in range(1,int(i**0.5)+1):
        for y in range(1,int(i**0.5)+1):
            for z in range(1,int(i**0.5)+1):
                if x**2+y**2+z**2+x*y+y*z+z*x == i:
                    cnt += 1
    print(cnt)
    

Fixed submission:
n = int(input())
A = [0]*10050
 
for x in range(1,105):
    for y in range(1,105):
        for z in range(1,105):
            a = x**2+y**2+z**2+x*y+y*z+z*x
            if a <10050:
                A[a] += 1
                
for i in range(n):
    print(A[i+1])
Buggy python submission (verdict: Runtime Error):
if N == 0:
    P = []
else:
    P = [int(x) for x in input().split()]

for i in range(100):
    q = X - i
    if q not in P:
        print(q)
        break
    q = X + i
    if q not in P:
        print(q)
        break

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

if N == 0:
    P = []
else:
    P = [int(x) for x in input().split()]

for i in range(100):
    q = X - i
    if q not in P:
        print(q)
        break
    q = X + i
    if q not in P:
        print(q)
        break
Buggy python submission (verdict: Runtime Error):
N = int(input())

A = [int(x) for x in input().split()]
A = sorted(A)
A = list(set(A))

if len(A) == 1:
    print(0)
else:
    if A[0] == A[1]:
        cnt = 0
    else:
        cnt = 1
    
    for i in range(1,N):
        flag = True
        for j in range(i):
            if A[i]%A[j] == 0:
                flag = False
                break

    
        if flag == True:
            cnt += 1
    print(cnt)


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

l=[0]*(10**6+1)
ans=0
#print(l)
for i in a:
    if l[i]==0:
        for j in range(i,10**6+1,i):
            l[j] += 1
    else:
        l[i] += 1
#print(l)
for i in a:
    if l[i]==1:
        ans+=1

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())

A = [int(x) for x in input().split()]
A = sorted(A)

if A[0] == A[1]:
    cnt = 0
else:
    cnt = 1
    
for i in range(1,N):
    flag = True
    for j in range(i):
        if A[i]%A[j] == 0:
            flag = False
            break

    
    if i != N-1:
        if A[i] == A[i+1]:
            flag = False
    
    if flag == True:
        cnt += 1
print(cnt)

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

l=[0]*(10**6+1)
ans=0
#print(l)
for i in a:
    if l[i]==0:
        for j in range(i,10**6+1,i):
            l[j] += 1
    else:
        l[i] += 1
#print(l)
for i in a:
    if l[i]==1:
        ans+=1

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())

A = [int(x) for x in input().split()]
A = sorted(A)


if A[0] == A[1]:
    cnt = 0
else:
    cnt = 1
    
for i in range(1,N):
    flag = True
    for j in range(i):
        if A[i]%A[j] == 0:
            flag = False
            break
        break
    
    if i != N-1:
        if A[i] == A[i+1]:
            flag = False
    
    if flag == True:
        cnt += 1
print(cnt)

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

l=[0]*(10**6+1)
ans=0
#print(l)
for i in a:
    if l[i]==0:
        for j in range(i,10**6+1,i):
            l[j] += 1
    else:
        l[i] += 1
#print(l)
for i in a:
    if l[i]==1:
        ans+=1

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())

A = [int(x) for x in input().split()]
A = sorted(A)


if A[0] == A[1]:
    cnt = 0
else:
    cnt = 1
    
for i in range(1,N):
    flag = True
    for j in range(i):
        if A[i]%A[j] == 0:
            flag = False
    if i != N-1:
        if A[i] == A[i+1]:
            flag = False
    
    if flag == True:
        cnt += 1
print(cnt)

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

l=[0]*(10**6+1)
ans=0
#print(l)
for i in a:
    if l[i]==0:
        for j in range(i,10**6+1,i):
            l[j] += 1
    else:
        l[i] += 1
#print(l)
for i in a:
    if l[i]==1:
        ans+=1

print(ans)
Buggy python submission (verdict: Runtime Error):
import math

A,B,H,M = map(int,input().split())

kakudo = abs((H*30+0.5*M-M*6)%180) 

a = (A**2 + B**2 - 2*A*B*math.cos(math.radians(kakudo)))
print(math.sqrt(a))

Fixed submission:
N = input()

if int(N[-1]) in [2,4,5,7,9]:
    print("hon")
elif int(N[-1]) in [0,1,6,8]:
    print("pon")
else:print("bon")
Buggy python submission (verdict: Runtime Error):
def resolve():
    import itertools
    N,M = map(int,input().split())
    N_list = [int(x) for x in range(N)]
    M_list = [int(y) for y in range(M)]

    n = len(list(itertools.combinations(N_list,2)))
    m = len(list(itertools.combinations(M_list,2)))
    print(n+m)

if __name__ == "__main__":
    main()   

Fixed submission:
def resolve():
    import itertools
    N,M = map(int,input().split())
    N_list = [int(x) for x in range(N)]
    M_list = [int(y) for y in range(M)]

    n = len(list(itertools.combinations(N_list,2)))
    m = len(list(itertools.combinations(M_list,2)))
    print(n+m)

resolve()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

P = [int(x) for x in input().split()]

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

print(cnt)

Fixed submission:
N = int(input())

P = [int(x) for x in input().split()]

cnt = 1
min_num = P[0]

for i in range(1,N):
    if P[i] <= min_num:
        cnt += 1
        min_num = P[i]
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N = int(input())
S = input()
S_list = []
for i in range(len(S)):
    S_list.append(S[i])

comb_S_list = set(itertools.combinations(S_list,3))

print(len(comb_S_list))


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

for i in range(10):
    a = S.find(str(i))
    if a == -1 : continue
    for j in range(10):
        b = S.find(str(j),a+1)
        if b == -1 : continue
        for k in range(10):
            c = S.find(str(k),b+1)
            if c != -1 :
                cnt += 1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N = int(input())
S = input()
S_list = []
for i in range(len(S)):
    S_list.append(S[i])

comb_S_list = list(itertools.combinations(S_list,3))

print(len(set(comb_S_list)))


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

for i in range(10):
    a = S.find(str(i))
    if a == -1 : continue
    for j in range(10):
        b = S.find(str(j),a+1)
        if b == -1 : continue
        for k in range(10):
            c = S.find(str(k),b+1)
            if c != -1 :
                cnt += 1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N = int(input())
S = input()
S_list = []
for i in range(len(S)):
    S_list.append(S[i])

comb_S_list = list(itertools.combinations(S_list,3))

print(len(set(comb_S_list)))


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

for i in range(10):
    a = S.find(str(i))
    if a == -1 : continue
    for j in range(10):
        b = S.find(str(j),a+1)
        if b == -1 : continue
        for k in range(10):
            c = S.find(str(k),b+1)
            if c != -1 :
                cnt += 1

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

A = [int(x) for x in input().split()]

ans = []
for i in range(1,N+1):
    print(A.index(i)+1,end= " ")
    

Fixed submission:
N = int(input())

A = [int(x) for x in input().split()]

student = list(range(0,N))

student.sort(key = lambda x:A[x])

for s in student:
    print(s+1,end= " ")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

A = [int(x) for x in input().split()]

ans = []
for i in range(1,N+1):
    print(A.index(i)+1,end= " ")
    

Fixed submission:
N = int(input())

A = [int(x) for x in input().split()]

student = list(range(0,N))

student.sort(key = lambda x:A[x])

for s in student:
    print(s+1,end= " ")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

A = [int(x) for x in input().split()]

ans = []
for i in range(1,N+1):
    ans.append(A.index(i)+1)

print(*ans)

Fixed submission:
N = int(input())

A = [int(x) for x in input().split()]

student = list(range(0,N))

student.sort(key = lambda x:A[x])

for s in student:
    print(s+1,end= " ")