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

Fixed submission:
def main():
    s = input()
    s1 = s[:int((len(s)-1)/2)]
    s2 = s[int((len(s)+3)/2-1):]
    rs = s[::-1]
    rs1 = s1[::-1]
    rs2 = s2[::-1]


    if s1 == rs1 and s2 == rs2 and s == rs:
        print("Yes")
    else:
        print("No")
    
    return
    
main()

Buggy submission (verdict: Runtime Error):
def main():
    s = input()
    s1 = s[:int((len(s)-1)/2)]
    s2 = s[int((len(s)+3)/2-1):]
    rs1 = s1[::-1]
    rs2 = s2[::-1]

    if s1 == rs1 and s2 == rs2:
        print("Yes")
    else:
        print("No")
    
    return
    
main()
a
Problem p02667 (python)

Fixed submission:
t = input()
before_is_zero = True
keeped_ones = 0
n0 = 0
ones = [0] * int(1e5+1) # (number of zeros before 1, is_odd)
ones_index = 0
for i, x in enumerate(t):
    if x == '0':
        n0 += 1
        before_is_zero = True
    elif x == '1':
        if before_is_zero:
            ones[ones_index] = (n0, (i+1)%2)
            ones_index += 1
            before_is_zero = False
        else:
            keeped_ones += 1
            ones_index -= 1
            before_is_zero = True

if before_is_zero:
    if len(ones) > 0:
        ones = ones[:-1]

ans = keeped_ones * n0
for i in range(ones_index):
    n0_before, is_odd = ones[i]
    ans += (n0_before + is_odd)//2 + (n0 - n0_before)
ans += (keeped_ones + (ones_index+1)//2) * (keeped_ones + ones_index//2 + 1)
print(ans)

Buggy submission (verdict: Runtime Error):
t = input()
before_is_zero = True
keeped_ones = 0
n0 = 0
ones = [0] * int(1e5) # (number of zeros before 1, is_odd)
ones_index = 0
for i, x in enumerate(t):
    if x == '0':
        n0 += 1
        before_is_zero = True
    elif x == '1':
        if before_is_zero:
            ones[ones_index] = (n0, (i+1)%2)
            ones_index += 1
            before_is_zero = False
        else:
            keeped_ones += 1
            ones_index -= 1
            before_is_zero = True
if before_is_zero:
    if len(ones) > 0:
        ones = ones[:-1]

ans = keeped_ones * n0
for i in range(ones_index):
    n0_before, is_odd = ones[i]
    ans += (n0_before + is_odd)//2 + (n0 - n0_before)
ans += (keeped_ones + (ones_index+1)//2) * (keeped_ones + ones_index//2 + 1)
print(ans)

Buggy submission (verdict: Runtime Error):
t = input()
keep = True
keeped_ones = 0
n0 = 0
ones = [0] * int(1e5) # (number of zeros before 1, is_odd)
ones_index = 0
for i, x in enumerate(t):
    if x == '0':
        n0 += 1
        keep = True
    elif x == '1':
        if keep:
            ones[ones_index] = (n0, (i+1)%2)
            ones_index += 1
            keep = False
        else:
            keeped_ones += 1
            ones_index -= 1
            keep = True
if keep:
    ones = ones[:-1]

ans = keeped_ones * n0
for i in range(ones_index):
    n0_before, is_odd = ones[i]
    ans += (n0_before + is_odd)//2 + (n0 - n0_before)
ans += (keeped_ones + (ones_index+1)//2) * (keeped_ones + ones_index//2 + 1)
print(ans)

Buggy submission (verdict: Runtime Error):
t = open(0)[0][:-1]
keep = True
keeped_ones = 0
n0 = 0
ones = [] # (number of zeros before 1, is_odd)
for i, x in enumerate(t):
    if x == '0':
        n0 += 1
        keep = True
    elif x == '1':
        if keep:
            ones.append((n0, (i+1)%2))
            keep = False
        else:
            keeped_ones += 1
            ones = ones[:-1]
            keep = True

ans = keeped_ones * n0
for n0_before, is_odd in ones:
    ans += (n0_before + is_odd)//2 + (n0 - n0_before)
ans += (keeped_ones + (len(ones)+1)//2) * (keeped_ones + len(ones)//2 + 1)
print(ans)
Problem p02795 (python)

Fixed submission:
h, w, n = [list(map(int, s.split()))[0] for s in open(0)]
print(min(int((n-1)//h+1), int((n-1)//w+1)))

Buggy submission (verdict: Runtime Error):
h, w, n = [list(map(int, s.split()))[0] for s in open(0)]
print min(int((n-1)//h+1), int((n-1)//w+1))
Problem p02883 (python)

Fixed submission:
import math
(n,k),a,f = [list(map(int, s.split())) for s in open(0)]

a.sort()
f.sort(reverse=True)

low = 0
high = 0
for x, y in zip(a,f):
    high = max(high, x*y)

while high != low:
    test = int((high + low) // 2)
    tmp = 0
    for x, y in zip(a,f):
        tmp += max(0, x - math.floor(test / y))
        if tmp > k:
            low = test + 1
            break
    else:
        high = test
print(high)

Buggy submission (verdict: Runtime Error):
import bisect
import math
(n,k),a,f = [list(map(int, s.split())) for s in open(0)]

if n == 1:
    ans = max((a[0] - k) * f[0], 0)
    print(ans)

else:
    a.sort()
    f.sort(reverse=True)
    s = []
    t = []
    for x,y in zip(a,f):
        s.append((x*y, y))
    s.sort()

    while len(s) > 0:
        t.append(s[-1])
        tmp = 0
        for l, y in t:
            tmp += max(1, math.ceil((l - s[-2][0]) / y))
        if k <= tmp:
            t = t[:-1]
            break
        s = s[:-1]
    
    for l, y in t:
        tmp = max(1, math.ceil((l - s[-1][0]) / y))
        k -= tmp
        l -= tmp * y
        bisect.insort(s, (l, y))
    
    while k > 0 and s[-1][0] > 0:
        l, y = s[-1]
        s = s[:-1]
        tmp = math.ceil((l - s[-1][0]) / y)
        if tmp == 0:
            tmp = 1
        if k > tmp:
            k -= tmp
        else:
            tmp = k
            k = 0
        l = l - tmp * y
        bisect.insort(s, (l, y))
    print(s[-1][0])
Problem p02904 (python)

Fixed submission:
import numpy as np
import heapq

(n,k),p = [list(map(int, s.split())) for s in open(0)]

p_np = np.array(p)
p_cumsum = (p_np[1:]>p_np[:-1]).cumsum()

c = [False] * n

_min = p[:k].copy()
_max = [-x for x in p[:k]]
heapq.heapify(_min)
heapq.heapify(_max)

ans = n - k + 1
no_change = False
if p_cumsum[k-2]==k-1:
    no_change = True

for i in range(n-k):
    decrease = False
    
    heapq.heappush(_min, p[i+k])
    heapq.heappush(_max, -p[i+k])
    
    while c[_min[0]]:
        heapq.heappop(_min)
    while c[-_max[0]]:
        heapq.heappop(_max)
    
    if (_min[0]==p[i] and -_max[0]==p[i+k]):
        ans -= 1
        decrease = True
    
    c[p[i]] = True
    
    if p_cumsum[i]+k-1 == p_cumsum[i+k-1]:
        if no_change and not decrease:
            ans -= 1
        no_change = True

print(ans)

Buggy submission (verdict: Runtime Error):
%%time
import numpy as np
(n,k),p = [list(map(int, s.split())) for s in open(0)]
p = np.array(p)

p_isordered = p[1:]>p[:-1]
p_cumsum = p_isordered.cumsum()

ans = n - k + 1
no_change = False
if p_isordered[:k-1].all():
    no_change = True

for i in range(n-k):
    dec = False
    q = p[i:i+k+1]
    if p_cumsum[i]+k-1 == p_cumsum[i+k-1]:
        if no_change and not dec:
            ans -= 1
        no_change = True

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
p = np.array(p)

p_isorder = p[1:]>p[:-1]

ans = n - k + 1
no_change = False
if p_isorder[:k-1].all():
    no_change = True

for i in range(n-k):
    dec = False
    q = p[i:i+k+1]
    if (q.argmin()==0 and q.argmax()==k):
        ans -= 1
        dec = True
    
    if p_isorder[i+1:i+k].all():
        if no_change and not dec:
            ans -= 1
        no_change = True

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
p = np.array(p)

p_isorder = p[1:]>p[:-1]

ans = n - k + 1
no_change = False
for j in range(k-1):
    if not p_isorder[i+j]:
        break
else:
    no_change = True

for i in range(n-k):
    dec = False
    q = p[i:i+k+1]
    if (q.argmin()==0 and q.argmax()==k):
        ans -= 1
        dec = True
    
    for j in range(k-1):
        if not p_isorder[i+j+1]:
            break
    else:
        if no_change and not dec:
            ans -= 1
        no_change = True

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
p = np.array(p)

ans = n - k + 1
no_change = False
for j in range(k-1):
    if p[j] > q[j+1]:
        break
else:
    no_change = True


for i in range(n-k):
    dec = False
    q = p[i:i+k+1]
    if (q.argmin()==0 and q.argmax()==k):
        ans -= 1
        dec = True
    for j in range(1,k):
        if q[j] > q[j+1]:
            break
    else:
        if no_change and not dec:
            ans -= 1
        no_change = True

print(ans)
Problem p03040 (python)

Fixed submission:
from heapq import heappush, heappop

num_q = int(input())
x = 0
f = 0
low = []
high = []
odd = False
num_a = 0
 
for _ in range(num_q):
  q = input()
  if q[0] == '2':
    print(x, f)
  else:
    _, n, m = map(int, q.split(" "))
    if odd:
      if n >= -low[0]:
        f += m + n + low[0]
        heappush(high, n)
      else:
        f += m - n - low[0]
        heappush(low, -n)
        heappush(high, -heappop(low))
    else:
      f += m
      if num_a == 0:
        heappush(low, -n)
      else:
        if n > -low[0]:
          if n > high[0]:
            f += n - high[0]
          heappush(high, n)
          heappush(low, -heappop(high))
        else:
          f += - n - low[0]
          heappush(low, -n)

    odd = ~odd
    x = -low[0]
    num_a += 1

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

num_q = int(input())
x = 0
f = 0
a = []
c = False
b = 0

for b in range(num_q):
  q = input()
  if q[0] == '2':
    print(x, f)
  else:
    _, n, m = map(int, q.split(" "))
    a.append(n)
    a.sort()
    x_tmp = a[b//2]
    if c:
      f += m + np.abs(x - n)
    else:
      f += m + np.abs(x_tmp - n)
    c = ~c
    x = x_tmp
    b += 1

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

num_q = int(input())
x = 0
f = 0
a = []
c = False

for i in range(num_q):
  q = input()
  if q[0] == '2':
    print(x, f)
  else:
    _, n, m = map(int, q.split(" "))
    a.append(n)
    a.sort()
    x_tmp = a[(i+1)//2]
    if c:
      f += m + np.abs(x - n)
    else:
      f += m + np.abs(x_tmp - n)
    c = ~c
    x = x_tmp
Problem p02713 (python)

Fixed submission:
import math
K=int(input())
total = 0

for a in range(1,K+1):
  for b in range(a+1,K+1):
    for c in range(b+1,K+1):
      total += math.gcd(a, math.gcd(b,c) ) * 6
      
for a in range(1,K+1):
  for b in range(a+1,K+1):
    total += math.gcd(a, b)*6

for a in range(1,K+1):
  total += a

print(total)

Buggy submission (verdict: Runtime Error):
import fractions
K=int(input())
total = 0

for a in range(K):
  for b in range(a,K):
    for c in range(b,K):
      total += fractsion.gcd(a+1, fractions.gcd(b+1,c+1) )
total *= 6

for a in range(K):
  for b in range(a,K):
    total += fractions.gcd(a+1, b+1)
total *= 6

for a in range(K):
  total += (a+1)

print(total)
Problem p02724 (python)

Fixed submission:
import math
X=int(input())
A=math.floor(X/500)*1000+math.floor(X%500/5)*5
print('{:.0f}'.format(A))

Buggy submission (verdict: Runtime Error):
X=int(input())
print(print('{:.0f}'.format(round(X/500)*1000+round(rem(X/500)/5)*5)))
Problem p02767 (python)

Fixed submission:
N=int(input())
X=list(map(int, input().split()))
"""
minX=min(X)
maxX=max(X)
"""
minE = 1000000000
for P in range(101):
  sum = 0
  for Xi in X:
    sum = sum + (Xi-P)**2
  if minE>sum:
    minE=sum
print(minE)

Buggy submission (verdict: Runtime Error):
N=int(input())
X=list(map(int, input().split()))
minX=min(X)
maxX=max(X)
minE = 1000000000
for P in range(minX,maxX):
  sum = 0
  for i in X:
    sum = sum + (X[i]-P)**2
  if minE>sum:
    minE=sum
print(minE)
Problem p02772 (python)

Fixed submission:
N=int(input())
As=list(map(int, input().split()))
rejected=False
for A in As:
  if A%2==0:
    if A%3*(A%5)!=0:
      rejected=True
if rejected:
  print("DENIED")
else:
  print("APPROVED")

Buggy submission (verdict: Runtime Error):
N=int(input())
As=list(map(int, input().split()))
rejected=false
for A in As:
  if A%2==0:
    if A%3*(A%5)!=0:
      rejected=true
if rejected:
  print("DENIED")
else:
  print("APPROVED")
Problem p02789 (python)

Fixed submission:
N,M=map(int, input().split())
if N==M:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N,M=map(int, input().split())
if N==m:
  print('Yes')
else:
  print('No')
Problem p02830 (python)

Fixed submission:
N=int(input())
S,T=map(str, input().split())
ans = ""
for i in range(N):
  ans = ans + S[i] + T[i]
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
S,T=str(int, input().split())
ans = ""
for i in range(N):
  ans = ans + S[i] + T[i]
print(ans)
Problem p02848 (python)

Fixed submission:
N=int(input())
S=str(input())
letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""
for i in range(len(S)):
  ans = ans + letters[(letters.index(S[i])+N)%26]
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=str(input())
letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(len(S)):
  S[i] = (letters.index(S[i])+N)%26
print(S)
Problem p02899 (python)

Fixed submission:
N=int(input())
As=list(map(int, input().split()))
man = [""] * N
for i in range(N):
  man[As[i]-1] = str(i+1)
result = ' '.join(man)
print(result)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int, input().split()))
l = [0] * N
ans = ""
for i in range(N):
  sys.stdout.write(A.index(i+1)+1)
  sys.stdout.write(" ")

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int, input().split()))
str = ""
for i in range(N):
  str += str(A.index(i+1)+1) + " "
Problem p02934 (python)

Fixed submission:
N=int(input())
A=list(map(int, input().split()))
ans = 0
for i in range(N):
  ans = ans + 1/A[i]
print(1/ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=map(int, input().split())
ans = 0
for i in range(N):
  ans = ans + 1/A[i]
print(1/ans)
Problem p02945 (python)

Fixed submission:
a,b=map(int, input().split())
print(max([a+b,a-b,a*b]))

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
print(max[a+b,a-b,a*b])
Problem p02981 (python)

Fixed submission:
n,a,b=map(int, input().split())
print(min([a*n,b]))

Buggy submission (verdict: Runtime Error):
n,a,b=map(int, input().split())
print(min([a*n,b])

Buggy submission (verdict: Runtime Error):
n,a,b=map(int, input().split())
print(max([a*n,b])
Problem p03000 (python)

Fixed submission:
N,X=map(int, input().split())
L=list(map(int, input().split()))
L.append(0)


d = 0
count = 0

#跳ねる直前からスタート

for i in range(1, N+2):
  if d <= X:
    count = count + 1
    d = d + L[i-1]

print(count)

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

d = 0
count = 0

跳ねる直前からスタート

for i in range(1, N+2):
  if d <= X:
    count = count + 1
    d = d + L[i-1]

print(count)

Buggy submission (verdict: Runtime Error):
N,X=map(int, input().split())
L=list(map(int, input().split()))
distance = 0
count = 0
while distance <= X and count <= N:
  distance = distance + L[count]
  count = count + 1
print(count)

Buggy submission (verdict: Runtime Error):
N,X=map(int, input().split())
L=list(map(int, input().split()))
count = 0
x=0
while x <= X and count <= N:
  x = x + L[count]
  count = count + 1
print(count)

Buggy submission (verdict: Runtime Error):
N,X=map(int, input().split())
L=list(map(int, input().split()))
count = 0
x=0
while x <= X and count <= N+1:
  x = x + L[count]
  count = count + 1
print(count)
Problem p03029 (python)

Fixed submission:
import math
A,P=map(int, input().split())
print(math.floor((3*A+P)/2))

Buggy submission (verdict: Runtime Error):
import math
A,P=map(int, input().split())
print(math.floor((3*a+P)/2))
Problem p03060 (python)

Fixed submission:
import numpy as np
N=int(input())
X=list(map(int, input().split()))
Y=list(map(int, input().split()))
Z=np.zeros(N)
for i in range(N):
  Z[i]=X[i]-Y[i]
print('{:.0f}'.format(sum(Z[np.where(Z>0)])))

Buggy submission (verdict: Runtime Error):
N=int(input())
X=list(map(int, input().split()))
Y=list(map(int, input().split()))
Z=X-Y
Z=Z[Z>0]
print(sum(Z))
Problem p03071 (python)

Fixed submission:
a,b=map(int, input().split())
if a==b:
  print(a*2)
else:
  print(max([a,b])*2-1)

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
if a==b:
  print(a*2)
else:
  print(max([a,b])*2-1
Problem p03085 (python)

Fixed submission:
n=str(input())
if n=="A":
  print("T")
if n=="T":
  print("A")
if n=="C":
  print("G")
if n=="G":
  print("C")

Buggy submission (verdict: Runtime Error):
n=int(input())
if n=="A":
  print("T")
if n=="T":
  print("A")
if n=="C":
  print("G")
if n=="G":
  print("C")
Problem p03102 (python)

Fixed submission:
N,M,C=map(int, input().split())
B=list(map(int, input().split()))
count = 0
for i in range(N):
  A=list(map(int, input().split()))
  hyoka = 0
  for k in range(M):
    hyoka = hyoka + A[k]*B[k]
  if hyoka+C > 0:
    count = count + 1
print(count)

Buggy submission (verdict: Runtime Error):
N,M,C=map(int, input().split())
B=list(map(int, input().split()))
count = 0
for i in range(N):
  A=list(map(int, input().split()))
  hyoka = 0
  for k in range(M):
    hyoka = hyoka + A[k]*B[k]
  if hyoka+C > 0:
    count = cocunt + 1
print(count)
Problem p03109 (python)

Fixed submission:
S=str(input())
if int(S[5:7])<5:
  print("Heisei")
else:
  print('TBD')

Buggy submission (verdict: Runtime Error):
S=str(input())
if int(str[5:7])<5:
  print("Heisei")
else:
  print('TBD')
Problem p03110 (python)

Fixed submission:
N=int(input())
total = 0
for i in range(N):
  x,u=input().split()
  total = total + float(x) * [1,380000.0][u=="BTC"]
print(total)

Buggy submission (verdict: Runtime Error):
def kansan(a,b):
  if b=="BTC":
    return a*380000
  else:
    return a

n=int(input())
total = 0
for i in range(n):
  a,b=map(str, input().split())
  total = total + kansan(int(a),b)
print(total)
Problem p03126 (python)

Fixed submission:
import numpy as np
N,M=map(int, input().split())
tabelist = np.zeros(M)
for i in range(N):
  c=list(map(int, input().split()))
  for k in range(1,c[0]+1):
    tabelist[c[k]-1] = tabelist[c[k]-1] + 1
#    print(i,k,tabelist)
print(len([1 for x in tabelist if x==N]))

Buggy submission (verdict: Runtime Error):
import numpy as np
N,M=map(int, input().split())
tabelist = np.zeros(N)
for i in range(N):
  c=list(map(int, input().split()))
  for k in range(1,c[0]+1):
    tabelist[c[k]-1] = tabelist[c[k]-1] + 1
#    print(i,k,tabelist)
print(len([1 for x in tabelist if x==N]))

Buggy submission (verdict: Runtime Error):
import numpy as np
N,M=map(int, input().split())
tabelist = np.zeros(N)
for i in range(N):
  c=list(map(int, input().split()))
  for k in range(1,c[0]):
    tabelist[k-1] = tabelist[k-1] + 1
print(len([1 for x in tabelist if x==N]))
Problem p03145 (python)

Fixed submission:
a,b,c=map(int, input().split())
print('{:.0f}'.format(a*b/2))

Buggy submission (verdict: Runtime Error):
a,b,c=map(int, input().split())
print('{:．0f}'．format(a*b/2))
Problem p03251 (python)

Fixed submission:
N,M,X,Y=map(int, input().split())
Xs=list(map(int, input().split()))
Ys=list(map(int, input().split()))
if max([X,max(Xs)]) < min([Y,min(Ys)]):
  print("No War")
else:
  print("War")

Buggy submission (verdict: Runtime Error):
N,M,X,Y=map(int, input().split())
Xs=list(map(int, input().split()))
Ys=list(map(int, input().split()))
if max([X,Xs]) < min([Y,Ys]):
  print("No War")
else:
  print("War")
Problem p03273 (python)

Fixed submission:
def rotate(mat):
  mat2 = []
  for i in range(len(mat[0])):
    s = ""
    for k in range(len(mat)):
      s = s + mat[k][i]
    mat2.append(s)
  return mat2

H,W=map(int, input().split())
mat = []
for i in range(H):
  a = input()
  if "#" in a:
    mat.append(a)

for count in range(H+W):
  for i in range(len(mat)-1, -1, -1):
    if not "#" in mat[i]:
      del mat[i]
  mat = rotate(mat)
  for i in range(len(mat)-1, -1, -1):
    if not "#" in mat[i]:
      del mat[i]
  mat = rotate(mat)
  
for i in range(len(mat)):
  print(mat[i])

Buggy submission (verdict: Runtime Error):
def oneCol(mat,n):
  ans = ""
  for i in range(len(mat)):
    ans = ans + mat[i][n]
  return ans

def strCut(s,n):
  return s[0:n] + s[n+1:len(s)]

def lowCut(mat):
  for i in range(len(mat)):
    if not "#" in mat[len(mat)-i-1]:
      delete mat[len(mat)-i-1]
  return mat

def colCut(mat):
  for i in range(len(mat[0])):
    if not "#" in oneCol(mat,len(mat[0])-i-1):
      mat2 = []
      for k in range(len(mat)):
        mat2.append(strCut(mat[k],len(mat[0])-i-1))
  return mat
      

H,W=map(int, input().split())
s_list = []
for i in range(H):
  s = input()
  if "#" in s: s_list.append(s)

    
while True:
  lowCut(mat)
  colCut(mat)
  print(mat)

Buggy submission (verdict: Runtime Error):
H,W=map(int, input().split())
masu_list = []
for i in range(H):
  S=str(input())
  if S.count('#') != 0:
    masu_list.append(S)

yet = True
while yet:
  for i in range(len(masu_list[0])):
    if masu_list[i].count('#') == 0:
      masu_list.delete(i,1)
Problem p03281 (python)

Fixed submission:
import math
def countYakusu(n):
  count = 0
  for i in range(n):
    if n % (i+1) == 0:
      count = count + 1
#      print(n,i+1)
#  if count == 8: print(n)
  return count == 8

N = int(input())
count = 0
for i in range(math.ceil(N/2)):
  count = count + countYakusu(i*2+1)
#  print(i*2+1)
print(count)

Buggy submission (verdict: Runtime Error):
import math
def countYakusu(n):
  count = 0
  for i in range(math.floor(n**0.5)):
    if n % i == 0:
      count = count + 1
  return count == 8

N = int(input())
count = 0
for i in range(math.floor(N/2)):
  count = count + countYakusu(i*2+1)
print(count)
Problem p03289 (python)

Fixed submission:
S=str(input())
letter="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
condition1 = S[0]=='A'
condition2 = len([1 for x in S[2:len(S)-1] if x=="C"]) == 1
count=0
for i in range(len(S)):
  if len([1 for x in letter if x==S[i]]) == 1:
    count = count + 1
condition3 = count == 2
if condition1 & condition2 & condition3:
  print('AC')
else:
  print('WA')

Buggy submission (verdict: Runtime Error):
S=str(input())
letter="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
condition1 = S[0]=='A'
condition2 = len([1 for x in S[2:len(S)-1] if x=="C"]) == 1
count=0
for i in len(S):
  if len([1 for x in letter if x==S[i]]) == 1:
    count = count + 1
condition3 = count == 2
if condition1 & condition2 & condition3:
  print('AC')
else:
  print('WA')

Buggy submission (verdict: Runtime Error):
S=str(input())
letter="ABCDEFGHIJKLMNO"
condition1 = S[0]=='A'
condition2 = len([1 for x in S[2:len(S)-1] if x=="C"]) == 1
condition3 = len([1 for x in S if len([1 for y in letter if y>10])==1]) == 2
if condition1 & condition2 & condition3:
  print('AC')
else:
  print('WA')
Problem p03293 (python)

Fixed submission:
S1=str(input())
S2=str(input())
NG = True
for i in range(len(S1)):
  if S1 == S2[i:len(S1)]+S2[0:i]:
    print('Yes')
    NG = False
    break
if NG:
  print('No')

Buggy submission (verdict: Runtime Error):
import sys
S1=str(input())
S2=str(input())
NG = False
for i in range(len(S1)):
  S1.append(S1[0])
  del S1[0]
  if S1 == S2:
    print('Yes')
    NG = True
    break
if NG:
  print('No')

Buggy submission (verdict: Runtime Error):
S1=str(input())
S2=str(input())
for i in range(len(S1)):
  S1.append(S1[0])
  del S1[0]
  if S1 == S2:
    print('Yes')
    return
print('No')

Buggy submission (verdict: Runtime Error):
import sys
S1=str(input())
S2=str(input())
for i in range(len(S1)):
  S1.append(S1[0])
  del S1[0]
  if S1 == S2:
    print('Yes')
    sys.exit()
print('No')