Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03068 (python)

Fixed submission:
Length = int(input())
inputString = input()
SpecialIndex = int(input())
SpecialChar = inputString[SpecialIndex-1]
answer = ""
for i in inputString:
  if i != SpecialChar:
    answer += "*"
  else:
    answer += i
print(answer)

Buggy submission (verdict: Runtime Error):
Length = int(input())
inputString = input()
SpecialIndex = int(input())

for i in inputString:
  if i != inputString[SpecialIndex-1]:
    inputString[i] = "*"
print(inputString)
Problem p03260 (python)

Fixed submission:
A, B = map(int, input().split())
 
judge = False
for C in range(1,4):
  if (A*B*C) %2 == 1:
    judge = True
   
 
  
if judge == True:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
w =  [input() for i in range(N)]

valid = False

for i in range(1, N-1):
    if w[i-1][-1] == w[i][0] and len(set(w)) == len(w):
        valid = True
    else:
        valid = False

    print("Yes" if valid else "No")

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
 
judge = False
for c in range(1,4):
  if (A*B*C) %2 == 1:
    judge = True
   
 
  
if judge == True:
  print("Yes")
else:
  print("No")

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

judge = False
for c in range(1,4):
  if A*B*C %2 == 1:
    judge = True
   

  
if judge == True:
  print("Yes")
else:
  print("False")
Problem p03261 (python)

Fixed submission:
# coding: utf-8
 
 
def is_unique(seq):
    return len(seq) == len(set(seq))
 
 
def main():
    n = int(input())
    shiri = True
 
    w = []
    for i in range(n):
        w.append(input())
 
    for i in range(n-1):
        if w[i][-1] != w[i + 1][0]:
            shiri = False
            break
 
    if not is_unique(w):
        shiri = False
 
    if shiri:
        print('Yes')
    else:
        print('No')
 
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# coding: utf-8
def is_unique(seq):
    return len(seq) == len(set(seq))
 
 
def main():
    n = int(input())
 
    w = []
    for i in range(n):
        w.append(input())
 
    for i in range(n-1):
        if w[i][-1] != w[i + 1][0] and not is_unique(w)::
            return 'No'
        else:
            return 'Yes'
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
w = input().split('\n')
valid = False
for i in range(1,len(w)):
  if w[i][-1] == w[i+1][0] and len(set(w)) == len(w):
    valid = True
    return
  else:
    valid = False
   
  
  print("Yes" if valid else "No")

Buggy submission (verdict: Runtime Error):
w = input().split('\n')
valid = False
for i in range(1,len(w))
  if w[i][-1] == w[i+1][0] and len(set(w)) == len(w) 
      vaild = True
  else: 
      vaild = False

print("Yes" if vaild else "NO")
Problem p03760 (python)

Fixed submission:
O = input()
E = input()
answer = ""
i = 1
o = 0
e = 0
while i < len(E)+len(O)+1:
  if i % 2 != 0:
    answer += O[o]
    o += 1
  else:
    answer += E[e]
    e += 1
  i += 1

print(answer)

Buggy submission (verdict: Runtime Error):
O = input()
E = input()
answer = ""
i = 1
o = 0
e = 0
while i < len(E):
  if i % 2 != 0:
    answer.append(O[o])
    o += 1
  else:
    answer.append(E[e])
    e += 1
  i += 1

if len(O) - len(E) == 1:
  answer.append(O[-1])

return answer
Problem p03777 (python)

Fixed submission:
a,_,b=input()
print("DH"[a==b])

Buggy submission (verdict: Runtime Error):
input_ = input().split()
if input_[0] != input_[-1]:
  return "D"
else:
  return "H"
Problem p03860 (python)

Fixed submission:
Title = input().split(' ')
answer = ""
 
for smallTitle in Title:
  answer += smallTitle[0]

print(answer)

Buggy submission (verdict: Runtime Error):
Title = input().split(' ')
answer = ""

for smallTitle in Title:
  answer += smallTitle[0]

return answer
Problem p04044 (python)

Fixed submission:
n,l=map(int,input().split())
s=sorted([input() for i in range(n)])
print("".join(s))

Buggy submission (verdict: Runtime Error):
L,N = map(int, input().split())
s = sorted([input() for i in range(N)])
print("".join(s))

Buggy submission (verdict: Runtime Error):
L,N = (int, input().split())
s = sorted([input() for i in range(N)])
print("".join(s))

Buggy submission (verdict: Runtime Error):
L,N = (int, input().split())
s = sorted([input() for i in range(N)])
print(s,end="")
Problem p02945 (python)

Fixed submission:
num1,num2 = map(int, input().split())

plus = num1 + num2
minus = num1 - num2
times = num1 * num2

list = [plus,minus,times]

print(max(list))

Buggy submission (verdict: Runtime Error):
num1 = input('整数を入力してください：')

while num1.replace('-', '').isdigit() == False or int(num1) < -100:
    print('Error')
    num1 = input('整数を入力してください：')
else:
    num1 = int(num1)
num1 = int(num1)



num2 = input('整数を入力してください：')

while num2.replace('-', '').isdigit() == False or int(num2) > 100:
    print('Error')
    num2 = input('整数を入力してください：')
else:
    num2 = int(num2)
num2 = int(num2)


plus = num1 + num2
minus = num1 - num2
times = num1 * num2

list = [plus,minus,times]

print(max(list))
Problem p02946 (python)

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

for i in range(x-k+1,x+k):
    print(i, end = " ")

Buggy submission (verdict: Runtime Error):
k = input('整数を入力してください：')

while k.replace('-', '').isdigit() == False or int(k) > 100 or int(k) < 1:
    print('Error')
    k = input('整数を入力してください：')
else:
    k = int(k)
k = int(k)

x = input('整数を入力してください：')

while x.replace('-', '').isdigit() == False or int(x) > 100 or int(x) < 0:
    print('Error')
    x = input('整数を入力してください：')
else:
    x = int(x)
x = int(x)


result = []
for i in range(x,-k,-1):
    result.append(i)
for j in range(x+1,k):
    result.append(j)
result.sort()
print(format(result))
Problem p02981 (python)

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

train = n * a
taxi = b

expense = [train,taxi]

print(min(expense))

Buggy submission (verdict: Runtime Error):
n = input('整数を入力してください：')

while n.isdigit() == False or int(n) < 1 or int(n) > 20:
    print('Error')
    n = input('整数を入力してください：')
else:
    n = int(n)
n = int(n)


a = input('整数を入力してください：')

while a.isdigit() == False or int(a) < 1 or int(a) > 50:
    print('Error')
    a = input('整数を入力してください：')
else:
    a = int(a)
a = int(a)

b = input('整数を入力してください：')

while b.isdigit() == False or int(b) < 1 or int(b) > 50:
    print('Error')
    b = input('整数を入力してください：')
else:
    b = int(b)
b = int(b)

train = n * a
taxi = b

expense = [train,taxi]

print(min(expense))
Problem p02982 (python)

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


x = []
for i in range(n):
    x.append(list(map(int, input().split())))


result = 0

for i in range(n):
    for j in range(n):
        if i < j:
            dist = 0
            for k in range(d):
                dist += (x[i][k] - x[j][k]) ** 2
            dist = dist ** 0.5
            if dist.is_integer():
                result += 1
print(result)

Buggy submission (verdict: Runtime Error):
n,d = map(int, input().split())


x = []
for i in range(n):
    x.append(list(map(int, input().split())))


result = 0

for i in range(n-1):
    total = 0
    for k in range(d-1):
        r = (x[i][k] - x[i+k][k]) ** 2
        total += r
    total = total ** 0.5
    if total.is_integer():
        result += 1
print(result)
Problem p03035 (python)

Fixed submission:
A, B = input().split()
 
if int(A) >= 13:
  print(B)
elif int(A) <=5:
  print(str(0))
else:
  print(str(int(B)//2))

Buggy submission (verdict: Runtime Error):
A, B = input().split()
 
if int(A) >= 13:
  print(B)
elif int(A) <=5:
  print(str(0))
else:
  print(str(B//2))

Buggy submission (verdict: Runtime Error):
A, B = input().split()

if A >= 13:
  print(B)
elif A <=5:
  print("0")
else:
  print(str(B//2))
Problem p03147 (python)

Fixed submission:
count = 0
N = int(input())
h = list(map(int, input().split()))
count =+ min(h)
h = list(map(lambda x:  x-min(h) ,h))
# if max(h) == 0:
#     print(count)
h.append(0)
while max(h) != 0:
    for i in range(len(h)):
        if h[i] <= 0:
            continue
        elif h[i-1] > 0:
            continue
        else:
            for j in range(i+1,len(h)+1):
                if h[j] > 0:
                    continue
                else:
                    count += 1
                    break
    h = list(map(lambda x:  x-1 ,h))
print(count)

Buggy submission (verdict: Runtime Error):
import numpy as np
import sys
count = 0
N = int(input())
h = list(map(int, input().split()))

h = map(lambda x:  x-min(h) ,h)
count =+ min(h)
if max(h) == 0:
  return count

h = h.append(0)
while max(h) !=0:
    for i in range(len(h)+1):
        if h[i] == 0:
            continue
        else:
            for j in range(i+1,len(h)+1):
                if h[j] != 0:
                    continue
                else h[j] == 0:
                    count += 1
                    break
    h = map(lambda x:  x-1 ,h)
print(count)
Problem p03059 (python)

Fixed submission:
def add(A,B,T):
  C=T//A
  return C*B
  
a=list(map(int,input().split()))
print(add(a[0],a[1],a[2]))

Buggy submission (verdict: Runtime Error):
def add(A,B,T):
  C=T//A
  return C*B
  
A=int(input())
B=int(input())
T=int(input())
print(add(A,B,T))
Problem p02694 (python)

Fixed submission:
T = int(input())
a = 0
n = 100
while n < T:
    n = n * 1.01
    n = int(n)
    a = a + 1
print(a)

Buggy submission (verdict: Runtime Error):
t = int(input())
a = 0
b = 100
while b < t:
    b = b * 1.01
    b = int(b)
    a = a + 1
print(k)
Problem p02772 (python)

Fixed submission:
def main():
    n = int(input())
    As = list(map(int, input().split(" ")))

    ans = "APPROVED"
    for a in As:
        if a % 2 == 0:
            if a % 3 == 0 or a % 5 == 0:
                pass
            else:
                ans = "DENIED"
                break

    print(ans)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    As = list(map(int, input().split(" ")))

    for a in As:
        if a % 2 == 0:
            if a % 3 == 0 or a % 5 == 0:
                ans = "APPROVED"
            else:
                ans = "DENIED"
                break

    print(ans)

if __name__ == '__main__':
    main()
Problem p02780 (python)

Fixed submission:
import numpy as np
 
def main():
    N, K = map(int, input().split(" "))
    ps = np.array(input().split(" "))
    ps = ps.astype("int64")
 
    ps_means = np.zeros(N)
    maxval = 0
 
    for i in range(N):
        ps_means[i] = ((1 + ps[i]) * ps[i])/ 2
        if i + 1 >= K:
            if i + 1 == K:
                sumval = np.sum(ps_means[i-K+1:i+1] / ps[i-K+1:i+1])
            else:
                sumval -= ps_means[i-K] / ps[i-K]
                sumval += ps_means[i] / ps[i]
            if sumval > maxval:
                maxval = sumval
 
    ans = maxval
    print(ans)
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np
from numba import jit
@jit
def search(N, K, ps, ps_means, maxval):
    for i in range(N):
        ps_means[i] = ((1 + ps[i]) * ps[i])/ 2
        if i + 1 >= K:
            a = ps[i-K+1:i+1]
            b = 1 / a  #[np.delete(a, i).prod() for i in range(K)]
            c = ps_means[i-K+1:i+1] * b
            sumval = np.sum(c)  #/ a.prod()
            if sumval > maxval:
                maxval = sumval
    return maxval

def main():
    N, K = map(int, input().split(" "))
    ps = np.array(input().split(" "))
    ps = ps.astype("int64")

    ps_means = np.zeros(N)
    maxval = 0
    ans = search(N, K, ps, ps_means, maxval)
    print(ans)

if __name__ == '__main__':
    main()
Problem p02843 (python)

Fixed submission:
def main():
    X = input()
    X = int(X)

    if X < 100:
        ans = 0
    else:
        X = str(X)
        under2 = int(X[-2] + X[-1])
        X = int(X)
        if under2 <= 5:
            ans = 1
        else:
            cnt = 0
            while under2 > 5:
                under2 -= 5
                cnt += 1
            cnt += 1

            if X >= cnt * 100:
                ans = 1
            else:
                ans = 0
    
    print(ans)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    X = input()
    under2 = int(X[-2] + X[-1])
    X = int(X)

    if X < 100:
        ans = 0
    else:
        if under2 <= 5:
            ans = 1
        else:
            cnt = 0
            while under2 > 5:
                under2 -= 5
                cnt += 1
            cnt += 1

            if X >= cnt * 100:
                ans = 1
            else:
                ans = 0
    
    print(ans)

if __name__ == '__main__':
    main()
Problem p02882 (python)

Fixed submission:
import sys
import numpy as np

def main():
    input = sys.stdin.readline
    abx = list(map(np.float64, input().split()))
    a = abx[0]
    b = abx[1]
    x = abx[2]
    taiseki = a * a * b
    if x <= taiseki / 2:
        y = (2 * x) / (a * b)
        tan = y / b
        theta = np.float64(np.float64(90) - np.rad2deg(np.arctan(tan)))
    else:
        y = (2 * x) / (a * a) - b
        if b - y != 0:
            tan = a / (b - y)
            theta = np.float64(np.float64(90) - np.rad2deg(np.arctan(tan)))
        else:
            theta = 0.


    print(theta)

if __name__ == '__main__':
    main()

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

def main():
    input = sys.stdin.readline
    abx = list(map(int, input().split()))
    a = abx[0]
    b = abx[1]
    x = abx[2]
    taiseki = a * a * b
    if x <= taiseki / 2:
        y = (2 * x) / (a * b)
        tan = y / b
        theta = np.float64(np.float64(90) - np.rad2deg(np.arctan(tan)))
    else:
        y = (2 * x) / (a * a) - b
        tan = a / (b - y)
        theta = np.float64(np.float64(90) - np.rad2deg(np.arctan(tan)))

    print(theta)

if __name__ == '__main__':
    main()

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

def main():
    input = sys.stdin.readline
    abx = list(map(int, input().split()))
    a = abx[0]
    b = abx[1]
    x = abx[2]
    taiseki = a * a * b
    if x <= taiseki / 2:
        y = (2 * x) / (a * b)
        tan = y / b
        theta = 90 - np.rad2deg(np.arctan(tan))
    else:
        y = (2 * x) / (a * a) - b
        tan = a / (b - y)
        theta = 90 - np.rad2deg(np.arctan(tan))

    print(theta)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
import math

def main():
    input = sys.stdin.readline
    abx = list(map(int, input().split()))
    a = abx[0]
    b = abx[1]
    x = abx[2]
    taiseki = a * a * b
    if x <= taiseki / 2:
        y = (2 * x) / (a * b)
        tan = y / b
        theta = 90 - math.degrees(math.atan(tan))
    else:
        y = (2 * x) / (a * a) - b
        tan = a / (b - y)
        theta = 90 - math.degrees(math.atan(tan))

    print(theta)

if __name__ == '__main__':
    main()
Problem p02909 (python)

Fixed submission:
def main():
    S = input()
    if S == "Sunny":
        ans = "Cloudy"
    elif S == "Cloudy":
        ans = "Rainy"
    elif S == "Rainy":
        ans = "Sunny"
    print(ans)
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
def main():
    input = sys.stdin.readline
    S = input()
    if S == "Sunny":
        ans = "Cloudy"
    elif S == "Cloudy":
        ans = "Rainy"
    elif S == "Rainy":
        ans = "Sunny"
    print(ans)
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
def main():
    input = sys.stdin.readline
    S = input()
    if S == "Sunny":
        ans = "Cloudy"
    elif S == "Cloudy":
        ans = "Rainy"
    elif S == "Rainy":
        ans = "Sunny"
    print(ans)
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
def main():
    input = sys.stdin.readline
    S = input()
    if S == "Sunny":
        ans = "Cloudy"
    elif S == "Cloudy":
        ans = "Rainy"
    elif S == "Rainy":
        ans = "Sunny"

    print(ans)
if __name__ == '__main__':
    main()
Problem p02923 (python)

Fixed submission:
import sys
def main():
    input = sys.stdin.readline
    N = int(input())
    Hs = list(map(int, input().split()))

    cnt = 0
    ans = 0
    [cnt for i in range(N-1)]
    for i in range(N-1):
        if Hs[i] >= Hs[i + 1]:
            cnt += 1
        else:
            if ans < cnt:
                ans = cnt
            cnt = 0
        if ans < cnt:
            ans = cnt
    print(ans)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
def main():
    input = sys.stdin.readline
    N = int(input())
    Hs = list(map(int, input().split()))

    cnt = 0
    cnts = []
    for i in range(N-1):
        #print(Hs[i])
        #print(Hs[i+1])
        if Hs[i] >= Hs[i + 1]:
            cnt += 1
            #print("==")
        else:
            #print("P")
            cnts.append(cnt)
            cnt = 0
        cnts.append(cnt)
        #print(cnts)
    ans = max(cnts)
    #print(cnts)
    print(ans)

if __name__ == '__main__':
    main()
Problem p02953 (python)

Fixed submission:
import sys
def main():
    input = sys.stdin.readline
    N = int(input())
    Hs= list(map(int, input().split()))
    hs = [0]
    ans = ""
    for i in range(N):
        hs.append(0)
        #print(Hs)
        h_tmp = Hs[i]
        if i < N - 1:
            h_next = Hs[i + 1]
            if h_tmp < h_next:
                hs[i + 1] = 1
                Hs[i + 1] -= 1
                pass
            elif h_tmp == h_next:
                pass
            elif h_tmp - 1 == h_next and hs[i] == 0:
                if i > 0:
                    h_before = Hs[i - 1]
                    if h_before <= h_tmp - 1:
                        pass
                    else:
                        ans = "No"
                        break
                elif i == 0:
                    pass
            else:
                ans = "No"
                break
    if ans == "":
        ans = "Yes"
 
    print(ans)
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):

import sys
#import numpy as np
def main():
    input = sys.stdin.readline
    N = int(input())
    Hs= list(map(int, input().split()))
    HsProc = Hs.copy()
 
    #proc = np.array(N)
    ans = ""
    for i in range(N):
        #print(Hs)
        h_tmp = Hs[i]
        if i < N - 1:
            h_next = Hs[i + 1]
            if h_tmp < h_next:
                Hs[i+1] -= 1
                pass
            elif h_tmp == h_next:
                pass
            elif h_tmp - 1 == h_next:
                if i > 0:
                    h_before = Hs[i - 1]

                    if h_before <= h_tmp - 1:
                        #proc[i] = 1
                        pass
                    else:
                        ans = "No"
                        break
                elif i == 0:
                    #proc[i] = 1
                    pass
            else:
                ans = "No"
                break
    if ans == "":
        ans = "Yes"

    print(ans)
 
if __name__ == '__main__':
    main()
Problem p02957 (python)

Fixed submission:
def main():
    import sys
    input = sys.stdin.readline

    AB = input().split(" ")
    A = int(AB[0])
    B = int(AB[1])
    if (A + B) % 2 == 1:
        res = 'IMPOSSIBLE'
    else:
        res = int((A + B) / 2)
    print(res)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    import sys
    input = sys.stdin.readline

    AB = input().split(" ")
    A = int(AB[0])
    B = int(AB[1])
    if (A + B) % 2 == 1:
        res = 'IMPOSSIBLE'
    elif:
        res = int((A + B) / 2)
    print(res)

if __name__ == '__main__':
    main()
Problem p02969 (python)

Fixed submission:
r = int(input())
print(3 * (r ** 2))

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
an = np.array(input().split(" ")).astype("int64")
if an[0] == 0:
    if n % 2 == 0:
        print("0")
    elif n % 2 == 1:
        print("1")
        print("1")
elif an[0] == 1:
    if n % 2 == 0:
        print("1")
        print("1")
    elif n % 2 == 1:
        print("0")

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
an = np.array(input().split(" ")).astype("int64")


if an[0] == 0:
    if n % 2 == 0:
        print("0")
    elif n % 2 == 1:
        print("1")
        print("1")
elif an[0] == 1:
    if n % 2 == 0:
        print("1")
        print("1")
    elif n % 2 == 1:
        print("0")
Problem p03238 (python)

Fixed submission:
age = int(input())

if age == 1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a + b)

Buggy submission (verdict: Runtime Error):
age = int(input())

if age == 1:
    print(Hello World)
else:
    a = int(input())
    b = int(input())
    print(a + b)
Problem p02756 (python)

Fixed submission:
string = input()
kai = int(input())
data = [input().split(' ') for i in range(kai)]
key = 0  #0 start
former = []
latter = []

for i in range(kai):
    if(data[i][0] == '1'):
        key = (key + 1) % 2
    elif((int(data[i][1]) + key) % 2 == 1):
        former.append(data[i][2])
    else:
        latter.append(data[i][2])

string = ''.join(former[::-1]) + string + ''.join(latter)
if(key == 0):
    print(string)
else:
    print(string[::-1])

Buggy submission (verdict: Runtime Error):
string = input()
num = int(input())
data = [input().split(' ') for i in range(kai)]

for i in range(num):
    if(data[i][0] == '1'):
        if(len(string) == 2):
            string = string[1] + string[0]
        elif(len(string) >= 3):
            string = string[-1] + string[1:-1] + string[0]
        
    else:
        if(data[i][1] == '1'):
            string = data[i][2] + string
        else:
            string = string + data[i][2]

print(string)