Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def getinputdata():
    array_result = []
    data = input()
    array_result.append(data.split(" "))
    flg = 1
    try:
        while flg:
            data = input()
            array_temp = []
            if(data != ""):
                array_result.append(data.split(" "))
                flg = 1
            else:
                flg = 0
    finally:
        return array_result

arr_data = getinputdata()
n = int(arr_data[0][0])
arr = [x for x  in arr_data[1]]

b = []
for i in range(0, n):
    b.append(arr[i])
    b.reverse()
        
print(" ".join(b))

Fixed submission:
def getinputdata():

    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])
arr = arr_data[1]

arr1=[]
for i in range(n-1,-1,-2):
    arr1.append(arr[i])
    
sposi=0 if n % 2==0 else 1

for j in range(sposi,n,2):
    arr1.append(arr[j])

print(" ".join(arr1))
Buggy python submission (verdict: Runtime Error):
import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

#回数
n = int(arr_data[0][0])

#番目
k = int(arr_data[0][1])

s=""

for i in range(1, 1 + n):

    cnt = int(arr_data[i][1])
    j = arr_data[i][0]

    s+=str(cnt * j)

print(s[k-1])


Fixed submission:
import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

#回数
n = int(arr_data[0][0])

#番目
k = int(arr_data[0][1])

arr=[]

for i in range(1, 1 + n):
    
    arr.append(list(map(int, arr_data[i])))

arr.sort(key=lambda x:(x[0]))

#print(arr)

#sys.exit()

mysum=0

for i in range(0,n):
 
    cnt = arr[i][1]
    j = arr[i][0]
 

    if k<=mysum+cnt:
        
        print(j)
        
        break
        
    else:
        
        
        mysum+=cnt
Buggy python submission (verdict: Time Limit Exceeded):
def getinputdata():

    array_result = []

    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if (data != ""):

                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

power = 1

for i in range(1, 1 + n):
    
    power *= i
    
print(power % (10 ** 9 + 7))
    
#    print(i, power, power % (10 ** 9 + 7), power < power % (10 ** 9 + 7))
    
#    print(power % (10 ** 9 + 7))





Fixed submission:
import math
def getinputdata():

    array_result = []

    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if (data != ""):

                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

power = 1

print(math.factorial(n) % (10 ** 9 + 7))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter


def getinputdata():
    # 配列初期化
    array_result = []

    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if (data != ""):

                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result


arr_data = getinputdata()

n = int(arr_data[0][0])

power = 1

for i in range(1, 1 + n):
    power *=  i

print(power % (10 **9 +7))


Fixed submission:
import math
def getinputdata():

    array_result = []

    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if (data != ""):

                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

power = 1

print(math.factorial(n) % (10 ** 9 + 7))
Buggy python submission (verdict: Time Limit Exceeded):
import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

mysum = math.factorial(n)

cnt = 0

i = mysum

while i >= 1:
    
    if mysum % i == 0:
    
        cnt += 1
        
    i -= 1
    
n = 10 ** 9 + 7    
print(cnt % n)
    
    

Fixed submission:
import math
from collections import Counter
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()
            
            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

mysum = math.factorial(n)

i = 2

if mysum==1:
    
    arr=[]

else:

    arr = []
    while i < mysum:

        if mysum % i == 0:

            arr.append(i)

            mysum = mysum // i

        else:

            i+=1

    else:

        arr.append(i)


list01=Counter(arr)

cnt=1
for k in list01:

    cnt *=list01[k]+1

print(cnt % (10 **9 +7))
Buggy python submission (verdict: Time Limit Exceeded):
import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

a = int(arr_data[0][0])
b = int(arr_data[0][1])
x = int(arr_data[0][2])


#print(a, b, x)

cnt = 0
for i in range(a, b + 1):

    if i % x == 0:
        
        cnt += 1
        
        
print(cnt)

Fixed submission:
from collections import Counter


def getinputdata():
    # 配列初期化
    array_result = []

    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if (data != ""):

                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

a = int(arr_data[0][0])
b = int(arr_data[0][1])
x = int(arr_data[0][2])

# print(a, b, x)

print(b // x - (a-1)//x)
Buggy python submission (verdict: Runtime Error):
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])
x = int(arr_data[0][1])

arr=[int(arr_data[1][x]) for x in range(0,n)]
cnt=0
for i in range(n-1):
    
    if arr[i]+arr[i+1]>x:
        
        if arr[i]-x>=0:
            
            cnt+=arr[i-x]
            arr[i]=0
            
        if arr[i]+arr[i+1]-x>=0:
            
            cnt+=arr[i+1]-x
            arr[i+1]=arr[i+1]-x
                   
print(cnt)        
 

Fixed submission:
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])
x = int(arr_data[0][1])

arr=[int(arr_data[1][x]) for x in range(0,n)]

cnt=0

for i in range(n-1):
    
    zan=arr[i]+arr[i+1]-x
     
    if 0<arr[i+1]<=zan:

        cnt+=arr[i+1]
        zan-=arr[i+1]
        arr[i+1]=0

    elif arr[i+1]>zan>0:

        cnt+=zan
        arr[i+1]-=zan
        zan=0

    if 0<arr[i]<=zan:

        cnt+=arr[i]
        zan-=arr[i]
        arr[i]=0

    elif arr[i]>zan>0:

        cnt+=zan
        arr[i]-=zan
        zan=0

    
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()
            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

s = arr_data[0][0]

wposi1=0
bposi1=0

cnt=0
while not(all(x =="W" for x in list(s)) or all(x =="B" for x in list(s))):
    
    if s[0]=="W":

        itiw=s.find("W",wposi1)
        itib=s.find("B",bposi1)
        s=s.replace("W","B",itib-itiw)
        
    elif s[0]=="B":

        itiw=s.find("W",wposi1)
        itib=s.find("B",bposi1)
        s=s.replace("B","W",itiw-itib)
    
    cnt+=1
    
print(cnt)    
    
    

Fixed submission:
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()
            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

s = arr_data[0][0]

cnt=0
posi=0
    
while s.find("BW",posi)>=0 or s.find("WB",posi)>=0:

    if s.find("BW",posi)>=0 and s.find("WB",posi)>=0 :
        
        posi=min(s.find("BW",posi),s.find("WB",posi))+1
    
    elif s.find("BW",posi)>=0 and s.find("WB",posi)==-1 :
        
        posi=s.find("BW",posi)+1
        
    elif s.find("BW",posi)==-1 and s.find("WB",posi)>=0 :
        posi=s.find("WB",posi)+1
        
    cnt+=1
        
print(cnt)
Buggy python submission (verdict: Runtime Error):
# from sys import exit

def main():
    x = int(input())
    d = 100
    ans = 0
    
    while d < x:
    d = int(d*1.01)
    ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Fixed submission:
from sys import exit

def main():
    X = int(input())
    deposit = 100

    i = 0
    while True:
        deposit = int(deposit * 1.01)
        i += 1

        if deposit >= X:
            print(i)
            exit()

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    S = input()

    answer = 0

    for i in range(N - 2):
        Si = S[i]
        for j in range(i + 1, N - 1):
            Sj = S[j]
            if Si == Sj:
                continue

            for k in range(j + 1, N):
                Sk = S[k]
                if Si == Sk or Sj == Sk:
                    continue
                if j - i == k - j:
                    continue
                answer += 1
    print(answer)

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    N = int(input())
    S = input()

    R_count = 0
    G_count = 0
    B_count = 0

    for s in S:
        if s == "R":
            R_count += 1
        elif s == "G":
            G_count += 1
        else:
            B_count += 1

    # 第一条件だけを考えたときの組み合わせの総数
    answer = R_count * G_count * B_count

    for i in range(N - 2):
        for j in range(i + 1, N - 1):
            # i, j が決まると、第二条件を満たさない k が決まる
            k = 2 * j - i

            # k が文字列の長さを超えたときは、第二条件を満たすことができない
            if k >= N:
                continue

            # 第二条件を満たす i, j, k が、第一条件を満たす場合、
            # 第一条件だけ考えたときの組み合わせの総数から差し引く
            if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
                answer -= 1
            
    print(answer)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
X, Y, Z = map(int, input().split())

X, Y = Y, X
X, Z = Z, X

print(f'{X} {Y} {Z}')

Fixed submission:

X, Y, Z = input().split()

X, Y = Y, X
X, Z = Z, X

print(X + " " + Y + " " + Z)
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict

N = int(input())
Ts = list(set([int(input()) for _ in range(N)]))

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

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

res = Ts[0]
for T in Ts:
    res = lcm(res, T)
print(int(res))


Fixed submission:
from collections import defaultdict

N = int(input())
Ts = list(set([int(input()) for _ in range(N)]))

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

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

res = Ts[0]
for T in Ts:
    res = lcm(res, T)
print(int(res))

Buggy python submission (verdict: Runtime Error):
from collections import defaultdict

N = int(input())
Ts = list(set([int(input()) for _ in range(N)]))

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

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

res = Ts[0]
for T in Ts[1:]:
    res = lcm(res, T)
print(int(res))


Fixed submission:
from collections import defaultdict

N = int(input())
Ts = list(set([int(input()) for _ in range(N)]))

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

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

res = Ts[0]
for T in Ts:
    res = lcm(res, T)
print(int(res))
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
v = [[] for i in range(n+1)]
path = [0 for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    v[b].append(a)
for i in range(n+1):
    if v[i] == []:
        continue
    m = max(v[i])
    found = 0
    for e in path[m:i]:
        if e == 1:
            found = 1
            break
    if found == 0:
        path[i - 1] = 1
s = 0
for p in path:
    s += p
print(s)

Fixed submission:
n, m = map(int, input().split())
v = [0 for i in range(n+1)]
path = [0 for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    if v[b] < a:
        v[b] = a

last = 0

for i in range(n+1):
    if v[i] == 0:
        continue
    m = v[i]

    if last < m:
        path[i - 1] = 1
        last = i - 1


s = 0
for p in path:
    s += p
print(s)
Buggy python submission (verdict: Runtime Error):
x = int(input())
import math
y = int(math.sqrt(x)) - 2
for i in range(y,y+5):
    if i ** 2 <= x and (i + 1)** 2 > x and i > 0:
        print(i ** 2)
 


Fixed submission:
a, b, c, d = map(int, input().split())
if abs(a - c) <= d or (abs(a - b) <= d and abs(b - c) < d):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input('number'))
a = N % 10
if a = 2 or 4 or 5 or 7 or 9:
  print('hon')
elif a = 0 or 1 or 6 or 8:
  print('pon')
else:
  print('bon')

Fixed submission:
N = int(input())
a = N % 10
if a == 2 or a==4 or a==5 or a==7 or a==9:
    print('hon')
elif a == 0 or a==1 or a==6 or a==8:
    print('pon')
else:
    print('bon')

Buggy python submission (verdict: Runtime Error):
a = N % 10
if a = 2 or 4 or 5 or 7 or 9:
  print('hon')
elif a = 0 or 1 or 6 or 8:
  print('pon')
else:
  print('bon')


Fixed submission:
N = int(input())
a = N % 10
if a == 2 or a==4 or a==5 or a==7 or a==9:
    print('hon')
elif a == 0 or a==1 or a==6 or a==8:
    print('pon')
else:
    print('bon')
Buggy python submission (verdict: Runtime Error):
import numpy as np 


n,m,x = map(int, input().split())


s_list = list()

for i in range(n):
    line = list(map(int, input().split()))
    s_list.append([line[0], np.array(line[1:], dtype=int)])


cands = list()
# cost, value
cands.append([0, np.zeros(m, dtype=int)])


for l in s_list:
    next_cands = list()
    for c in cands:
        next_cands.append([c[0] + l[0], c[1] + l[1]])
    cands += next_cands


min_cost = 10**6
for l in cands:
    if (l[1] >= x).all() and l[0] < min_cost:
        min_cost = l[0]


if min_cost == 10**6:
    print(-1)
else:
    print(min_cost)
    



Fixed submission:
import numpy as np 


n,m,x = map(int, input().split())


s_list = list()

for i in range(n):
    line = list(map(int, input().split()))
    s_list.append([line[0], np.array(line[1:], dtype=int)])


cands = list()
# cost, value
cands.append([0, np.zeros(m, dtype=int)])


for l in s_list:
    next_cands = list()
    for c in cands:
        next_cands.append([c[0] + l[0], c[1] + l[1]])
    cands += next_cands


min_cost = 10**12
for l in cands:
    if (l[1] >= x).all() and l[0] < min_cost:
        min_cost = l[0]


if min_cost == 10**12:
    print(-1)
else:
    print(min_cost)
Buggy python submission (verdict: Runtime Error):
a,b = input()
print(b+a)

Fixed submission:
a,b = input().split()
print(b+a)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())
for i in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 1
  else:
    break
    
print(" ".join(map(str, [a,b])))

Fixed submission:
a, b, k = map(int, input().split())
 
if a >= k:
  print(a-k, b)
else:
  if a+b > k:
    print(0, b-(k-a))
  else:
    print(0,0)

Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input())
for i in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 0
  else:
    break
    
print(" ".join(map(str, [a,b])))

Fixed submission:
a, b, k = map(int, input().split())
 
if a >= k:
  print(a-k, b)
else:
  if a+b > k:
    print(0, b-(k-a))
  else:
    print(0,0)

Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
for i in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 0:
  else:
    break
    
print(" ".join(map(str, [a,b])))

Fixed submission:
a, b, k = map(int, input().split())
 
if a >= k:
  print(a-k, b)
else:
  if a+b > k:
    print(0, b-(k-a))
  else:
    print(0,0)

Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input())
for i in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 0:
  else:
    break
    
print(" ".join(map(str, [a,b])))

Fixed submission:
a, b, k = map(int, input().split())
 
if a >= k:
  print(a-k, b)
else:
  if a+b > k:
    print(0, b-(k-a))
  else:
    print(0,0)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
ns = len(S)
U = str[:ns]
if T == U:
  print("Yes")
else:
  print("No")


Fixed submission:
S = input()
T = input()
ns = len(S)
U = T[:ns]
if S == U:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
ns = len(S)
U = str[:S]
if T == U:
  print("Yes")
else:
  print("No")

Fixed submission:
S = input()
T = input()
ns = len(S)
U = T[:ns]
if S == U:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
X = int(input())

for A in range(100):
  for B in range(100):
    if A**5 - B**5 == X:
      print(str(A) + " " + str(B))
  break
    if A**5 + B**5 == X:
      print(str(A) + " -" + str(B))
  break


Fixed submission:
X = int(input())
for A in range(-120, 120):
  for B in range(-120, 120):
    if A**5 - B**5 == X:
      print(str(A) + " " + str(B))
      quit()

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

for A in range(100):
  C = A ** 5 - X
  B = C ** 0.2
  if B % 1 == 0:
    print(str(A) + " " + str(B))
    break
    
for B in range(100):
  C = B ** 5+ X
  A = C ** 0.2
  if A % 1 == 0:
    print(str(A) + " " + str(B))
    break


Fixed submission:
X = int(input())
for A in range(-120, 120):
  for B in range(-120, 120):
    if A**5 - B**5 == X:
      print(str(A) + " " + str(B))
      quit()

Buggy python submission (verdict: Runtime Error):
import math
X = int(input())

for A in range(100):
  C = A ** 5 - X
  B = math.sqrt(C)
  if B % 1 == 0:
    print(str(A) + " " + str(B))
    break
    
for B in range(100):
  C = B ** 5 + X
  A = math.sqrt(C)
  if A % 1 == 0:
    print(str(A) + " " + str(B))
    break

Fixed submission:
X = int(input())
for A in range(-120, 120):
  for B in range(-120, 120):
    if A**5 - B**5 == X:
      print(str(A) + " " + str(B))
      quit()