Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(input())
out_str=''
for i in s:
  m=ord(i)+n
  if m>90:
    m-=26
  out_str+=chr(m)

print(out_str)

Fixed submission:
s=input()
if s[0]=="S" or s[0]=="T":
  if s[2]=="E":
    print('5')
  elif s[2]=='U':
    print('3')
  elif s[2]=='T':
    print('1')
  else:
    print('7')
else:
  if s[1]=='R':
    print('2')
  elif s[1]=='O':
    print('6')
  else:
    print('4')
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    a = [int(s) for s in input().split()]

    count = 0

    a_count = a.count

    for j in range(1, n):
        for i in range(j):
            if a_count(a[i]) >= 2:
                count += 1
                break

    if count >= 1:
        print('NO')
    else:
        print('YES')

if __name__ == '__main__':
    main()

Fixed submission:
def has_duplicates(seq):
    return len(seq) != len(set(seq))

n = int(input())
a = [int(s) for s in input().split()]

if has_duplicates(a) == False:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(s) for s in input().split()]

count = 0

for j in range(1,n):
    for i in range(j):
        if a.count(a[i]) >= 2:
            count += 1
            break

if count >= 1:
    print('NO')
else:
    print('YES')

Fixed submission:
def has_duplicates(seq):
    return len(seq) != len(set(seq))

n = int(input())
a = [int(s) for s in input().split()]

if has_duplicates(a) == False:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(s) for s in input().split()]

count = 0

for j in range(1,n):
    for i in range(j):
        if a.count(a[i]) >= 2:
            count += 1
            break

if count >= 1:
    print('NO')
else:
    print('YES')

Fixed submission:
def has_duplicates(seq):
    return len(seq) != len(set(seq))

n = int(input())
a = [int(s) for s in input().split()]

if has_duplicates(a) == False:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(s) for s in input().split()]

count = 0

for i in range(n):
    if a.count(a[i]) >= 2:
        count += 1
        break

if count >= 1:
    print('NO')
else:
    print('YES')

Fixed submission:
def has_duplicates(seq):
    return len(seq) != len(set(seq))

n = int(input())
a = [int(s) for s in input().split()]

if has_duplicates(a) == False:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(s) for s in input().split()]

count = 0

for i in range(n):
    if a.count(a[i]) >= 2:
        count += 1

if count >= 2:
    print('NO')
else:
    print('YES')

Fixed submission:
def has_duplicates(seq):
    return len(seq) != len(set(seq))

n = int(input())
a = [int(s) for s in input().split()]

if has_duplicates(a) == False:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())

for i in range(k):
    if (a >= 1):
        a = a - 1
    elif(b >= 1):
        b = b -1
    elif(a == 0, b == 0):
        print()

print(str(a) + ' ' + str(b))

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

#Takahashi eats a, k times while Aoki doesn't eat b unless
#all of a's are gone.

if a+b <= k: #all cookies will be gone
    print(0,0)
else:
    if a <= k:
        print(0, b-(k-a))
    else:
        print(a-k, b)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
string = list(S)

alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
            'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
            'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']

#Generate empty output
output = ''

for i in range(len(S)):
    #Get the index of an alphabet in the list
    ind1 = alphabet.index(string[i])
    #Divide N by 26 and get the remainder
    ind2 = (int(ind1) + N) % 26
    #Update the letter and keep adding it to the list
    output += alphabet[ind2]

print(output)

Fixed submission:
date = input()

List = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']

for i in range(len(List)):
    if List[i] == date:
        print(i+1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = str(input())
if S[:N//2] == S[N//2:]:
    print('YES')
else:
    print('NO')

Fixed submission:
r = int(input())
r2 = r**2

ans = r**2 / 1
print(int(ans))

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

if N % 2 != 0:
    print('NO')
else:
    num =int( N / 2)
    f = S[0:num]
    if S == f+f:
        print('YES')
    else:
        print('NO')

Fixed submission:
r = int(input())
r2 = r**2

ans = r**2 / 1
print(int(ans))
Buggy python submission (verdict: Runtime Error):
from fractions import gcd
from math import ceil

def lcm(a, b):
    return a*b//gcd(a, b)

def num(l, r, n):
    return r//n-(l-1)//n

a, b, c, d = map(int, input().split(' '))

l = lcm(c, d)
print((b-a+1)-num(a, b, c)-num(a, b, d)+num(a, b, l))

Fixed submission:
s = list(int(s) for s in input())

for i in range(0, len(s)-1):
    if s[i] == s[i+1]:
        print('Bad')
        break

else:
    print('Good')
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
if (a * b % 2 == 0):
  return 'Even'
else:
  return 'Odd'

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

if (a*b % 2 == 0):
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if (a*b % 2 == 0):
  return 'Even'
else:
  return 'Odd'

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

if (a*b % 2 == 0):
  print('Even')
else:
  print('Odd')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

frag = False

for i in range(n):
  for j in range(n):
    if i != j and a[i] == a[j]:
      frag = True
if frag:
  print("NO")
else:
  print("YES")

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

b = set(a)

if len(a) == len(b):
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
H, N = map(int, input().split())
a = list(map(int, input().split())
sum = sum(a)
if sum >= H:
  print("Yes")
else:
  print("No")

Fixed submission:
H, N = map(int, input().split())
a = list(map(int, input().split()))
sum = sum(a)
if sum >= H:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
H, N = map(int, input().split())
a = list(map(int, input8).split())
sum = sum(a)
if sum >= H:
  print("Yes")
else:
  print("No")

Fixed submission:
H, N = map(int, input().split())
a = list(map(int, input().split()))
sum = sum(a)
if sum >= H:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
Hs = list(map(int, input().split()))
Hs.sort(reverse=True)
if K == 0:
  print(sum(Hs))
else:
  for i in range(K):
    Hs[i] = 0
  print(sum(Hs))

Fixed submission:
N, K = map(int, input().split())
Hs = list(map(int, input().split()))
Hs.sort(reverse=True)
if K > N:
  print(0)
else:
  for i in range(K):
    Hs[i] = 0
  print(sum(Hs))

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
Hs = list(map(int, input().split()))
Hs.sort(reverse=True)
for i in range(K):
  Hs[i] = 0
print(sum(Hs))

Fixed submission:
N, K = map(int, input().split())
Hs = list(map(int, input().split()))
Hs.sort(reverse=True)
if K > N:
  print(0)
else:
  for i in range(K):
    Hs[i] = 0
  print(sum(Hs))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
frag = False
ans = 0
for i in range(n):
  frag = False
  for j in range(i):
    if p[i] > p[j]:
      frag = True
  if not frag:
    ans += 1
print(ans)

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

min = a[0]
count = 1
for i in range(num - 1):
  if min > a[i+1]:
    min = a[i+1]
    count += 1
print(count)

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

count = 0
min = 0
for i in range(num):
  min = a[i]
  for j in range(i):
    if min > a[j]:
      min = a[j]
  if min == a[i]:
    count += 1
print(count)

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

min = a[0]
count = 1
for i in range(num - 1):
  if min > a[i+1]:
    min = a[i+1]
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = list(map(int, input().split())
         
count = 0
for i in range(N):
  if h[i] >= K:
         count += 1
print(count)
         

Fixed submission:
N, K = map(int, input().split())
h = list(map(int, input().split()))
count = 0
for i in range(N):
  if h[i] >= K:
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input())
statement = False
for a in range(X+1):
  for b in range(X-a+1):
    c = X - a - b + 1
    if a * 10000 + b * 5000 + c * 1000 == Y:
      print(str(a) + " " + str(b) + " " + str(c))
      statement = True
      break
    if statement:
      break
if not statement:
  print("-1 -1 -1")

Fixed submission:
X, Y = map(int, input().split())
statement = False
for a in range(X+1):
  for b in range(X-a+1):
    c = X - a - b
    if a * 10000 + b * 5000 + c * 1000 == Y:
      print(str(a) + " " + str(b) + " " + str(c))
      statement = True
      break
  if statement:
    break
if not statement:
  print("-1 -1 -1")

Buggy python submission (verdict: Runtime Error):
X = int(input())
Y = int(input())
statement = False
for a in range(X+1):
  for b in range(X-a+1):
    for c in range(X-a-b+1):
      if (a * 10000 + b * 5000 + c * 1000 == Y) and (a + b + c == X):
        print(str(a) + " " + str(b) + " " + str(c))
        statement = True
if not statement:
  print("-1 -1 -1")

Fixed submission:
X, Y = map(int, input().split())
statement = False
for a in range(X+1):
  for b in range(X-a+1):
    c = X - a - b
    if a * 10000 + b * 5000 + c * 1000 == Y:
      print(str(a) + " " + str(b) + " " + str(c))
      statement = True
      break
  if statement:
    break
if not statement:
  print("-1 -1 -1")
Buggy python submission (verdict: Runtime Error):
s = input()
s2 = s.split('dream')
s3 = ''.join(s2).split('erase')
s3.remove('er')
s3.remove('r')
if len(s3) != 0:
  print("NO")
else:
  print("YES")

Fixed submission:
s = input()
s2 = s.split('eraser')
s3 = ''.join(s2).split('erase')
s4 = ''.join(s3).split('dreamer')
s5 = ''.join(s4).split('dream')
s5 = list(set(s5))
if len(s5) == 1 and s5[0] == '':
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
def solve(n, a):
    for i in range(n - 1):
        for j in range(i + 1, n):
            if(a[i] == a[j]):
                return 'NO'

    return 'YES'

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

print(solve(n, a))

Fixed submission:
def solve(n, a):
    a.sort()
    for i in range(n - 1):
        if(a[i] == a[i + 1]):
            return 'NO'

    return 'YES'

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

print(solve(n, a))

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

flag = False
for i in range(n - 1):
    for j in range(i + 1, n):
        if(a[i] == a[j]):
            flag = True
            break

    if(flag):
        break

if(flag):
    print('NO')
else:
    print('YES')

Fixed submission:
def solve(n, a):
    a.sort()
    for i in range(n - 1):
        if(a[i] == a[i + 1]):
            return 'NO'

    return 'YES'

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

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

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

    if(ans_max < temp):
        ans_max = temp

print(ans_max)

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

p_dash = []
for i in range(n):
    p_dash.append((p[i] + 1) / 2)

ans_max = 0
for i in range(k):
    ans_max += p_dash[i]

temp = ans_max
for i in range(k, n):
    temp = temp - p_dash[i - k] + p_dash[i]
    if(temp > ans_max):
        ans_max = temp

print(ans_max)

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

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

    if(ans_max < temp):
        ans_max = temp

print(ans_max)

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

p_dash = []
for i in range(n):
    p_dash.append((p[i] + 1) / 2)

ans_max = 0
for i in range(k):
    ans_max += p_dash[i]

temp = ans_max
for i in range(k, n):
    temp = temp - p_dash[i - k] + p_dash[i]
    if(temp > ans_max):
        ans_max = temp

print(ans_max)

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

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

    ans.append(temp)

ans.sort(reverse=True)
print(ans[0])

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

p_dash = []
for i in range(n):
    p_dash.append((p[i] + 1) / 2)

ans_max = 0
for i in range(k):
    ans_max += p_dash[i]

temp = ans_max
for i in range(k, n):
    temp = temp - p_dash[i - k] + p_dash[i]
    if(temp > ans_max):
        ans_max = temp

print(ans_max)
Buggy python submission (verdict: Runtime Error):
s = list(input())
t = list(input())

s.sort(reverse=True)
t.sort(reverse=True)

s_len = len(s)
t_len = len(t)

if(s_len < t_len):
    short = s_len
else:
    short = t_len

flag = False
for i in range(short+1):
    if(s[i] < t[i]):
        flag = True

if(s < t or flag):
    print('Yes')
else:
    print('No')

Fixed submission:
import math

a, b = map(int, input().split())

print(math.ceil((a + b) / 2))
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
import math
def binomial(n, k):
    m = min(k,n-k)
    a = 1
    for i in range(m):
        a *= n
        n -=1
    return a//math.factorial(m)

n =  int(input().strip())
nums  = list(map(int, input().strip().split(' ')))
sortedNums = sorted(nums)
candidates = []
for i in nums:
    insert_index  = bisect.bisect_left(sortedNums,int(i/2))
    if(insert_index == n-1):
        candidates.append((i,sortedNums[insert_index-1]))
    elif(i/2 - sortedNums[insert_index] <= sortedNums[insert_index+1] - i/2):
        candidates.append((i,sortedNums[insert_index]))
    else:
        candidates.append((i,sortedNums[insert_index+1]))

minIndex, tmpMax = 0, 0
for index, value in enumerate(candidates):
    b = binomial(value[0],value[1])
    if(tmpMax < b):
        minIndex = index
        tmpMax = b

print(candidates[minIndex][0], candidates[minIndex][1])


Fixed submission:
import bisect
import math
n =  int(input().strip())
nums  = list(map(int, input().strip().split(' ')))
sortedNums = sorted(nums)
x = sortedNums[-1]
insert_index  = bisect.bisect_left(sortedNums,int(x/2))
if insert_index == 0: y = sortedNums[0]
else:
    if x/2 - sortedNums[insert_index-1] > sortedNums[insert_index]-x/2: y = sortedNums[insert_index]
    else: y = sortedNums[insert_index - 1]
if n==2: y=sortedNums[0]
print(x,y)
Buggy python submission (verdict: Runtime Error):
import collections
abc = input().strip()
c = collections.Counter(abc)
if c['a']==1 and c['b' ==1 and c['c' == 1:
    print("Yes")
else:
    print("No")


Fixed submission:
import collections
abc = input().strip()
if len(abc) != 3:
    print("No")
else:
    c = collections.Counter(abc)
    if c['a']==1 and c['b'] ==1 and c['c'] == 1:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
import math

N = int(input().strip())
grid = []
for i in range(N):
  array = list(map(int, input().strip().split(' ')))
  grid.append(array)

for i in grid:
  i.sort()
  print(i)
  a,b = [i[0],i[1]]
  if(a == b or a+1 == b):
    print(2*a-2)
  else:
    c = int(math.sqrt(a*b))
	if c == a*b: c-=1
    if(c*(c+1)>=a*b):
      print(2*c-2)
    else:
      print(2*c-1)


Fixed submission:
import math

N = int(input().strip())
grid = []
for i in range(N):
	array = list(map(int, input().strip().split(' ')))
	grid.append(array)

for i in grid:
	i.sort()
	a,b = [i[0],i[1]]
	if(a == b or a+1 == b):
		print(2*a-2)
	else:
		c = int(math.sqrt(a*b))
		if c**2 == a*b:
			c-=1
		if(c*(c+1)>=a*b):
			print(2*c-2)
		else:
			print(2*c-1)

Buggy python submission (verdict: Runtime Error):
def compute(n1, n2):
    threshold = n1*n2-1
    count = 0
    if n1 == 1:
        index1 = 2
    else:
        index1 = 1
    index2 = threshold
    list1, list2 = [], []
    while index1 < index2:
        index2 = int(threshold/index1)
        while index2 in list2 or index2 == n2:
            index2 -= 1
        count+=1
        index1 += 1
        if index1 == n1:
            index1+=1
            
    while not (index2 == 1 or (n2 == 1 and index2==2)):
        index1 = int(threshold)/index2
        while index1 in list1 or index1 == n1:
            index1 += 1
        count+=1
        index2 -=1
        if index2 == n2:
            index2 -=1
    print(count)
    return

N = int(input().strip())
grid = []
for i in range(N):
    array = list(map(int, input().strip().split(' ')))
    grid.append(array)

for i in grid:
    compute(i[0],i[1])

Fixed submission:
import math

N = int(input().strip())
grid = []
for i in range(N):
	array = list(map(int, input().strip().split(' ')))
	grid.append(array)

for i in grid:
	i.sort()
	a,b = [i[0],i[1]]
	if(a == b or a+1 == b):
		print(2*a-2)
	else:
		c = int(math.sqrt(a*b))
		if c**2 == a*b:
			c-=1
		if(c*(c+1)>=a*b):
			print(2*c-2)
		else:
			print(2*c-1)
Buggy python submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
b = list(map(int, input().split()))
c = []
d = 0
e = []

for i in range(len(b)):
    d = d + b[i]
    c.append(d)

for i in range(len(b) - K):
    e.append(c[i + K] - c[i] + K)

print(max(e)/2)


Fixed submission:
N, K = list(map(int, input().split()))
b = list(map(int, input().split()))
c = []
d = 0
e = []

for i in range(len(b)):
    d = d + b[i]
    c.append(d)

for i in range(len(b) - K):
    e.append(c[i + K] - c[i] + K)
if N==K:
    print((sum(b) + K)/2)
else:    
    print(max(e)/2)

Buggy python submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
b = list(map(int, input().split()))
c = []
d = 0
e = []

for i in range(len(b)):
    d = d + b[i]
    c.append(d)

for i in range(len(b) - K):
    e.append(c[i + K] - c[i] + K)

print(max(e)/2)


Fixed submission:
N, K = list(map(int, input().split()))
b = list(map(int, input().split()))
c = []
d = 0
e = []

for i in range(len(b)):
    d = d + b[i]
    c.append(d)

for i in range(len(b) - K):
    e.append(c[i + K] - c[i] + K)
if N==K:
    print((sum(b) + K)/2)
else:    
    print(max(e)/2)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []

for i in range(n):
    x = [x for x in input()]
    x.sort()
    s.append(''.join(x))

s.sort()
count = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        if s[i] == s[j]:
            count += 1
        else:
            break

print(count)


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

for i in range(n):
    x = [x for x in input()]
    x.sort()
    s.append(''.join(x))

s.sort()
count = 0
i = 0
while True:
    ren = 0
    if i >= n:
        break
    for j in range(i + 1, n):
        if s[i] == s[j]:
            ren += 1
        else:
            break

    if ren != 0:
        for k in range(ren):
            count += k + 1
        i += ren - 1
    i += 1

print(count)

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

for i in range(n):
    x = [x for x in input()]
    x.sort()
    s.append(''.join(x))

count = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        if s[i] == s[j]:
            count += 1

print(count)

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

for i in range(n):
    x = [x for x in input()]
    x.sort()
    s.append(''.join(x))

s.sort()
count = 0
i = 0
while True:
    ren = 0
    if i >= n:
        break
    for j in range(i + 1, n):
        if s[i] == s[j]:
            ren += 1
        else:
            break

    if ren != 0:
        for k in range(ren):
            count += k + 1
        i += ren - 1
    i += 1

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

for i in a:
  c = a.count(i)
  
  if c >=2:
    print("NO")
    exit()
    
print("YES")

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

a.sort()

for i in range(n-1):  
  if a[i] == a[i+1]:
    print("NO")
    exit()

print("YES")

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

for i in a:
  c = a.count(i)
  
  if c >=2:
    print("NO")
    exit()
    
print("YES")

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

a.sort()

for i in range(n-1):  
  if a[i] == a[i+1]:
    print("NO")
    exit()

print("YES")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))
 
cnt = 0
num = P.index(min(P))+1

for i in range(1,num+1):
  M = min(P[:i])
  if M == P[i-1]:
    cnt += 1
    
print(cnt)

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
 
cnt = 0
M = 10**6

for i in range(N):
  if M >= P[i]:
    cnt += 1
    M = P[i]
    
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))
 
cnt = 0
num = min(P)

for i in range(1,N+1):
  M = min(P[:i])
  if M == P[i-1]:
    cnt += 1
  if num == M:
    break
    
cnt_2 = P.count(num)
    
print(cnt+cnt_2-1)

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
 
cnt = 0
M = 10**6

for i in range(N):
  if M >= P[i]:
    cnt += 1
    M = P[i]
    
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))
 
cnt = 0
num = min(P)

for i in range(1,N+1):
  a = P.index(min(P[:i]))
  if i == a+1:
    cnt += 1
  if num == min(P[:i]):
    break
    
cnt_2 = P.count(num)
    
print(cnt+cnt_2-1)

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
 
cnt = 0
M = 10**6

for i in range(N):
  if M >= P[i]:
    cnt += 1
    M = P[i]
    
print(cnt)

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

for i in range(1,N+1):
  a = P.index(min(P[:i]))
  if i == a+1:
    cnt += 1
    
print(cnt)

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
 
cnt = 0
M = 10**6

for i in range(N):
  if M >= P[i]:
    cnt += 1
    M = P[i]
    
print(cnt)

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

cnt = 1
s=0

for i in range(N):
  for j in range(i):
    if P[i] > P[j]:
      break
    
    elif i-1 == j:
      cnt += 1
    
    else:
      continue

print(cnt)

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
 
cnt = 0
M = 10**6

for i in range(N):
  if M >= P[i]:
    cnt += 1
    M = P[i]
    
print(cnt)
Buggy python submission (verdict: Runtime Error):
    s,t = input().split()
    print(t+s)

Fixed submission:
s,t = input().split()
print(t+s)
Buggy python submission (verdict: Runtime Error):
s = list(map(int, input().split()))
c = 0
if s[0] == 1:
  c = c+1
if s[1] == 1:
  c = c+1
if s[2] == 1:
  c = c+1
print(c)

Fixed submission:
s = input()
cnt = 0
if s[0] == "1":
  cnt+=1
if s[1] == "1":
  cnt+=1
if s[2] == "1":
  cnt+=1
  
print(cnt)