Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import collections

n = int(input())
a = list(map(int, input().split()))
ac = collections.Counter(a)

for i in range(1,n+1):
    print(a[i])

Fixed submission:
import collections
 
n = int(input())
a = list(map(int, input().split()))
ac = collections.Counter(a)
 
for i in range(1,n+1):
    print(ac[i])

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

for i in range(1,n+1):
    print(a.count(i))



Fixed submission:
import collections
 
n = int(input())
a = list(map(int, input().split()))
ac = collections.Counter(a)
 
for i in range(1,n+1):
    print(ac[i])
Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B,N =map(int,input().split())
ans =0
for x in range(1,N+1):
  num = math.floor(A*x/B) - A * math.floor(x/B)
  if num > ans:
    ans = num

print(ans)

Fixed submission:
import math

A,B,N = map(int,input().split())
if B>N:
  print( math.floor(A*N/B) - A * math.floor(N/B))
  exit()
print( math.floor(A*(B-1)/B) - A * math.floor((B-1)/B))

Buggy python submission (verdict: Runtime Error):
A,B,N =map(int,input().split())
ans =0
for x in range(1,N+1):
  num = math.floor(A*x/B) - A * math.floor(x/B)
  if num > ans:
    ans = num

print(ans)

Fixed submission:
import math

A,B,N = map(int,input().split())
if B>N:
  print( math.floor(A*N/B) - A * math.floor(N/B))
  exit()
print( math.floor(A*(B-1)/B) - A * math.floor((B-1)/B))
Buggy python submission (verdict: Runtime Error):
X=int(input())
Y=int(input())
Z=int(input())
print(Z,X,Y)

Fixed submission:
X,Y,Z = map(int, input().split())
print(Z,X,Y)

Buggy python submission (verdict: Runtime Error):
X=int(input())
Y=int(input())
Z=int(input())
print(Z)
print(X)
print(Y)

Fixed submission:
X,Y,Z = map(int, input().split())
print(Z,X,Y)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
a = input().split()
for i in a:
  if int(i) >= sum(map(int,a))* 1/(4*M):
    ans+=1

if ans >= M:
  print("Yes")
else:
  print("No")

Fixed submission:
N,M = map(int,input().split())
a = input().split()
ans =0
for i in a:
  if int(i) >= sum(map(int,a))* 1/(4*M):
    ans+=1

if ans >= M:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for i in range(A+1):
  for j in ramge(B+1):
    for k in range(C+1):
      if 500*i + 100*j + 50*k == X:
        count+=1
print(count)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      if 500*i + 100*j + 50*k == X:
        count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
def digitSum(n):
  #数値を文字列に変換
  s = str(n)
  #1文字ずつ数値化し配列にする
  array = list(map(int,s))
  #合計値を返す
  return sum(array)


N,A,B = map(int,input().split())
sum = 0
for i in range(N+1):
  if digitSum(i) <=B and digitSum(i)>=A:
    sum +=i
print(sum)

Fixed submission:
def digitSum(n):
  #数値を文字列に変換
  s = str(n)
  #1文字ずつ数値化し配列にする
  array = list(map(int,s))
  #合計値を返す
  return sum(array)


N,A,B = map(int,input().split())
a = 0
for i in range(N+1):
  if digitSum(i) <= B and digitSum(i) >= A:
    a +=i
print(a)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
en = 0
con = True
while con :
	en += 1
	for i in range(N) :
		if A[i] % 2 == 0 :
			A[i] = int( A[i] / 2 ) 
		else :
			en -= 1
			con = False
			break
print(en)

Fixed submission:
num = 0
s = input()
for i in s:
  if int(i) == 1:
    num += 1
print(num)

Buggy python submission (verdict: Runtime Error):
s = input()
for i in s:
  if int(i) == 1:
    num += 1
print(num)

Fixed submission:
num = 0
s = input()
for i in s:
  if int(i) == 1:
    num += 1
print(num)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
count = 0
can = True
while can :
	count += 1
	for i in range(N) :
		if A[i] % 2 == 0 :
			A[i] = int( A[i] / 2 ) 
		else :
			count -= 1
			can = False
			break
print(en)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
en = 0
con = True
while con :
	en += 1
	for i in range(N) :
		if A[i] % 2 == 0 :
			A[i] = int( A[i] / 2 ) 
		else :
			en -= 1
			con = False
			break
print(en)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [input() for i in range(N)]
count = 0 
can = True
while can:
  count += 1
  for i in range(N):
    if A[i]%2 == 0:
      A[i] = int(A[i]/2)
    else:
      count-=0
      can = False
      break
print(count)


Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
en = 0
con = True
while con :
	en += 1
	for i in range(N) :
		if A[i] % 2 == 0 :
			A[i] = int( A[i] / 2 ) 
		else :
			en -= 1
			con = False
			break
print(en)
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())

c = N // (A + B)
mod = N % (A + B)
# print(c,mod)

if mod > A:
    mod_A = mod // A 
    # print(mod_A)
    print(c * A + mod_A * A)
else:
    print(c * A + mod)

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

q, mod = divmod(N, A+B)
# print(q,mod)

if A == 0:
    print(0)
else:
    if mod > A:
        print(q * A + A)
    else:
        print(q * A + mod)

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())

c = N // (A + B)
mod = N % (A + B)
# print(c,mod)

mod_A = mod // A 
# print(mod_A)
print(c * A + mod_A * A)

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

q, mod = divmod(N, A+B)
# print(q,mod)

if A == 0:
    print(0)
else:
    if mod > A:
        print(q * A + A)
    else:
        print(q * A + mod)
Buggy python submission (verdict: Runtime Error):

# 標準入力
A,B,H,M=map(int,input().split())

# 角度の差が出る
A_RAD = float((H*60+M)/720*2*math.pi)
B_RAD = float(M/60*2*math.pi)
AB_RAD = A_RAD - B_RAD

C = math.sqrt(A**2+B**2-2*A*B*math.cos(AB_RAD))

print(C)

Fixed submission:

import math

# 標準入力
A,B,H,M=map(int,input().split())

# 角度の差が出る
A_RAD = float((H*60+M)/720*2*math.pi)
B_RAD = float(M/60*2*math.pi)
AB_RAD = A_RAD - B_RAD

C = math.sqrt(A**2+B**2-2*A*B*math.cos(AB_RAD))

print(C)
Buggy python submission (verdict: Runtime Error):
def solve(i, cost, know, x, a):
    global res
    if i == len(a):
        for j in range(m):
            if know[j] < x:
                return
        res = min(res, cost)
        return
    solve(i + 1, cost, know, x, a)
    for j in range(m):
        know[j] += a[i][j + 1]
    solve(i + 1, cost + a[i][0], know, x, a)
    for j in range(m):
        know[j] -= a[i][j + 1]
fin = open('input.txt', 'r')
n, m, x = [int(i) for i in input().split()]
a = [[int(i) for i in input().split()] for j in range(n)]
know = [0] * (m)
res = 10 ** 7
solve(0, 0, know, x, a)
print(res if res != 10 ** 7 else - 1)

Fixed submission:
def solve(i, cost, know, x, a):
    global res
    if i == len(a):
        for j in range(m):
            if know[j] < x:
                return
        res = min(res, cost)
        return
    solve(i + 1, cost, know, x, a)
    for j in range(m):
        know[j] += a[i][j + 1]
    solve(i + 1, cost + a[i][0], know, x, a)
    for j in range(m):
        know[j] -= a[i][j + 1]
n, m, x = [int(i) for i in input().split()]
a = [[int(i) for i in input().split()] for j in range(n)]
know = [0] * (m)
res = 10 ** 7
solve(0, 0, know, x, a)
print(res if res != 10 ** 7 else - 1)
Buggy python submission (verdict: Runtime Error):
def result(m, b):
    sum1 = m
    resmin = m
    for i in range(len(b)):
        resmin += b[i][0]
        if resmin < 0:
            return -1
        else:
            resmin += b[i][1] - b[i][0]
    for i in range(len(b)):
        sum1 += b[i][1]
    if sum1 != 0:
        return -1
    return 0
fin = open('input.txt', 'r')
n = int(fin.readline().strip('\n'))
resmin = 10 ** 7
set_pos = []
set_neg = []
for i in range(n):
    a = fin.readline().strip('\n')
    loc_min = 10 ** 7
    total = 0
    flag = True
    tmp = 0
    for j in range(len(a)):
        if a[j] == '(':
            tmp += 1
        else:
            tmp -= 1
        if tmp < loc_min:
            loc_min = tmp
    total = tmp
    if total >= 0:
        set_pos.append((loc_min, total))
    else:
        set_neg.append((loc_min, total))
total_pos = 0
set_pos = sorted(set_pos, key = lambda l: l[0], reverse = True)
for elem in set_pos:
    if total_pos + elem[0] < 0:
        flag = False
    total_pos += elem[1]   
b = sorted(set_neg, key = lambda l: l[1] - l[0], reverse = True)
#print(b)
print(set_pos, b)
res = result(total_pos, b)
print('No' if (res == -1 or not flag) else 'Yes')

Fixed submission:
def result(m, b):
    sum1 = m
    resmin = m
    for i in range(len(b)):
        resmin += b[i][0]
        if resmin < 0:
            return -1
        else:
            resmin += b[i][1] - b[i][0]
    for i in range(len(b)):
        sum1 += b[i][1]
    if sum1 != 0:
        return -1
    return 0
n = int(input().strip('\n'))
resmin = 10 ** 7
set_pos = []
set_neg = []
for i in range(n):
    a = input().strip('\n')
    loc_min = 10 ** 7
    total = 0
    flag = True
    tmp = 0
    for j in range(len(a)):
        if a[j] == '(':
            tmp += 1
        else:
            tmp -= 1
        if tmp < loc_min:
            loc_min = tmp
    total = tmp
    if total >= 0:
        set_pos.append((loc_min, total))
    else:
        set_neg.append((loc_min, total))
total_pos = 0
set_pos = sorted(set_pos, key = lambda l: l[0], reverse = True)
for elem in set_pos:
    if total_pos + elem[0] < 0:
        flag = False
    total_pos += elem[1]   
b = sorted(set_neg, key = lambda l: l[1] - l[0], reverse = True)
#print(b)
#print(set_pos, b)
res = result(total_pos, b)
print('No' if (res == -1 or not flag) else 'Yes')
Buggy python submission (verdict: Runtime Error):
import math
a,b,n = map(int,input().split())
x = 0
ans = 0
if b > n:
    x = n
    ans = math.floor(a*n/b) - a*math.floor(n/b)
else:
    n = b-1
    ans = ath.floor(a*n/b) - a*math.floor(n/b)
print(ans)


Fixed submission:
import math
a,b,n = map(int,input().split())
x = 0
ans = 0
if b > n:
    x = n
    ans = math.floor(a*n/b) - a*math.floor(n/b)
else:
    n = b-1
    ans = math.floor(a*n/b) - a*math.floor(n/b)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
p = []
ans = 0
for i in range(n):
    s.append(input())
    if s[i] in p:
        pass
    else:
        p.append(s[i])
        ans += 1
print(ans)


Fixed submission:
n = int(input())
s = []
p = set()
ans = 0
for i in range(n):
    s.append(input())
    if s[i] in p:
        pass
    else:
        p.add(s[i])
        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for _ in range(n):
    s.append(input())
p = []
ans = 0
for i in range(n):
    if s[i] in p:
        pass
    else:
        p.append(s[i])
        ans += 1
print(ans)


Fixed submission:
n = int(input())
s = []
p = set()
ans = 0
for i in range(n):
    s.append(input())
    if s[i] in p:
        pass
    else:
        p.add(s[i])
        ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
import fractions
l = []
ans = 0
for a in range(1,k+1):
    for b in range(a,k+1):
        for c in range(b,k+1):
            l = [a,b,c]
            d = l[0]
            for i in range(1,3):
                d = fractions.gcd(d,l[i])
            if a != b and b!= c and a!= c:
                ans+= d*6
            elif (a==b and a!=c) or (a==c and a!= b) or (b == c and a!= b):
                ans+= d*3
            else:
                ans+= d
print(ans)            


Fixed submission:
k = int(input())
import math
l = []
ans = 0
e = 0
d = 0
for a in range(1,k+1):
    for b in range(a,k+1):
        e = math.gcd(a,b)
        for c in range(b,k+1):
            d = math.gcd(e,c)
            if a != b and b!= c and a!= c:
                ans+= d*6
            elif (a==b and a!=c) or (a==c and a!= b) or (b == c and a!= b):
                ans+= d*3
            else:
                ans+= d
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(input())
#
ans = 0
def R(x):
    if x == 0:
        if s[0] == 'R':
            return 1
        else:
            return 0
    else:
        if s[x] == 'R':
            return R(x-1) + 1
        else:
            return R(x-1)
def B(x):
    if x == 0:
        if s[0] == 'B':
            return 1
        else:
            return 0
    else:
        if s[x] == 'B':
            return B(x-1) + 1
        else:
            return B(x-1)
def G(x):
    if x == 0:
        if s[0] == 'G':
            return 1
        else:
            return 0
    else:
        if s[x] == 'G':
            return G(x-1) + 1
        else:
            return G(x-1)

for i in range(n-2):
    for j in range(i+1,n-1):
        if s[i] != s[j]:
            if s[i] != 'R' and s[j] != 'R':
                if 2*j-i <= n-1 and s[2*j-i] == 'R':
                    ans += R(n-1) - R(j) - 1
                else:
                    ans += R(n-1) - R(j)
            elif  s[i] != 'B' and s[j] != 'B':
                if 2*j - i <= n-1 and s[2*j-i] == 'B':
                    ans += B(n-1) - B(j) - 1
                else:
                    ans += B(n-1) - B(j)
            elif s[i] != 'G' and s[j] != 'G':
                if 2*j - i <= n-1 and s[2*j-i] == 'G':
                    ans += G(n-1) - G(j) - 1
                else:
                    ans += G(n-1) - G(j)
        else:
            pass
print(ans)


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

r_cnt = s.count('R')
g_cnt = s.count('G')
b_cnt = s.count('B')

ans = r_cnt*g_cnt*b_cnt

for i in range(n):
    for d in range(n):
        j = i + d
        k = j + d
        if k >= n:
            break
        if s[i] != s[j] and s[i] != s[k] and s[j]!=s[k]:
            ans -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)
MOD = 1000000007

k = int(input())
number = 9

ans = 0
for i in range(10,10**6):
    check = 'OK'
    l = len(str(i))
    keta = list(str(i))
    for j in range(l-1):
        if abs(int(keta[j]) - int(keta[j+1])) <= 1:
            pass
        else:
            check = 'NG'
    if check == 'OK':
        number += 1
        if number == k:
            ans = i%MOD
            break
if k <= 9:
    print(k)
else:
    print(ans%MOD)


Fixed submission:
x,y,z = map(int,input().split())
print(z,x,y)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10**6)


k = int(input())
number = 9

ans = 0
for i in range(10,10**7):
    check = 'OK'
    l = len(str(i))
    keta = list(str(i))
    for j in range(l-1):
        if abs(int(keta[j]) - int(keta[j+1])) <= 1:
            pass
        else:
            check = 'NG'
    if check == 'OK':
        number += 1
        if number == k:
            ans = i
            break
if k <= 9:
    print(k)
else:
    print(ans)


Fixed submission:
k = int(input())
ans = [i for i in range(1,10)]

i = 0

for i in range(k):
    now = ans[i]
    if str(now)[-1] == '0':
        ans.append(now*10)
        ans.append(now*10+1)
    elif str(now)[-1] == '9':
        ans.append(now*10+8)
        ans.append(now*10+9)
    else:
        ans.append(now*10+now%10-1)
        ans.append(now*10+now%10)
        ans.append(now*10+now%10+1)
    if len(ans) > k:
        break

print(ans[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10**6)
MOD = 1000000007

k = int(input())
number = 9

ans = 0
for i in range(10,10**6):
    check = 'OK'
    l = len(str(i))
    keta = list(str(i))
    for j in range(l-1):
        if abs(int(keta[j]) - int(keta[j+1])) <= 1:
            pass
        else:
            check = 'NG'
    if check == 'OK':
        number += 1
        if number == k:
            ans = i%MOD
            break
if k <= 9:
    print(k)
else:
    print(ans%MOD)


Fixed submission:
k = int(input())
ans = [i for i in range(1,10)]

i = 0

for i in range(k):
    now = ans[i]
    if str(now)[-1] == '0':
        ans.append(now*10)
        ans.append(now*10+1)
    elif str(now)[-1] == '9':
        ans.append(now*10+8)
        ans.append(now*10+9)
    else:
        ans.append(now*10+now%10-1)
        ans.append(now*10+now%10)
        ans.append(now*10+now%10+1)
    if len(ans) > k:
        break

print(ans[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10**6)
MOD = 1000000007

k = int(input())
number = 9

ans = 0
for i in range(10,10**7):
    check = 'OK'
    l = len(str(i))
    keta = list(str(i))
    for j in range(l-1):
        if abs(int(keta[j]) - int(keta[j+1])) <= 1:
            pass
        else:
            check = 'NG'
    if check == 'OK':
        number += 1
        if number == k:
            ans = i%MOD
            break
if k <= 9:
    print(k)
else:
    print(ans%MOD)


Fixed submission:
k = int(input())
ans = [i for i in range(1,10)]

i = 0

for i in range(k):
    now = ans[i]
    if str(now)[-1] == '0':
        ans.append(now*10)
        ans.append(now*10+1)
    elif str(now)[-1] == '9':
        ans.append(now*10+8)
        ans.append(now*10+9)
    else:
        ans.append(now*10+now%10-1)
        ans.append(now*10+now%10)
        ans.append(now*10+now%10+1)
    if len(ans) > k:
        break

print(ans[k-1])
Buggy python submission (verdict: Runtime Error):
from decimal import *

getcontext().prec = 20
a,b,c = map(int,input().split())
a = int(Decimal(a))
b = int(Decimal(b))
c = int(Decimal(c))
if a*b < 1/4 * (c-a-b)**2:
    print('Yes')
else:
    print('No')


Fixed submission:
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(a[k-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
s = [0] * (int(x[n-1] - x[0]) + 1)
ans = 0
#
for p in range(x[0],x[n-1]+1):
    for j in range(n):
        s[p - x[0]] += (x[j] - p)**2
#
ans = min(s)
print(ans)


Fixed submission:
n = int(input())
x = list(map(int,input().split()))
s = [0] * (max(x) - min(x) + 1)
ans = 0
#
for p in range(min(x),max(x)+1):
    for j in range(n):
        s[p - x[0]] += (x[j] - p)**2
#
ans = min(s)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [input() for i in range(n)]
#
from collections import Counter
b = Counter(a)
c = list(b.keys())
d = list(b.values())
max_index = [i for i, v in enumerate(d) if v == max(d)]
e =[]
for k in range(len(max_index)):
    e.append(c[max_index[k]])
e = sorted(e)

#
#e = []
#for j in range(len(d)):
    #if int(d[j]) == max(d):
        #e.append(j)
#
#[print(c[e[k]]) for k in range(len(e))]
#f =[]
#for k in range(len(e)):
    #f.append(c[e[k]])
#f = sorted(f)
[print(e[l]) for l in range(len(e))]


Fixed submission:
import collections
n = int(input())
s = []
for _ in range(n):
    s.append(input())
ss = collections.Counter(s)
s_most = ss.most_common()

ans = []
#
for i in range(len(s_most)):
    if s_most[i][1] == s_most[0][1]:
        ans.append(s_most[i][0])
    else:
        break
for i in sorted(ans):
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [input() for i in range(n)]
#
from collections import Counter
b = Counter(a)
c = list(b.keys())
d = list(b.values())
#
e = []
for j in range(len(d)):
    if int(d[j]) == max(d):
        e.append(j)
#
#[print(c[e[k]]) for k in range(len(e))]
f =[]
for k in range(len(e)):
    f.append(c[e[k]])
f = sorted(f)
[print(f[l]) for l in range(len(f))]


Fixed submission:
import collections
n = int(input())
s = []
for _ in range(n):
    s.append(input())
ss = collections.Counter(s)
s_most = ss.most_common()

ans = []
#
for i in range(len(s_most)):
    if s_most[i][1] == s_most[0][1]:
        ans.append(s_most[i][0])
    else:
        break
for i in sorted(ans):
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))
e = [0] * (n-k+1)

for i in range(0,n-k+1):
    for j in range(i,i+k):
        e[i] += float(1/2 * (1 + p[j]))

print(max(e))


Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
e = [0] * (n-k+1)

for i in range(k):
    e[0] += float(1/2 * (1 + p[i]))
for j in range(n-k):
    e[j+1] = e[j] + float(1/2 * (p[j+k]-p[j]))
print(max(e))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n = int(input())
p = list(map(int,input().split()))
p_cutted = []
p_cutted = deque(p_cutted)
ans = 0
for i in range(n):
    p_cutted.append(p[i])
    if min(p_cutted) == p[i]:
        ans += 1
print(ans)


Fixed submission:
from collections import deque
n = int(input())
p = list(map(int,input().split()))
p_cutted = []
p_cutted = deque(p_cutted)
min_p_cutted = p[0]
ans = 0
for i in range(n):
    p_cutted.append(p[i])
    if min_p_cutted >= p[i]:
        min_p_cutted = p[i]
        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))
p_cutted = []
ans = 0
for i in range(n):
    p_cutted.append(p[i])
    if min(p_cutted) == p[i]:
        ans += 1
print(ans)


Fixed submission:
from collections import deque
n = int(input())
p = list(map(int,input().split()))
p_cutted = []
p_cutted = deque(p_cutted)
min_p_cutted = p[0]
ans = 0
for i in range(n):
    p_cutted.append(p[i])
    if min_p_cutted >= p[i]:
        min_p_cutted = p[i]
        ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = []
for i in range(n):
    ans.append(a.index(i+1)+1)
print(*ans)



Fixed submission:
n = int(input())
a = list(map(int,input().split()))
keys = []
for i in range(n):
    keys.append(i+1)
dic = {key: val for key,val in zip(keys,a)}
dic_sorted = sorted(dic.items(),key = lambda x:x[1])
for i in range(n):
    print(dic_sorted[i][0],end=" ")
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
Hs = list(map(int, input().split()))
arr = [list(map(int, input().split())) for _ in range(M)]

good = 0
for i in range(N):
    n = i + 1
    H = Hs[i]
    ans = True
    for a in arr:
        if n not in a:
            continue
        
        f = a[0]
        s = a[1]
        H1 = Hs[f - 1]
        H2 = Hs[s - 1]
        if f == n:
            if H1 <= H2:
                ans = False
                break
        else:
            if H2 <= H1:
                ans = False
                break
            
    if ans is True:
        good += 1
print(good)

Fixed submission:
N, M = map(int, input().split())
Hs = list(map(int, input().split()))
arr = [list(map(int, input().split())) for _ in range(M)]

ans = [True for _ in range(N)]

for a in arr:
    f, s = a
    H1 = Hs[f - 1]
    H2 = Hs[s - 1]
    if H1 == H2:
        ans[f - 1] = False
        ans[s - 1] = False
    elif H1 < H2:
        ans[f - 1] = False
    else:
        ans[s - 1] = False

print(len(list(filter(lambda x: x, ans))))
Buggy python submission (verdict: Runtime Error):
n = input()
s = [input() for i in range(n)]
 
print(len(list(set(s))))

Fixed submission:
n = int(input())
s = [input() for _ in range(n)]
 
print(len(list(set(s))))

Buggy python submission (verdict: Runtime Error):
n = input()
s = [input() for i in range(n)]

list(set(s))


Fixed submission:
n = int(input())
s = [input() for _ in range(n)]
 
print(len(list(set(s))))
Buggy python submission (verdict: Runtime Error):
import math
 
a,b,n = map(int,input().split())
 
ans = list()
for x in range(n+1):
    c = math.floor(a*x / b) - a * math.floor(x/b)
    ans.append(c)
 
print(max(ans))

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

ans = "NG"

for i in range(b,c+1):
    if i % a == 0:
        ans = "OK"

print(ans)