Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def main():
    # input
    x = int(input())

    dp = [False for _ in range(x+1)]
    for i in range(6):
        dp[100+i] = True

    # calc
    for i in range(106, x+1):
        for j in range(6):
            if dp[i-100-j]:
                dp[i] = True
                break

    if dp[i]:
        print(1)
    else:
        print(0)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    # input
    x = int(input())

    num = x//100
    a = x%100

    if a <= num*5:
        print(1)
    else:
        print(0)


    # calc


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    # input
    n = int(input())
    s = input()

    ans = 0
    for i in range(0, 1000):
        num = str(i).rjust(3, '0')
        index = 0
        for i in s:
            if index == 3:
                ans += 1
                break
            elif num[index]==i:
                index += 1
        else:
            if index == 3:
                ans += 1

    print(ans)

    # calc


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    # input
    n = int(input())
    s = input()

    ans = 0
    for i in range(0, 1000):
        num = str(i)
        num = '0'*(3-len(num))+num
        index = 0
        for i in s:
            if index == 3:
                ans += 1
                break
            elif num[index]==i:
                index += 1
        else:
            if index == 3:
                ans += 1

    print(ans)

    # calc


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    # input
    n = int(input())
    s = input()

    ans = 0
    for i in range(0, 1000):
        num = str(i).rjust(3, '0')
        index = 0
        for i in s:
            if index == 3:
                ans += 1
                break
            elif num[index]==i:
                index += 1
        else:
            if index == 3:
                ans += 1

    print(ans)

    # calc


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    # input
    n = int(input())
    s = input()

    ans = 0
    for i in range(0, 1000):
        num = str(i)
        num = '0'*(3-len(num))+num
        index = 0
        for i in s:
            if index == 3:
                ans += 1
                break
            elif num[index]==i:
                index += 1
        else:
            if index == 3:
                ans += 1

    print(ans)

    # calc


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    # input
    t1, t2 = map(int, input().split())
    a1, a2 = map(int, input().split())
    b1, b2 = map(int, input().split())

    x = (a1-b1)*t1
    y = (a2-b2)*t2
    diff = x+y

    print(x)
    print(y)
    print(diff)

    if x == -y:
        print("infinity")
        return
    elif x*y > 0:
        print(0)
        return

    if diff > 0: # aが先行
        if x<0:
            x = abs(x)
            ans = x//diff
        else:
            y = abs(y)
            ans = y//diff

    else: # bが先行
        diff = ans(diff)
        if x>0:
            ans = x//diff
        else:
            ans = y//diff

    print(ans*2+1)

    # calc


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    # input
    import math
    t1, t2 = map(int, input().split())
    a1, a2 = map(int, input().split())
    b1, b2 = map(int, input().split())

    x = (a1-b1)*t1
    y = (a2-b2)*t2
    diff = x+y

    if x == -y:
        print("infinity")
        return
    elif x*y>0 or abs(x)>abs(y):
        print(0)
        return

    x = abs(x)
    diff = abs(diff)
    ans = x//diff
    remainder = x%diff
    if remainder==0:
        print(ans*2)
    else:
        print(ans*2+1)

    # calc

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input()))
ans = 0
for i in h:
  if i>k:
    ans += 1
print(ans)

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
ans = 0
for i in h:
  if i>=k:
    ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    n_list = [i+1 for i in range(n-1)]
    ans = sum(n_list)
    print(ans)

main()


Fixed submission:
def main():
    n = int(input())
    ans = ( n * (n-1) )// 2
    print(ans)
main()
Buggy python submission (verdict: Runtime Error):
def main():
    a = list(map(int, input().split()))
    print(max(a[2] - (a[0] - a[1], 0))

main()


Fixed submission:
def main():
    a = list(map(int, input().split()))
    print(max(a[2] - (a[0] - a[1]), 0))
main()
Buggy python submission (verdict: Runtime Error):
def func(len_a):
    ans = ""
    for i in range(1, len_a):
        if i & 1 == 0:
            ans += "0"
        elif i & 1 == 1:
            ans += "9"
    return ans

def main():
    a = input()
    len_a = len(a)
    if len_a & 1 == 0:
        ans = func(len_a)
        print(ans)
    else:
        ans = int(func(len_a-1))
        ans = ans + ( int(a) - 10 ** (len_a-1) ) + 1
        print(ans)


main()


Fixed submission:
def func(len_a):
    ans = ""
    for i in range(1, len_a):
        if i & 1 == 0:
            ans += "0"
        elif i & 1 == 1:
            ans += "9"
    return ans

def main():
    a = input()
    len_a = len(a)
    if len_a & 1 == 0:
        ans = func(len_a)
        print(ans)
    else:
        if len_a == 1:
            print(a)
        else:
            ans = int(func(len_a-1))
            ans = ans + ( int(a) - 10 ** (len_a-1) ) + 1
            print(ans)


main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    h_list = list(map(int, input().split()))
    for i in range(N-1):
        if h_list[i]-1 > min(h_list[i+1:]):
            print("No")
            return
    print("Yes")


main()


Fixed submission:
def main():
    N = int(input())
    h_list = list(map(int, input().split()))
    h_sort = sorted(h_list)
    for i in range(N-1):
        if h_list[i]-1 > h_sort[i]:
            print("No")
            return
    print("Yes")


main()
Buggy python submission (verdict: Runtime Error):
r, D, x = map(int, input().split())
 
for i in range(10):
    x = r * x - D
    print(x)

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

if A < 6:
    print(0)
elif 6 <= A <13:
    print(B//2)
else:
    print(B)

Buggy python submission (verdict: Runtime Error):
r, D, x = map(int, input().split())

for i in range(10):
    x = r * x - D
    print(x)

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

if A < 6:
    print(0)
elif 6 <= A <13:
    print(B//2)
else:
    print(B)
Buggy python submission (verdict: Runtime Error):
def main():
    n, k = map(int, input().split())
    h = tuple(map(int, input().split()))

    if k >= n:
        print(abs(h[-1]-h[0]))

    dp = [0]*(n)

    for i in range(1, n):
        temp = 10**10
        for j in range(1, min(i, k)+1):
            temp = min(temp, dp[i-j]+abs(h[i]-h[i-j]))
        dp[i] = temp

    print(dp[-1])

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n = int(input())
    h = [int(i) for i in input().split()]
    cost = [0 for _ in range(n)]
    cost[0] = 0
    cost[1] = abs(h[1] - h[0])
    for i in range(2, n):
        cost[i] = min(cost[i-1]+abs(h[i] - h[i-1]), cost[i-2]+abs(h[i] - h[i-2]))
    print(cost[-1])
main()
Buggy python submission (verdict: Runtime Error):
import numpy as np
def main():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    h = np.array(h)
    cost = np.empty(n)
    cost[0] = 0
    cost[1] = abs(h[1] - h[0])
    for i in range(2, n):
        j = min(i, k)
        cost[i] = np.min(cost[i-j:i-1] + np.abs(h[i-j:i-1] - h[i]))
    print(int(cost[-1]))
main()


Fixed submission:
def main():
    n, k = map(int, input().split())
    h = tuple(map(int, input().split()))
    cost = [0 for _ in range(n)]
    cost[0] = 0
    cost[1] = abs(h[1] - h[0])
    for i in range(2, n):
        cost[i] = min((cost[i-1-j] + abs(h[i]-h[i-1-j]) for j in range(min(i, k))))
    print(cost[-1])
main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, k = map(int, input().split())
    h = tuple(map(int, input().split()))
    cost = [0 for _ in range(n)]
    cost[0] = 0
    cost[1] = abs(h[1] - h[0])
    for i in range(2, n):
        cost[i] = min((cost[i-1-j] + abs(h[i]-h[i-1-j]) for j in range(min(i, k))))
    print(cost[-1])
main()


Fixed submission:
def main():
    n, k = map(int, input().split())
    h = tuple(map(int, input().split()))
    cost = [0 for _ in range(n)]
    cost[0] = 0
    cost[1] = abs(h[1] - h[0])
    for i in range(2, n):
        cost[i] = min((cost[i-1-j] + abs(h[i]-h[i-1-j]) for j in range(min(i, k))))
    print(cost[-1])
main()
Buggy python submission (verdict: Time Limit Exceeded):
# import copy
import sys
import numpy as np
imput = sys.stdin.readline
def main():
    N, W = map(int, input().split())
    dp = np.zeros((N+1, W+1))
    for i in range(1, N+1):
        w, v = map(int, input().split())
        for j in range(1, W+1):
            if j<w:
                dp[i, j] = dp[i-1, j]
            else:
                dp[i, j] = max(dp[i-1, j], dp[i-1, j-w]+v)
    # print(dp)
    print(int(dp[i, j]))


if __name__ == '__main__':
    main()


Fixed submission:
import sys
imput = sys.stdin.readline
def main():
    N, W = map(int, input().split())
    dp = [[0]*(W+1) for _ in range(N+2)]
    for i in range(1, N+1):
        w, v = map(int, input().split())
        for j in range(1, W+1):
            if j<w:
                dp[i][j] = dp[i-1][j]
            else:
                dp[i][j] = max(dp[i-1][j], dp[i-1][j-w]+v)
    print(int(dp[i][j]))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    li = [int(i) for i in input()]
    t = li[1:]
    op = ["+", "+", "+"]
    t_sum = sum(t)
    if t_sum == 7:
        print("{}+{}+{}+{}=7".format(t[0], t[1], t[2], t[3]))
    else:
        for i in range(3):
            if t_sum - 2*t[i] == 7:
                op[i] = "-"
                print("{}{}{}{}{}{}{}=7".format(li[0], op[0], li[1], op[1], li[2], op[2], li[3]))
                return
            elif t_sum - 2*t[i] > 7:
                for j in range(1, 3):
                    if t_sum - (t[i] + t[i-j])*2 == 7:
                        op[i] = "-"
                        op[i-j] = "-"
                        print("{}{}{}{}{}{}{}=7".format(li[0], op[0], li[1], op[1], li[2], op[2], li[3]))
                        return

main()



Fixed submission:
def main():
    li = [int(i) for i in input()]
    t = li[1:]
    op = ["+", "+", "+"]
    t_sum = sum(li)
    if t_sum == 7:
        print("{}+{}+{}+{}=7".format(li[0], li[1], li[2], li[3]))
    else:
        for i in range(3):
            if t_sum - 2*t[i] == 7:
                op[i] = "-"
                print("{}{}{}{}{}{}{}=7".format(li[0], op[0], li[1], op[1], li[2], op[2], li[3]))
                return
            elif t_sum - 2*t[i] > 7:
                for j in range(1, 3):
                    if t_sum - (t[i] + t[i-j])*2 == 7:
                        op[i] = "-"
                        op[i-j] = "-"
                        print("{}{}{}{}{}{}{}=7".format(li[0], op[0], li[1], op[1], li[2], op[2], li[3]))
                        return

main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    k, s = map(int, input().split())
    if s > 3*k:
        pass
    elif s == 3*k:
        ans = 1
    else:
        ans = 0
        for i in range(k+1):
            for j in range(k+1):
                for l in range(k+1):
                    if i + j + l == s:
                        ans += 1
    print(ans)
main()


Fixed submission:
def main():
    k, s = map(int, input().split())
    if s > 3*k:
        pass
    elif s == 3*k:
        ans = 1
    else:
        ans = 0
        for i in range(k+1):
            for j in range(k+1):
                    if 0<=s - (i + j)<=k:
                        ans += 1
    print(ans)
main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
#input = sys.stdin.buffer.readline

def inn(func=int):
    return list(map(func,input().split()))

def ins():
    return input().split()

a0 = inn()
a1 = inn()
a2 = inn()
a = a0+a1+a2
n = int(input())
ban = [0,0,0,0,0,0,0,0,0]
for i in range(n):
    b = int(input())
    for j in range(9):
        if b == a[j]:
            ban[j] = 1

for i in [0,3,6]:
    tate = ban[i]+ban[i+3]+ban[i+6]
    yoko = ban[i]+ban[i+1]+ban[i+2]
    if tate == 3 or yoko == 3:
        print("Yes")
        exit()
if (ban[0]+ban[4]+ban[8]) == 3 or (ban[2]+ban[4]+ban[6]) == 3:
    print("Yes")
    exit()
print("No")

Fixed submission:
#!/usr/bin/env python3
import sys
#input = sys.stdin.buffer.readline

def inn(func=int):
    return list(map(func,input().split()))

def ins():
    return input().split()

a0 = inn()
a1 = inn()
a2 = inn()
a = a0+a1+a2
n = int(input())
ban = [0,0,0,0,0,0,0,0,0]
for i in range(n):
    b = int(input())
    for j in range(9):
        if b == a[j]:
            ban[j] = 1


for i in [0,1,2]:
    t = ban[i]+ban[i+3]+ban[i+6]
    if t == 3:
        print("Yes")
        exit()
for i in [0,3,6]:
    t = ban[i]+ban[i+1]+ban[i+2]
    if t == 3:
        print("Yes")
        exit()
if (ban[0]+ban[4]+ban[8]) == 3 or (ban[2]+ban[4]+ban[6]) == 3:
    print("Yes")
    exit()
print("No")
Buggy python submission (verdict: Runtime Error):
arr = [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(arr[k])

Fixed submission:
arr = [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(arr[k-1])
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
s = 'b'*a + 'r'*b
s_len = len(s)
ret = 0
ret = n // s_len * a
if n % s_len < a:
  ret += n% s_len
else:
  ret += a
print(ret)

Fixed submission:
n, a, b = map(int, input().split())
s_len = a+b
ret = 0
ret = n // s_len * a
if n % s_len < a:
  ret += n% s_len
else:
  ret += a
print(ret)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
rev = 0
for i in range(q):
  tmp = input().split()
  if len(tmp) == 1:
    rev += 1
  else:
    if tmp[1] == '1':
      if rev % 2 == 0:
        s = tmp[2] + s
      else:
        s = s + tmp[2]
    else:
      if rev % 2 == 0:
        s = s + tmp[2]
      else:
        s = tmp[2] + s
if rev % 2:
  print(s[::-1])
else:
  print(s)

Fixed submission:
import collections

s = collections.deque(input())
q = int(input())
rev = 0
for i in range(q):
  tmp = input().split()
  if len(tmp) == 1:
    rev += 1
  else:
    if tmp[1] == '1':
      if rev % 2 == 0:
        s.appendleft(tmp[2])
      else:
        s.append(tmp[2])
    else:
      if rev % 2 == 0:
        s.append(tmp[2])
      else:
        s.appendleft(tmp[2])
if rev % 2:
  while True:
    try:
      print(s.pop(), end='')
    except IndexError:
      break
else:
  while True:
    try:
      print(s.popleft(), end='')
    except IndexError:
      break
Buggy python submission (verdict: Runtime Error):
n = (int)(input)
print((n-1)*n)//2

Fixed submission:
n = (int)(input())
print((n-1)*n//2)
Buggy python submission (verdict: Time Limit Exceeded):
H = int(input())
i = 1
result = 0

while True:
    H //= 2
    result += 2**i
    i += 1
    if H == 1:
        break
 
print(result+1)

Fixed submission:
H = int(input())
i = 0
result = 0
 
while True:
    result += 2**i
    H //= 2
    i += 1
    if H == 0:
        break
 
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
H = int(input())
i = 1
result = 0

while True:
    H //= 2
    result += 2**i
    i += 1
    if H == 1:
        break

print(result+1)

Fixed submission:
H = int(input())
i = 0
result = 0
 
while True:
    result += 2**i
    H //= 2
    i += 1
    if H == 0:
        break
 
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
H = int(input())
i = 0

while True:
    H //= 2
    i += 1
    if H == 1:
        break

result = 0
for i in range(i+1):
    result += 2**i

print(result)

Fixed submission:
H = int(input())
i = 0
result = 0
 
while True:
    result += 2**i
    H //= 2
    i += 1
    if H == 0:
        break
 
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
H = int(input())
i = 0

while True:
    H //= 2
    i += 1
    if H == 1:
        break

suretu = [None] * (i + 1)

for i in range(i+1):
    suretu[i] = 2**i

result = sum(suretu)
print(result)

Fixed submission:
H = int(input())
i = 0
result = 0
 
while True:
    result += 2**i
    H //= 2
    i += 1
    if H == 0:
        break
 
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
array = list(map(int, input().split()))
cnt = 0

for i in range(0, N):
    array2 = list(array[0:i+1])
    array2.sort()
    if array2[0] == array[i]:
        cnt += 1
print(cnt)

Fixed submission:
N = int(input())
array = list(map(int, input().split()))
cnt = 1
minv = array[0]

for i in range(1, N):
    if minv > array[i]:
        minv = array[i]
        cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
from functools import lru_cache
@lru_cache(maxsize = None)

N = int(input())
array = list(map(int, input().split()))
cnt = 0

for i in range(0, N):
    for j in range(0, i):
        if array[i] > array[j]:
            break
    else:
        cnt += 1
print(cnt)

Fixed submission:
N = int(input())
array = list(map(int, input().split()))
cnt = 1
minv = array[0]

for i in range(1, N):
    if minv > array[i]:
        minv = array[i]
        cnt += 1
print(cnt)

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

for i in range(0, N):
    flag = 0
    for j in range(0, i):
        if array[i] > array[j]:
            break
    else:
        cnt += 1
print(cnt)

Fixed submission:
N = int(input())
array = list(map(int, input().split()))
cnt = 1
minv = array[0]

for i in range(1, N):
    if minv > array[i]:
        minv = array[i]
        cnt += 1
print(cnt)

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

for i in range(0, N):
    flag = 0
    for j in range(0, i):
        if array[i] > array[j]:
            flag = 1
            break
    if not flag == 1:
        cnt += 1
print(cnt)


Fixed submission:
N = int(input())
array = list(map(int, input().split()))
cnt = 1
minv = array[0]

for i in range(1, N):
    if minv > array[i]:
        minv = array[i]
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
K, X = map(int, input().split())

total = 500 * K

if total >= X:
    print("Yes")
else:
    prnt("No")

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

total = 500 * K

if total >= X:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
X = int(input())

while True:
    
    flag = 0
    
    for i in range(2, X+1): #2からXまでのループ
        if (X+1) % i == 0: #対象はX+1という数
            flag = 1
            break
    if flag == 1:
        X += 1
        continue
    break
    
print(X + 1)
 

Fixed submission:
S, T = input().split()
print(T + S)

Buggy python submission (verdict: Runtime Error):
S, T = input()
print(T + S)

Fixed submission:
S, T = input().split()
print(T + S)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int, input().split())

count = 0

while count < K:
    if A > 0:
        A -= 1
        count += 1
        continue
        
    elif B > 0:
        B -= 1
        count += 1
        continue
        
    else:
        count += 1
        continue
print(A, B)

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

if A > K:
    print(A-K, B)
if A <= K < A + B:
    print(0, A+B-K)
if A + B <= K:
    print(0, 0)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int, input().split())

count = 0

while count < K:
    if A > 0:
        A -= 1
        count += 1
        continue
        
    if B > 0:
        B -= 1
        count += 1
        continue
        
    if A == 0 and B == 0:
        count += 1
        continue
print(A, B)

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

if A > K:
    print(A-K, B)
if A <= K < A + B:
    print(0, A+B-K)
if A + B <= K:
    print(0, 0)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
who_answered = [None]*Q
participants = [K]*N

for i in range(Q):
    who_answered[i] = int(input()) - 1
    participants[who_answered[i]] += 1
    for j in range(N):
        participants[j] -= 1

for i in range(N):
    if participants[i] > 0:
        print('Yes')
    else:
        print('No')

Fixed submission:
N, K, Q = map(int, input().split())
who_answered = [None]*Q
participants = [K-Q]*N

for i in range(Q):
    who_answered[i] = int(input()) - 1
    participants[who_answered[i]] += 1

for i in range(N):
    if participants[i] > 0:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
who_answered = [None]*Q
participants = [K]*N

for i in range(Q):
    who_answered[i] = int(input()) - 1
    
for who in who_answered:
    for i in range(N):
        participants[i] -= 1
    participants[who] += 1

for i in range(N):
    if participants[i] > 0:
        print('Yes')
    else:
        print('No')

Fixed submission:
N, K, Q = map(int, input().split())
who_answered = [None]*Q
participants = [K-Q]*N

for i in range(Q):
    who_answered[i] = int(input()) - 1
    participants[who_answered[i]] += 1

for i in range(N):
    if participants[i] > 0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
masu = list(map(int, input().split()))
masu2 = [None] * N
cnt_max = 0
for i in range(N):
    cnt = 0
    for j in range(i, N-1):
        if masu[j] < masu[j+1]:
            break
        cnt += 1
    masu2[i] = cnt
print(max(masu2))

Fixed submission:
N = int(input())
masu = list(map(int, input().split()))
cnt = 0
masu2 = []
for i in range(N-1):
    if masu[i] < masu[i+1]:
        masu2.append(cnt)
        cnt = 0
    else:
      cnt += 1
else:
  masu2.append(cnt)
print(max(masu2))

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

cnt_max = 0
for i in range(N):
    cnt = 0
    for j in range(i, N-1):
        if masu[j] < masu[j+1]:
            break
        cnt += 1
    if cnt_max < cnt:
        cnt_max = cnt
        
print(cnt_max)

Fixed submission:
N = int(input())
masu = list(map(int, input().split()))
cnt = 0
masu2 = []
for i in range(N-1):
    if masu[i] < masu[i+1]:
        masu2.append(cnt)
        cnt = 0
    else:
      cnt += 1
else:
  masu2.append(cnt)
print(max(masu2))
Buggy python submission (verdict: Runtime Error):
N = int(input())
job = [list(map(int, input().split())) for i in range(N)]

job.sort(key = lambda x: x[1]

time = 0
flag = 0
for i in range(N):
    time += job[i][0]
    if time > job[i][1]:
        flag = 1 
    
if flag == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
from operator import itemgetter

N = int(input())
job = [list(map(int, input().split())) for i in range(N)]

job.sort(key = itemgetter(1))

time = 0
flag = 0
for i in range(N):
    time += job[i][0]
    if time > job[i][1]:
        flag = 1    
    
if flag == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
from operatpr import itemgetter

N = int(input())
job = [list(map(int, input().split())) for i in range(N)]

job.sort(key = itemgetter(1))

time = 0
flag = 0
for i in range(N):
    time += job[i][0]
    if time > job[i][1]:
        flag = 1
    print(flag)    
    
if flag == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
from operator import itemgetter

N = int(input())
job = [list(map(int, input().split())) for i in range(N)]

job.sort(key = itemgetter(1))

time = 0
flag = 0
for i in range(N):
    time += job[i][0]
    if time > job[i][1]:
        flag = 1    
    
if flag == 0:
    print('Yes')
else:
    print('No')