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

Fixed submission:
S = input()
n = len(S)
total = 0
for i in range(2**(n-1)) :
  fo = ''
  fo = S[0]
  for j in range(n-1) :
    if ((i >> j) & 1) :
      fo += '+' 
    fo += S[j+1]
  total += sum(map(int,fo.split('+')))
print(total)

Buggy submission (verdict: Runtime Error):
S = input()
n = len(S)
total = 0
for i in range(2**(n-1)) :
  ls = [""] * (n-1)
  
  for j in range(n) :
    if ((i >> j) & 1) :
      ls[j] = "+"
  for k in range(n) :
    if k==0 :
      fo = S[k] + ls[k]
    elif k==n-1 :
      fo = fo + S[k]
    else :
      fo = fo + S[k] + ls[k]  
  total += eval(fo)
print(total)
Problem p02780 (python)

Fixed submission:
import numpy

A = list(map(int, input().split()))

K = A[1]
N = A[0]

P = list(map(float, input().split()))

EP = list(map(lambda x: (1+x)/2, P))

cumEP = list(numpy.cumsum(EP))

new_list = []

if N>K:
    for val in range(N-K):
        new_list.append(cumEP[val+K]-cumEP[val])
    print(max(new_list))
else:
    print(sum(EP))

Buggy submission (verdict: Runtime Error):
import numpy

A = list(map(int, input().split()))

K = A[1]
N = A[0]

P = list(map(float, input().split()))

EP = list(map(lambda x: (1+x)/2, P))

cumEP = list(numpy.cumsum(EP))

new_list = []
for val in range(N-K):
    new_list.append(cumEP[val+K]-cumEP[val])

print(max(new_list))

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

K = A[1]
N = A[0]

P = list(map(float, input().split()))
P_list = P[N-K:N]

new_list = []

for val in range(N-K):
    P_list=P[val:val+K]
    new_list.append(sum(list(map(lambda x: (1+x) / 2, P_list))))

print(max(new_list))
Problem p02783 (python)

Fixed submission:
import math
str = input()
str_list=str.split()
H=int(str_list[0])
A=int(str_list[1])
Q=math.ceil(H/A)
print(Q)

Buggy submission (verdict: Runtime Error):
HN=input()
HN_list=HN.split()
H=int(HN_list[0])
N=int(HN_list[1])
A=input()
A_list=A.split()
aaa=map(int, A_list)
A_sum=sum(aaa)
if A_sum>H:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import math
H=int(input())
A=int(input())
Q=math.ceil(H/A)
print(Q)

Buggy submission (verdict: Runtime Error):
import sys
import math
input_list=sys.argv[0:]
H=int(input_list[1])
A=int(input_list[2])
Q=math.ceil(H/A)
print(Q)
Problem p02783 (python)

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

for i in range(1, h+1):
    if (h - a*i) <= 0:
        print(i)
        break

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

h.sort()
for i in range(k):
    h.pop()
    if len(h) == 0:
        break
print(0 if len(h) == 0 else sum(h))
Problem p02934 (python)

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

print(1 / sum([1/i for i in a]))

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
    a.append(input())

# 1 / sum_i(1/a_i)
print(1 / sum([1/i for i in a]))
Problem p02953 (python)

Fixed submission:
import numpy as np
 
n = int(input())
h = list(map(int, input().split()))
 
h = np.array(h)
 
for i in range(len(h)-1):
   if h[i] < h[i+1]:
       h[i+1] -= 1
np.diff(h-1, n=1)
 
minus = [i for i in np.diff(h-1, n=1) if i < 0]
 
if len(minus) > 0:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
import numpy as np
 
n = int(input())
hh = np.array([])
for i in range(n):
    hh.append(input())
 
for i in range(len(hh)-1):
   if hh[i] < hh[i+1]:
       hh[i+1] -= 1
np.diff(hh-1, n=1)
 
minus = [i for i in np.diff(hh-1, n=1) if i < 0]
 
if len(minus) > 0:
    print('No')
else:

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

n = int(input())
h = []
for i in range(n):
    h.append(input())

for i in range(len(hh)-1):
   if hh[i] < hh[i+1]:
       hh[i+1] -= 1
np.diff(hh-1, n=1)

minus = [i for i in np.diff(hh-1, n=1) if i < 0]

if len(minus) > 0:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
h = []
for i in range(n):
    h.append(input())
 
# 単調非減少：x2がx1より小さくならない
flag = 'Yes'
for i in range(len(h)-1):
    # 次のほうが大きかったら、小さくしておく
    if h[i] <= h[i+1]:
        h[i+1] -= 1
        # 小さくして、次が小さくなったらOK
        if h[i] > h[i+1]:
            if n == i+1:
                break
            flag = 'No'
            break
print(flag)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = []
for i in range(n):
    h.append(input())

# 単調非減少：x2がx1より小さくならない
flag = 'Yes'
for i in range(len(h)-1):
    # 次のほうが大きかったら、小さくしておく
    if h[i] < h[i+1]:
        h[i+1] -= 1
        # 小さくして、次が小さくなったらOK
        if h[i] > h[i+1]:
            if n == i+1:
                break
            flag = 'No'
            break
print(flag)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = []
for i in range(n):
    h.append(input())

# 単調非減少：x2がx1より小さくならない
flag = 'Yes'
for i in range(len(h)-1):
    if h[i] < h[i+1]:
        h[i+1] -= 1
        if h[i] < h[i+1]:

            if n == i+1:
                break
            flag = 'No'
            break
print(flag)
Problem p02993 (python)

Fixed submission:
s = str(input())
is_good = True
for i in range(len(s)-1):
    if s[i] == s[i+1]:
        #print('Bad')
        is_good = False
        break

print('Good' if is_good else 'Bad')

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

x,y = c,d

# 最小公倍数
while y != 0:
	x,y = y,x%y

x = (c*d)//x

count1 = b - (b//c + b//d -b//x)
count2 = (a - 1) - ((a-1)//c + (a-1)//d -(a-1)//x) 
print(count1 - count2)
Problem p03844 (python)

Fixed submission:
A,op,B=input().split()
a=int(A)
b=int(B)
 
if op == "+" :
    print(a+b)
  
elif op == "-" :
    print(a-b)

Buggy submission (verdict: Runtime Error):
n = int(input())
t_N = input().split()
list_Time = []
for id in range(n):
    list_Time.append(int(t_N[id]))
sum = sum(list_Time)
m = int(input())
for id in range(m):
    p, x = map(int, input().split())
    answer = sum + x - list_Time[p - 1]
    print(answer)

Buggy submission (verdict: Runtime Error):
N=int(input())
T_N=int(input().split())
list_time = []
for i in range(N):
    list_time.append(T_N[i])
#Ti秒の総和を求める
sum=sum(list_time)
print(sum)
M=int(input())
for i in range(M):
    p,x=map(int,input().split())
    #ドリンク飲んだ時と飲まないときの差を元の合計に足す。
    ans=sum+x-list_time[p-1]
    print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
T_N=int(input().split())
list_time = []
for i in range(N):
    list_time.append(T_N[i])
#Ti秒の総和を求める
sum=sum(list_time)
M=int(input())
for i in range(M):
    p,x=map(int,input().split())
    #ドリンク飲んだ時と飲まないときの差を元の合計に足す。
    ans=sum+x-list_time[p-1]
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
T_N=int(input().split())
list_time=[]
for i in range(N):
    list_time.append(T_N[i])
#Ti秒の総和を求める
sum=sum(list_time)
M=int(input())
for i in range(M):
    p,x=map(int,input.split())
    #ドリンク飲んだ時と飲まないときの差を元の合計に足す。
    ans=sum+x-list_time[p-1]
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
T_N=int(input().split())
list_time=[]
for i in range(N):
    list_time.append(T_N[i])
#Ti秒の総和を求める
sum=sum(list_time)
M=int(input())
for i in range(M):
    p,x=map(int,input.split())
    #ドリンク飲んだ時と飲まないときの差を元の合計に足す。
    ans=sum+(x-list_time[p-1])
    print(ans)
Problem p03845 (python)

Fixed submission:
n = int(input())
t_N = input().split()
list_Time = []
for id in range(n):
    list_Time.append(int(t_N[id]))
sum = sum(list_Time)
m = int(input())
for id in range(m):
    p, x = map(int, input().split())
    answer = sum + x - list_Time[p - 1]
    print(answer)

Buggy submission (verdict: Runtime Error):
N=int(input())
T_N=int(input().split())
list_time = []
for i in range(N):
    list_time.append(T_N[i])
#Ti秒の総和を求める
sum=sum(list_time)
M=int(input())
for i in range(M):
    p,x=map(int,input().split())
    #ドリンク飲んだ時と飲まないときの差を元の合計に足す。
    ans=sum+x-list_time[p-1]
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
T_N=int(input().split())
list_time=[]
for i in range(N):
    list_time.append(T_N[i])
#Ti秒の総和を求める
sum=sum(list_time)
M=int(input())
for i in range(M):
    p,x=map(int,input.split())
    #ドリンク飲んだ時と飲まないときの差を元の合計に足す。
    ans=sum+(x-list_time[p-1])
    print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
T_N=int(input().split())
list_time=[]
for i in range(N)
    list_time.append(T_N[i])
sum=sum(list_time)
M=int(input())
for i in range(M):
    p,x=map(int,input.split())
    ans=sum+(x-list_time[p-1])
    print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
T_N=int(input().split())
list_time=[]
for i in range(N)
    list_time.append(T_N[i])
#Ti秒の総和を求める
sum=sum(list_time)
M=int(input())
for i in range(M):
    p,x=map(int,input.split())
    #ドリンク飲んだ時と飲まないときの差を元の合計に足す。
    ans=sum+(x-list_time[p-1])
    print(ans)
Problem p02823 (python)

Fixed submission:
import numpy as np
from decimal import Decimal

N, A, B = map(Decimal, input().split())
ab_max = np.amax(np.array([A, B]))
ab_min = np.amin(np.array([A, B]))

if (A - B) % 2 == 0:
    print(int((ab_max - ab_min) / 2))
else:
    print(int(np.amin([ab_min - 1, N - ab_max]) + (ab_max - ab_min + 1) / 2))

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

N, A, B = map(int, input().split())
ab_max = np.amax(np.array([A, B]))
ab_min = np.amin(np.array([A, B]))

if (A - B) % 2 == 0:
    print(int((ab_max - ab_min) / 2))
else:
    print(int(np.amin([(ab_max - 1), (N - ab_min)])))
Problem p02811 (python)

Fixed submission:
k,x = [int(x) for x in input().split()]

k = k * 500 

if k >= x:
  print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
k = input()
x = input()
if (k * 500) > x:
  print ("yes")
else:
  print("no")
Problem p02817 (python)

Fixed submission:
s, t = input().split()
print(t+s)

Buggy submission (verdict: Runtime Error):
k,x = [int(x) for x in input().split()]

k = k * 500 

if k >= x:
  print("Yes")
else:
	print("No")
Problem p02801 (python)

Fixed submission:
C = input()
alphs = "abcdefghijklmnopqrstuvwxyz"
print(alphs[alphs.find(C)+1])

Buggy submission (verdict: Runtime Error):
N,M = [int(i) for i in input().split()]
submissions = {str(i):[] for i in range(1,N+1)}
AC,WA = 0,0
for i in range(M):
    P,S = [j for j in input().split()]
    submissions[P].append(S)
for i in submissions:
    if 'AC' not in submissions[i]:
        continue
    for j in submissions[i]:
        if j == 'AC':
            AC+=1
            break
        WA +=1
print(AC,WA)

Buggy submission (verdict: Runtime Error):
N,M = [int(i) for i in input().split()]
submissions = {str(i):[] for i in range(1,N+1)}
AC,WA = 0,0
for i in range(M):
    P,S = [j for j in input().split()]
    submissions[P].append(S)
for i in submissions:
    if 'AC' not in submissions[i]:
        continue
    for j in submissions[i]:
        if j == 'AC':
            AC+=1
            break
        WA +=1
print(AC,WA)

Buggy submission (verdict: Runtime Error):
N,M = [int(i) for i in input().split()]
submissions = {str(i):[] for i in range(1,N+1)}
AC,WA = 0,0
for i in range(M):
    P,S = [j for j in input().split()]
    submissions[P].append(S)
for i in submissions:
    if(not 'AC' in submissions[i]):
        continue
    for j in submissions[i]:
        if j == 'AC':
            AC+=1
            break
        WA +=1
print(AC,WA)

Buggy submission (verdict: Runtime Error):
N,M = [int(i) for i in input().split()]
submissions = {str(i):[] for i in range(1,N+1)}
AC,WA = 0,0
for i in range(M):
    P,S = [j for j in input().split()]
    submissions[P].append(S)
for i in submissions:
    for j in submissions[i]:
        if not 'AC' in j:
            break
        if j == 'AC':
            AC+=1
            break
        WA +=1
print(AC,WA)
Problem p02817 (python)

Fixed submission:
a,b = [i for i in input().split()]
print("".join([b,a]))

Buggy submission (verdict: Runtime Error):
A,B,K = [int(i) for i in input().split()]
a = A - (K - (K -A))
b = B - (K - A)
print(f"{a} {b}")
Problem p02818 (python)

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

Buggy submission (verdict: Runtime Error):
A,B,K = [int(i) for i in input().split()]
a = A - (K - (K -A))
b = B - (K - A)
print(f"{a} {b}")
Problem p02783 (python)

Fixed submission:
S = input().split(" ") #標準入力

H = int(S[0]) #モンスターのHP
A = int(S[1]) #サーバルの攻撃力

atCount = 0 #攻撃回数

while H > 0:
  H = H - A
  atCount = atCount + 1

print(atCount)

Buggy submission (verdict: Runtime Error):
HA = input()

HA = HA.split(" ")

H = HA[0]
A = HA[1]

hit = 0

while H < 0:
  H = H - A
  hit = hit + 1

print(hit)
Problem p02801 (python)

Fixed submission:
C = input()

print(chr(ord(C) + 1))

Buggy submission (verdict: Runtime Error):
C = input()

print(C++)
Problem p03720 (python)

Fixed submission:
n, m = map(int, input().split())
road = [0] * n

for i in range(0, m):
    a, b = map(int, input().split())
    road[a-1] = road[a-1] + 1
    road[b-1] = road[b-1] + 1

for i in road:
    print(i)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
road = [0] * n

for i in m:
    a, b = map(int, input().split())
    road[a-1] =+ 1
    road[b-1] =+ 1

for i in road:
    print(i)
Problem p02853 (python)

Fixed submission:
x,y=map(int,input().split())
if(x==y==1):
  print(1000000)
else:
  ans=max(4-x,0)*100000+max(4-y,0)*100000
  print(ans)

Buggy submission (verdict: Runtime Error):
x,y=map(int,input())
if(x==y==1):
  print(1000000)
else:
  ans=max(4-x,0)*100000+max(4-y,0)*100000
  print(ans)
Problem p02918 (python)

Fixed submission:
n,k=map(int,input().split())
s=input()
hap=0
if(n>1):
  for i in range(n):
    if(i==0):
      if(s[0]==s[1]=='R'):
        hap+=1
    elif(i==n-1):
      if(s[n-2]==s[n-1]=='L'):
        hap+=1
    else:
      if(s[i]==s[i+1]=='R' or s[i-1]==s[i]=='L'):
        hap+=1
print(min(hap+2*k,n-1))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
s=input()
hap=0
for i in range(n):
  if(i==0):
    if(s[0]==s[1]=='R'):
      hap+=1
  elif(i==n-1):
    if(s[n-2]==s[n-1]=='L'):
      hap+=1
  else:
    if(s[i]==s[i+1]=='R' or s[i-1]==s[i]=='L'):
      hap+=1
print(min(hap+2*k,n-1))
Problem p03087 (python)

Fixed submission:
n,q=map(int,input().split())
s=input()
a=[0]*n
k=0
for i in range(n-1):
  if(s[i]=='A' and s[i+1]=='C'):
    k+=1
  a[i]=k
for j in range(q):
  l,r=map(int,input().split())
  if(l==1):
    print(a[r-2])
  else:
    print(a[r-2]-a[l-2])

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=input()
a=[0]*n
k=0
for i in range(n):
  if(s[i]=='A' and s[i+1]=='C'):
    k+=1
  a[i]=k
for j in range(q):
  l,r=map(int,input().split())
  if(l==1):
    print(a[r-2])
  else:
    print(a[r-2]-a[l-2])
Problem p03962 (python)

Fixed submission:
a=list(map(int,input().split()))
ans=3
if a[0]==a[1] and a[1]==a[2]:
  ans=1
else:  
  for i in range(0,2):
    for j in range(i+1,3):
      if a[i]==a[j]:
        ans = 2
        break
      else:
        j += 1

print(ans)

Buggy submission (verdict: Runtime Error):
a=list(map(int,input().split()))
ans=3
　for i in range(0,2):
    for j in range(i+1,3):
      if a[i]==a[j]:
        ans -= 1
      else:
        j += 1

print(ans)
Problem p03993 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  b=a[i]
  if a[b-1] == i+1:
    ans += 1
  else:
    i += 1
print(int(ans/2))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  b=a[i]
  if a[b] = i:
    ans += 1
  else:
    i += 1
print(ans)
Problem p04030 (python)

Fixed submission:
s=input()
l=len(s)
a=[]
for i in range(l):
  if(s[i]=='B'):
    if(len(a)>=1):
      a=a[:len(a)-1]
  else:
    a.append(s[i])
x=("").join(a)
print(x)

Buggy submission (verdict: Runtime Error):
a=input()
ans=[]
count=0
for i in range(len(a)):
  if a[i] == "0" or a[i] == "1":
    ans.append(a[i])
    count += 1
  elif a[i] == "B" and count >= 1:
    ans.remove(a[count-1])
    count -= 1
  else:
    i += 1

print("".join(ans))
Problem p02789 (python)

Fixed submission:
s=list(input().split())

a=int(s[0])
b=int(s[1])

if a==b:
        d='Yes'
else:
        d='No' 
print(d)

Buggy submission (verdict: Runtime Error):
#①自分より左側に自分より小さい数字がいてはいけない。

N = int(input())
P = list(map(int, input().split()))  # 入力のときに N を使う必要はありません
count=0#①を満たさない個数をカウント

for i in  range(len(P)):
 for j in range (i):
  if P[j]<P[i]:
   count+=1
   break

print(len(P)-count)#①を満たす個数を算出

Buggy submission (verdict: Runtime Error):
#①自分より左側に自分より小さい数字がいてはいけない。

N = int(input())
P = list(map(int, input().split()))  # 入力のときに N を使う必要はありません
count=0#①を満たさない個数をカウント

for i in  range(len(P)):
 for j in range (i):
  if P[j]<P[i]:
   count+=1
   break

print(len(P)-count)#①を満たす個数を算出

Buggy submission (verdict: Runtime Error):
#①自分より左側に自分より小さい数字がいてはいけない。

N = int(input())
P = list(map(int, input().split()))  # 入力のときに N を使う必要はありません
count=0#①を満たさない個数をカウント

for i in  range(len(P)):
 for j in range (i):
  if P[j]<P[i]:
   count+=1
   break

print(len(P)-count)#①を満たす個数を算出
Problem p02841 (python)

Fixed submission:
a,b = map(int, input().split())
m,n = map(int, input().split())
c=0
d=1

if a==m:
 print(c)
else: 
 print(d)

Buggy submission (verdict: Runtime Error):
N = float(input())
x = N/1.08
x = int(x)
print(x)
Problem p02843 (python)

Fixed submission:
X = float(input())
p = int(X/100) #xが何百以上か判別する。
T=1 #TRUE
F=0 #FALSE
if p==0:
 print(F)

else:
 if X<=p*105:
  print(T)
 else:
  print(F)

Buggy submission (verdict: Runtime Error):
X = float(input())
p = int(N/100) #xが何百以上か判別する。
T=1 #TRUE
F=0 #FALSE
if p==0
 print(F)
 return 0

if X<=p*100:
 print(T)
else:
 print(F)
Problem p03068 (python)

Fixed submission:
N = int(input())
S = input()
K = int(input())
for i in range(N):
  if S[i] != S[K-1]:
    S = S.replace(S[i],'*')
print(S)

Buggy submission (verdict: Runtime Error):
r=int(input())
s=list(input())
t=int(input())
i=0
for i in range(r):
    if s[i]!=s[t]:
        s[i]=s[t]
          
print(s)
Problem p03493 (python)

Fixed submission:

s=list(input().split())
total=0

for digit in str(s):
 if digit=='1':
        total += 1

print(total)

Buggy submission (verdict: Runtime Error):

N = int(input())
s = list(map(int, input().split()))
a=[0]*N#N個の要素の配列
total=0

for i in range(N):
 a[i]=int(s[i])

while 1==1:
 b=0
 for i in range(N):
  if a[i]%2==0:
        a[i]=a[i]/2
        b+=1
 if b==N:
  total+=1
 else: 
  break

print(total)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = list(map(int, input().split()))
a=[0]*N#N個の要素の配列
b=0
total=0

for i in range(N):
 a[i]=int(s[i])

while 1==1:
 for i in range(N):
  if a[i]%2==0:
        a[i]=a[i]/2
        b+=1
 if b==N:
  total+=1
 else: 
  break

print(total)

Buggy submission (verdict: Runtime Error):

s=list(input().split())

a=int(s[0])
b=int(s[1])
c=int(s[2])
if a==1:
        d=1
else:
        d=0

if b==1:
        d+=1

if c==1:
        d+=1

 
print(d)
Problem p02900 (python)

Fixed submission:
def prime_factorize(n):
    a = [1]
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)
 
A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)
 
koyaku_insu = list(set(prime_factorize(koyaku)))
 
 
print(len(koyaku_insu))

Buggy submission (verdict: Runtime Error):
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
  def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)

A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)

koyaku_insu = prime_factorize(koyaku)


print(len(koyaku_insu))
Problem p02993 (python)

Fixed submission:
import sys
S = input()
tmp = ""
for i in S:
    if tmp == i:
        print("Bad")
        sys.exit()
    tmp = i
else:
    print("Good")

Buggy submission (verdict: Runtime Error):
import math
def Euclidean(x,y):
    if y == 0:
        return x
    else:
        return Euclidean(y,x%y)
         
A,B,C,D = [int(x) for x in input().split()]
count = B - A + 1
E = Euclidean(C,D)
F = C*D/E
         
C_ = math.floor(B/C) - math.floor((A-1)/C)
D_ = math.floor(B/D) - math.floor((A-1)/D)
C_and_D = math.floor(B/F) - math.floor((A-1)/F)
print(count - int(C_ + D_ - C_and_D))

Buggy submission (verdict: Runtime Error):
import math
    def Euclidean(x,y):
        if y == 0:
            return x
        else:
            return Euclidean(y,x%y)
     
A,B,C,D = [int(x) for x in input().split()]
count = B - A + 1
E = Euclidean(C,D)
F = C*D/E
     
C_ = math.floor(B/C) - math.floor((A-1)/C)
D_ = math.floor(B/D) - math.floor((A-1)/D)
C_and_D = math.floor(B/F) - math.floor((A-1)/F)
print(count - int(C_ + D_ - C_and_D))
Problem p02994 (python)

Fixed submission:
N,L = [int(x) for x in input().split()]
A = list(range(L,L+N))
Min = 100
for i in A:
    if Min >= abs(i):
        youso = i
        Min = abs(i)
A.remove(youso)
print(sum(A))

Buggy submission (verdict: Runtime Error):
N,L = [int(x) for x in input().split()]
A = list(range(L,L+N))
Min = 100
for i in A:
    if Min > abs(i):
        youso = i
        Min = abs(i)
A.remove(youso)
print(sum(A))

Buggy submission (verdict: Runtime Error):
N,L = [int(x) for x in input().split()]
A = list(range(L,L+N))
Min = 100
for i in A:
    if Min > abs(i):
        youso = i
        Min = abs(i)

A.remove(youso)
print(sum(A))
Problem p02995 (python)

Fixed submission:
import math
def Euclidean(x,y):
    if y == 0:
        return x
    else:
        return Euclidean(y,x%y)

A,B,C,D = [int(x) for x in input().split()]
count = B - A + 1
E = Euclidean(C,D)
F = int(C*D/E)

C_ = B//C - (A-1)//C
D_ = B//D - (A-1)//D
C_and_D = B//F - (A-1)//F
print(count - (C_ + D_ - C_and_D))

Buggy submission (verdict: Runtime Error):
    import math
    def Euclidean(x,y):
        if y == 0:
            return x
        else:
            return Euclidean(y,x%y)
     
    A,B,C,D = [int(x) for x in input().split()]
    count = B - A + 1
    E = Euclidean(C,D)
    F = C*D/E
     
    C_ = math.floor(B/C) - math.floor((A-1)/C)
    D_ = math.floor(B/D) - math.floor((A-1)/D)
    C_and_D = math.floor(B/F) - math.floor((A-1)/F)
    print(count - int(C_ + D_ - C_and_D))

Buggy submission (verdict: Runtime Error):
import math
def Euclidean(x,y):
    if y == 0:
        return x
    else:
        return Euclidean(y,x%y)

A,B,C,D = [int(x) for x in input().split()]
count = B - A + 1
E = Euclidean(C,D)
F = C*D/E

C_ = math.floor(B/C) - math.ceil(A/C) + 1
D_ = math.floor(B/D) - math.ceil(A/C) + 1
C_and_D = math.floor(B/F) - math.ceil(A/F) + 1
print(count - (C_ + D_ -C_and_D)):
Problem p03000 (python)

Fixed submission:
N,X = [int(i) for i in input().split()]
W = []
for j in input().split():
    W.append(j)

count = 1
Sum = 0
while Sum <= X and count < N + 2:
    if count < N + 1:
        Sum += int(W.pop(0))
    count += 1
print(count-1)

Buggy submission (verdict: Runtime Error):
N,X = [int(i) for i in input().split()]
W = []
for j in input().split():
    W.append(j)

count = 0
Sum = 0
while Sum <= X:
    Sum += int(W.pop(0))
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N,X = [int(i) for i in input().split()]
W = []
W = list(map(int, input().split()))
count = 0
Sum = 0
while Sum <= X:
    Sum += W.pop(0)
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N,X = [int(i) for i in input().split()]
W = []
W = list(map(int,input().split()))
count = 0
Sum = 0
while Sum <= X:
    Sum += W.pop(0)
    count += 1

print(count)