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

ans = 1
for i in range(1, N):
    m = min(P[0:i])
    if P[i] > m:
        continue
    ans += 1

print(ans)

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

ans = 1
m = P[0]
for i in range(1, N):
    m = min(m, P[i])
    if m == P[i]:
        ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))

ma = max(A)
for i in range(N):
    if A[i] == ma:
        A[i] = 0
        print(max(A))
        A[i] = ma
    else:
        print(ma)

Fixed submission:
N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))

newA = sorted(A)
ma = newA[N-1]
for i in range(N):
    if A[i] == ma:
        print(newA[N-2])
    else:
        print(ma)
Buggy python submission (verdict: Runtime Error):
import math
a,b,x = map(int,input().split())
if(x/(a*a)>b/2):
    print(90 - (math.atan(a/(2*(b -(x/(a*a)))))*180/math.pi))
elif x/(a*a) == b/2:
    print(0)
    
else:
     print(90 - ((math.atan(x/(a*b)/b)*180/math.pi)))

Fixed submission:
import math
a,b,x = map(int,input().split())
if x/(a*a) == b:
    print(0)
elif(x/(a*a)>=b/2):
    print(90 - (math.atan(a/(2*(b -(x/(a*a)))))*180/math.pi))    
else:
     print(90 - ((math.atan(2*x/(a*b*b))*180/math.pi)))

Buggy python submission (verdict: Runtime Error):
import math
a,b,x = map(int,input().split())
if(x/(a*a)>=b/2):
    print(90 - (math.atan(a/(2*(b -(x/(a*a)))))*180/math.pi))
else:
     print(90 - ((math.atan(x/(a*b)/b)*180/math.pi)))

Fixed submission:
import math
a,b,x = map(int,input().split())
if x/(a*a) == b:
    print(0)
elif(x/(a*a)>=b/2):
    print(90 - (math.atan(a/(2*(b -(x/(a*a)))))*180/math.pi))    
else:
     print(90 - ((math.atan(2*x/(a*b*b))*180/math.pi)))
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,n = tuple(int(x) for x in raw_input().split(' '))

ans = 0
for i in xrange(0, n/a+1):
  for j in xrange(0, n/b+1):
    k = (n - i*a - j*b)/c
    #print i,j,k,i*a+j*b+k*c
    if i*a+j*b+k*c == n and k >= 0:
      ans += 1
print ans

Fixed submission:
a,b,c,n = tuple(int(x) for x in raw_input().split(' '))

ans = 0
for i in xrange(0, n/a+1):
  for j in xrange(0, n/b+1):
    k = (n - i*a - j*b)/c
    #print i,j,k,i*a+j*b+k*c
    if i*a+j*b+k*c == n and k >= 0:
      ans += 1
print ans
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int , input().split())
sum = 0
a = list(map(int , input().split()))
tmp = 1
for i in range(0,k):
    tmp *= a[i]
for i in range(k,n):
    # print(tmp)
    if tmp*a[i]/a[i-k] > tmp:
        print("Yes")
    else:
        print("No")
    tmp = tmp*a[i]/a[i-k]

Fixed submission:
n,k = map(int , input().split())
sum = 0
a = list(map(int , input().split()))
for i in range(k,n):
    if a[i] > a[i-k]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
ans=1

for i in A:
    ans=ans*i
if ans>1000000000000000000:
    print(-1)
    exit()

print(ans)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
A=sorted(A)
ans=1

for i in range(N):
    ans=ans*A[i]
    if ans>10**18:
        print(-1)
        exit()
print(ans)

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

for i in A:
    ans=ans*i
if ans>1000000000000000000:
    print(-1)
    exit()

print(ans)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
A=sorted(A)
ans=1

for i in range(N):
    ans=ans*A[i]
    if ans>10**18:
        print(-1)
        exit()
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
x = list(map(int, input().split()))
count=0

for i in range(N):
    if x[i]==1:
        count=count+1
        break
    elif x[i]==min(x[0:i+1]):
        count=count+1
print(count)


Fixed submission:
N = int(input())
x = list(map(int, input().split()))
count=0
min=2000000
for i in range(N):
    if min>=x[i]:
        count=count+1
        min=x[i]
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N =int(input())
x = list(map(int, input().split()))
count=0
for i in range(N):
    if x[i]==min(x[0:i+1]):
        count=count+1
print(count)

Fixed submission:
N = int(input())
x = list(map(int, input().split()))
count=0
min=2000000
for i in range(N):
    if min>=x[i]:
        count=count+1
        min=x[i]
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
mylist=[]

for i in range(1,n+1):
    mylist.append(str(a.index(i)+1))
print(' '.join(mylist))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
for i in range(n):
    b[a[i]-1]=i+1
print(*b)
Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = map(int, input().split())
count=0

for i in range(N//R+1):
    for j in range(N//G+1):
        if (N-(R*i+G*j))>=0 and (N-(R*i+G*j))%B==0:
            count=count+1
print(count)

Fixed submission:
R,G,B,N = map(int, input().split())
count=0

for i in range(N//R+1):
    for j in range(N//G+1):
        if (N-(R*i+G*j))<0:
            break
        if (N-(R*i+G*j))%B==0:
            count=count+1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
count = 0
for x in range(K+1):
    for y in range(K+1):
            for z in range(K+1):
                if x+y+z==S:
                    count=count+1
                else:
                    pass
print(count)

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

count=0
for x in range(K+1):
    for y in range(K+1):
        if 0<=S-x-y<=K:
            count=count+1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = map(int, input().split())
d=0

for num in range(a,b+1):
    if num%x==0:
        d=d+1
    else:
        pass
print(d)

Fixed submission:
a, b, x = map(int, input().split())
d=b//x-a//x
if a%x==0:
    d=d+1
    print(d)
else:
    print(d)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from io import StringIO
import unittest


def resolve():
    # s = input()
    n = int(input())
    a = list(map(int, input().split()))
    # l = [list(map(int, input().split())) for _ in range(n)]

    thr = 10 ** 18
    ans = 1

    for a_i in a:
        ans *= a_i

    if ans > thr:
        ans = -1

    print(ans)


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2
1000000000 1000000000"""
        output = """1000000000000000000"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """3
101 9901 999999000001"""
        output = """-1"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """31
4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0"""
        output = """0"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()


Fixed submission:
import sys
from io import StringIO
import unittest
# import numpy as np

def resolve():
    # s = input()
    n = int(input())
    a = list(map(int, input().split()))
    # l = [list(map(int, input().split())) for _ in range(n)]

    thr = 10 ** 18
    a.sort(reverse=True)
    ans = 1

    if 0 in a:
        ans = 0
    else:
        for a_i in a:
            ans *= a_i

            if ans > thr:
                ans = -1
                break

    print(ans)


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2
1000000000 1000000000"""
        output = """1000000000000000000"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """3
101 9901 999999000001"""
        output = """-1"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """31
4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0"""
        output = """0"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from io import StringIO
import unittest


def resolve():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))

    loop_list = []
    now = 0

    if k > n:
        while 1:
            now = a[now] - 1

            if now + 1 in loop_list:
                s_index = loop_list.index(now + 1)
                before_loop = s_index
                loop_list = loop_list[s_index:]
                break
            else:
                loop_list.append(now + 1)

        l = len(loop_list)
        k -= before_loop

        # print(loop_list, l, before_loop)
        print(loop_list[k % l - 1])
    else:
        for _ in range(k):
            now = a[now] - 1

        print(now + 1)


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4 5
3 2 4 1"""
        output = """4"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """6 727202214173249351
6 5 2 5 3 2"""
        output = """2"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()


Fixed submission:
import sys
from io import StringIO
import unittest


def resolve():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))

    loop_list = []
    loop_set = set()
    now = 0

    if k > n:
        for _ in range(k):
            now = a[now] - 1

            if now + 1 in loop_set:
                s_index = loop_list.index(now + 1)
                before_loop = s_index
                loop_list = loop_list[s_index:]
                break
            else:
                loop_list.append(now + 1)
                loop_set.add(now + 1)

        l = len(loop_list)
        k -= before_loop

        # print(loop_list, l, before_loop)
        print(loop_list[k % l - 1])
    else:
        for _ in range(k):
            now = a[now] - 1

        print(now + 1)


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4 5
3 2 4 1"""
        output = """4"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """6 727202214173249351
6 5 2 5 3 2"""
        output = """2"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()
Buggy python submission (verdict: Runtime Error):
import numpy as np
import math

def main():
    a, b = map(int, input().split())

    # print(a/0.08)

    a_ans = np.array([i for i in range(math.ceil(a/0.08), int((a+1)/0.08))])
    b_ans = np.array([j for j in range(math.ceil(b/0.1), int((b+1)/0.1))])

    # print(a_ans)
    # print(b_ans)
    #
    # print(a_ans * 0.08)
    # print(b_ans * 0.1)

    ans = set(a_ans) & set(b_ans)

    # print(ans)

    if ans == set():
        print(-1)
    else:
        print(min(ans))

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    s = input()
    if s == 'AAA' or s== 'BBB':
        print('No')
    else:
        print('Yes')

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, a, b = map(int, input().split())

    leng = 0
    ans = 0

    while n >= leng:
        if a < (n - leng):
            ans += a
            leng += (a + b)
        else:
            ans += n - leng
            leng += (a + b)

    print(ans)



    # if a >= n:
    #     print(n)
    # else:
    #     print(a)


if __name__ == '__main__':
    main()

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

    tmp = n // (a + b)

    if n - tmp * (a + b) > a:
        print(tmp * a + a)
    else:
        print(tmp * a + n - tmp * (a + b))

    # TLE
    # while n >= leng:
    #     if a < (n - leng):
    #         ans += a
    #         leng += (a + b)
    #     else:
    #         ans += n - leng
    #         leng += (a + b)

    # if a >= n:
    #     print(n)
    # else:
    #     print(a)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    s = input()
    q = int(input())

    for _ in range(q):
        tmp = input()
        if len(tmp) == 1:
            s = s[::-1]
        else:
            if tmp[2] == '1':
                s = tmp[4] + s
            else:
                s = s + tmp[4]
    print(s)

if __name__ == '__main__':
    main()

Fixed submission:
import numpy as np
import math

def main():
    a, b = map(int, input().split())

    # print(a/0.08)

    a_ans = np.array([i for i in range(math.ceil(a/0.08), int((a+1)/0.08))])
    b_ans = np.array([j for j in range(math.ceil(b/0.1), int((b+1)/0.1))])

    # print(a_ans)
    # print(b_ans)
    #
    # print(a_ans * 0.08)
    # print(b_ans * 0.1)

    ans = set(a_ans) & set(b_ans)

    # print(ans)

    if ans == set():
        print(-1)
    else:
        print(min(ans))

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
import numpy as np
import math

def main():
    a, b = map(int, input().split())

    # print(a/0.08)

    a_ans = np.array([i for i in range(math.ceil(a/0.08), int((a+1)/0.08))])
    b_ans = np.array([j for j in range(math.ceil(b/0.1), int((b+1)/0.1))])

    # print(a_ans)
    # print(b_ans)
    #
    # print(a_ans * 0.08)
    # print(b_ans * 0.1)

    ans = set(a_ans) & set(b_ans)

    # print(ans)

    if ans == set():
        print(-1)
    else:
        print(min(ans))

if __name__ == '__main__':
    main()

Fixed submission:
import numpy as np
import math

def main():
    a, b = map(int, input().split())

    # print(a/0.08)

    a_ans = np.array([i for i in range(math.ceil(a/0.08), int((a+1)/0.08))])
    b_ans = np.array([j for j in range(math.ceil(b/0.1), int((b+1)/0.1))])

    # print(a_ans)
    # print(b_ans)
    #
    # print(a_ans * 0.08)
    # print(b_ans * 0.1)

    ans = set(a_ans) & set(b_ans)

    # print(ans)

    if ans == set():
        print(-1)
    else:
        print(min(ans))

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

N = int(input())

S = [input() for _ in range(N)]

dic = Counter(S)

ans = [key for key, value in dic.items() if value == max(dic.values())]

for key in sorted(ans):
    print(key, end="")
    print("")


Fixed submission:
from collections import Counter

N = int(input())
S = [input() for _ in range(N)]

dic = Counter(S)

tmp = max(dic.values())
ans = [key for key, value in dic.items() if value == tmp]

# もうちょいかっこいい書き方があるはず。リストを1行1str出力 and 最後に改行しないように
for key in sorted(ans):
    print(key, end="")
    print("")

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

str_list = []
for n in range(n):
    str_list.append(input())

cnt_dict = {_ : str_list.count(_) for _ in set(str_list)}

tmp = max(cnt_dict.values())
for ans in sorted([l[0] for l in cnt_dict.items() if l[1] == tmp]):
    print(ans)


Fixed submission:
from collections import Counter

N = int(input())
S = [input() for _ in range(N)]

dic = Counter(S)

tmp = max(dic.values())
ans = [key for key, value in dic.items() if value == tmp]

# もうちょいかっこいい書き方があるはず。リストを1行1str出力 and 最後に改行しないように
for key in sorted(ans):
    print(key, end="")
    print("")

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

str_list = []
for n in range(n):
    str_list.append(input())

cnt_dict = {_ : str_list.count(_) for _ in set(str_list)}


for ans in sorted([l[0] for l in cnt_dict.items() if l[1] == max(cnt_dict.values())]):
	print(ans)


Fixed submission:
from collections import Counter

N = int(input())
S = [input() for _ in range(N)]

dic = Counter(S)

tmp = max(dic.values())
ans = [key for key, value in dic.items() if value == tmp]

# もうちょいかっこいい書き方があるはず。リストを1行1str出力 and 最後に改行しないように
for key in sorted(ans):
    print(key, end="")
    print("")
Buggy python submission (verdict: Runtime Error):
import numpy as np

N, K = map(int, input().split())
p = (np.array(list((map(int, input().split())))) + 1) / 2

ans = 0

for num in range(len(p)):
    tmp = p[num:num+K].sum()
    if ans < tmp:
        ans = tmp

print(float(ans))

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

if U == S:
    A -= 1
elif U == T:
    B -= 1

print(A, end=" ")
print(B)
Buggy python submission (verdict: Time Limit Exceeded):
# numpy使うときは、PyPyは不可
import numpy as np

N, K = map(int, input().split())
P = (np.array(list((map(int, input().split())))) + 1)

ans = 0

for num in range(len(P)):
    tmp = P[num:num+K].sum()
    if ans < tmp:
        ans = tmp

print(float(ans/2))



# 回答
# Pcum = np.zeros(N + 1, np.int32)
# Pcum[1:] = P.cumsum()
#
# length_K_sums = Pcum[K:] - Pcum[0:-K]
# print(length_K_sums.max() / 2)

Fixed submission:
# numpy使うときは、PyPyは不可
import numpy as np

N, K = map(int, input().split())
P = (np.array(list((map(int, input().split())))) + 1)

"""
ans = 0

for num in range(len(p)):
    tmp = p[num:num+K].sum()
    if ans < tmp:
        ans = tmp

print(float(ans))

"""

# 回答
Pcum = np.zeros(N + 1, np.int32)
Pcum[1:] = P.cumsum()

length_K_sums = Pcum[K:] - Pcum[0:-K]
print(length_K_sums.max() / 2)

Buggy python submission (verdict: Runtime Error):
import numpy as np

N, K = map(int, input().split())
p = (np.array(list((map(int, input().split())))) + 1) / 2

ans = 0

for num in range(len(p)):
    tmp = p[num:num+K].sum()
    if ans < tmp:
        ans = tmp

print(ans)

Fixed submission:
# numpy使うときは、PyPyは不可
import numpy as np

N, K = map(int, input().split())
P = (np.array(list((map(int, input().split())))) + 1)

"""
ans = 0

for num in range(len(p)):
    tmp = p[num:num+K].sum()
    if ans < tmp:
        ans = tmp

print(float(ans))

"""

# 回答
Pcum = np.zeros(N + 1, np.int32)
Pcum[1:] = P.cumsum()

length_K_sums = Pcum[K:] - Pcum[0:-K]
print(length_K_sums.max() / 2)
Buggy python submission (verdict: Runtime Error):


H, N = map(int, input().split())
total_A = sum(list(map(int, input.split())))

if H <= total_A:
    print('Yes')
else:
    print('No')


Fixed submission:


H, N = map(int, input().split())
total_A = sum(list(map(int, input().split())))

if H <= total_A:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
H, N = map(int, input().split())
total_A = sum(map(int, input.split()))

if H <= total_A:
    print('Yes')
else:
    print('No')


Fixed submission:


H, N = map(int, input().split())
total_A = sum(list(map(int, input().split())))

if H <= total_A:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
H, A = map(int, input().split())

if (H % A) == 0:
    print(H // A)
else:
    print(H // A + 1)

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

if N == M:
    print('Yes')
else:
    print(('No'))
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import accumulate

N = int(input())
P = list(map(int, input().split()))

ans = 0

"""
for i, p in enumerate(P):
    # if np.any(P[0:i] < p): あまり以下と変わらなかった
    # if any([True for p2 in P[0:i] if p2 < p]): # 2回のループが☓ O(n^2)なので
        pass
    else:
        ans += 1
"""

for i, p in enumerate(P):
    tmp = list(accumulate(P[0:i+1], min))[-1]
    if p <= tmp:
        ans += 1

print(ans)


Fixed submission:
from itertools import accumulate

N = int(input())
P = list(map(int, input().split()))

ans = 0

"""
for i, p in enumerate(P):
    # if np.any(P[0:i] < p): あまり以下と変わらなかった
    # if any([True for p2 in P[0:i] if p2 < p]): # 2回のループが☓ O(n^2)なので
        pass
    else:
        ans += 1
"""

P_min = list(accumulate(P, min))

for p, p_min in zip(P, P_min):
    if p == p_min:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = int(input())
P = np.array(list(map(int, input().split())))

ans = 0

# 2回のループが☓ O(n^2)なので
for i, p in enumerate(P):
    if np.any(P[0:i] < p):
    # if any([True for p2 in P[0:i] if p2 < p]):
        pass
    else:
        ans += 1

print(ans)


Fixed submission:
from itertools import accumulate

N = int(input())
P = list(map(int, input().split()))

ans = 0

"""
for i, p in enumerate(P):
    # if np.any(P[0:i] < p): あまり以下と変わらなかった
    # if any([True for p2 in P[0:i] if p2 < p]): # 2回のループが☓ O(n^2)なので
        pass
    else:
        ans += 1
"""

P_min = list(accumulate(P, min))

for p, p_min in zip(P, P_min):
    if p == p_min:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):


N = int(input())
P = list(map(int, input().split()))

ans = 0

for i, p in enumerate(P):
    if any([True for p2 in P[0:i] if p2 < p]):
        pass
    else:
        ans += 1

print(ans)


Fixed submission:
from itertools import accumulate

N = int(input())
P = list(map(int, input().split()))

ans = 0

"""
for i, p in enumerate(P):
    # if np.any(P[0:i] < p): あまり以下と変わらなかった
    # if any([True for p2 in P[0:i] if p2 < p]): # 2回のループが☓ O(n^2)なので
        pass
    else:
        ans += 1
"""

P_min = list(accumulate(P, min))

for p, p_min in zip(P, P_min):
    if p == p_min:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
def solve(N, XL):
    XL_re = [[xl[0] - xl[1], xl[0] + xl[1]] for xl in XL]
    XL_re = sorted(XL_re, key=lambda x: x[1])

    cnt = 0
    for i, xl in enumerate(XL_re):
        if i == 0:
            tmp = xl[1]
            cnt += 1
        else:
            if tmp <= xl[0]:
                tmp = xl[1]
                cnt += 1
    return cnt

def test():
    assert solve(4, [[2, 4], [4, 3], [9, 3], [100, 5]]) == 3

def main():
    N = int(input())
    XL = [list(map(int, input().split())) for _ in range(N)]
    ans = main(N, XL)
    print(ans)

if __name__ == "__main__":
    # test()
    main()


Fixed submission:
def solve(N, XL):
    XL_re = [[xl[0] - xl[1], xl[0] + xl[1]] for xl in XL]
    XL_re = sorted(XL_re, key=lambda x: x[1])

    cnt = 0
    for i, xl in enumerate(XL_re):
        if i == 0:
            tmp = xl[1]
            cnt += 1
        else:
            if tmp <= xl[0]:
                tmp = xl[1]
                cnt += 1
    return cnt

def test():
    assert solve(4, [[2, 4], [4, 3], [9, 3], [100, 5]]) == 3

def main():
    N = int(input())
    XL = [list(map(int, input().split())) for _ in range(N)]
    ans = solve(N, XL)
    print(ans)

if __name__ == "__main__":
    # test()
    main()
Buggy python submission (verdict: Runtime Error):
C = input()

alpha = [chr(ord('a') + i) for i in range(25)]

print(alpha[alpha.index(C)+1])


Fixed submission:
C = input()

alpha = [chr(ord('a') + i) for i in range(26)]

print(alpha[alpha.index(C)+1])
Buggy python submission (verdict: Runtime Error):
K, X = map(int, input().split())

if (500 * x) >= K:
    print('Yes')
else:
    print('No')


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

if (500 * K) >= X:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
K, X = map(int, input().split())

if (500 * x) >= K:
    print('Yes')
else:
    print(('No')


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

if (500 * K) >= X:
    print('Yes')
else:
    print('No')