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

Fixed submission:
a,b,c,d = map(int,input().split())
if abs(a-c) <= d or (abs(b-a)<=d and abs(b-c)<=d):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
p = list(map(int,input().split()))
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
uf = UnionFind(n)
for i in range(m):
    x,y = map(int,input().split())
    uf.union(x-1,y-1)
ans = 0
for i in range(n):
    if uf.find(i) == uf.find(p[i]-1):
        ans += 1
print(ans)
Problem p03651 (python)

Fixed submission:
from fractions import gcd
n,k = map(int,input().split())
a = list(map(int,input().split()))
g = a[0]
for i in range(n):
  g = gcd(g,a[i])
if k%g == 0 and k <= max(a):
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
from fractions import gcd
n,k = map(int,input().split())
a = list(map(int,input().split()))
g = a[0]
for i in range(n):
  g = gcd(g,a[1])
if k%g == 0 and k <= max(a):
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")
Problem p03071 (python)

Fixed submission:
A,B = map(int,input().split())
a = max(A,B)
b = min(A,B)
t = a - b
if t <= 1:
  print(a + b)
else:
  print(a + a - 1)

Buggy submission (verdict: Runtime Error):
A,B = (int(i) for i in input().split)
a = max(A,B)
b = min(A,B)
t = a - b
if t <= 1:
  print(a + a - 1)
else:
  print(a + b)
Problem p03076 (python)

Fixed submission:
# B
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
 
a = (10 - A) % 10
b = (10 - B) % 10
c = (10 - C) % 10
d = (10 - D) % 10
e = (10 - E) % 10
 
print(A+B+C+D+E+a+b+c+d+e-max([a,b,c,d,e]))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
list1 = [a,b,c,d,e]
list2 = ["a","b","c","d","e"]
list3 = {}
 
for i,j in zip(list1,list2):
  i = i - 1
  sum = 1
  if i % 10 == 0:
    i = sum
  else:
    pass
  sum += 1
  list3[j] = sum
list3.sort()
list3.values()
    
  
def pri(kan):
  if kan <= 10:
    return 10
  if kan > 10 and kan <=20:
    return 20
  if kan > 20 and kan <=30:
    return 30
  if kan > 30 and kan <=40:
    return 40
  if kan > 40 and kan <=50:
    return 50
  if kan > 50 and kan <=60:
    return 60
  if kan > 60 and kan <=70:
    return 70
  if kan > 70 and kan <=80:
    return 80
  if kan > 80 and kan <=90:
    return 90
  if kan > 90 and kan <=100:
    return 100
  if kan > 100 and kan <=110:
    return 110
  if kan > 110 and kan <=120:
    return 120
  if kan > 120 and kan <=130:
    return 130
  if kan > 130 and kan <=140:
    return 140
A = pri(list3[4])
B = pri(list3[3])
C = pri(list3[2])
D = pri(list3[1])
E = list3[0]
print(A+B+C+D+E)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
list1 = [a,b,c,d,e]
list2 = ["a","b","c","d","e"]
list3 = {}

for i,j in zip(list1,list2):
  i = i - 1
  sum = 1
  if i % 10 = 0:
    i = sum
  else:
    pass
  sum += 1
  list3[j] = sum
list3.sort()
list3.values()
    
  
def pri(kan):
  if kan <= 10:
    return 10
  if kan > 10 and kan <=20:
    return 20
  if kan > 20 and kan <=30:
    return 30
  if kan > 30 and kan <=40:
    return 40
  if kan > 40 and kan <=50:
    return 50
  if kan > 50 and kan <=60:
    return 60
  if kan > 60 and kan <=70:
    return 70
  if kan > 70 and kan <=80:
    return 80
  if kan > 80 and kan <=90:
    return 90
  if kan > 90 and kan <=100:
    return 100
  if kan > 100 and kan <=110:
    return 110
  if kan > 110 and kan <=120:
    return 120
  if kan > 120 and kan <=130:
    return 130
  if kan > 130 and kan <=140:
    return 140
A = pri(list3[4])
B = pri(list3[3])
C = pri(list3[2])
D = pri(list3[1])
E = list3[0]
print(A+B+C+D+E)
Problem p03079 (python)

Fixed submission:
A,B,C = (int(i) for i in input().split())
 
if A == B == C:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A,B,C = (int(i) for i in input().split())
 
if A = B and B = C:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A,B,C = (int(i) for i in input().split())

if A = B = C:
  print("Yes")
else:
  print("No")
Problem p03080 (python)

Fixed submission:
N = int(input())
S = input()
s = list(S)
 
cou = s.count("R")
if cou > N / 2:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
s = list(s)

cou = s.count("R")
if cou > N / 2:
  print("Yes")
else:
  print("No")
Problem p02628 (python)

Fixed submission:
number = input().split(" ")
N = int(number[0])
K = int(number[1])
 
list = []
numbers = input().split(" ")
for i in numbers:
    list.append(int(i))
list.sort()
 
a = 0
 
for i in range(K):
	a += int(list[i])
print(a)

Buggy submission (verdict: Runtime Error):
number = input().split(" ")
N = int(number[0])
K = int(number[1])

numbers = input().split(" ")
numbers.sotr()

a = 0

for i in range(K):
	a += numbers[i]
print(a)
Problem p02812 (python)

Fixed submission:
N = int(input())
words = input()
ans = 0
for i in range(N-2):
    if words[i] == "A":
        if words[i+1] == "B":
            if words[i+2] == "C":
                ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
words = input()
ans = 0
for i, word in enumerate(words):
	if word == "A":
		if words[i+1] == "B":
			if words[i+2] == "C":
				ans += 1
print(ans)
Problem p03029 (python)

Fixed submission:
import math

number = input().split(" ")
A = int(number[0])
P = int(number[1])
apple = (A * 3) + P
print(math.floor(apple / 2))

Buggy submission (verdict: Runtime Error):
number = input().split(" ")
A = int(number[0])
P = int(number[1])
apple = (A * 3) + P
print(math.floor(apple / 2))
Problem p03035 (python)

Fixed submission:
number = input().split(" ")
A = int(number[0])
B = int(number[1])
if A >= 13:
	print(B)
elif 6 <= A < 13:
	print(int(B/2))
else:
	print(0)

Buggy submission (verdict: Runtime Error):
number = input().split(" ")
A = int(number[0])
B = int(number[1])
if A >= 13:
	print(B)
elif 6 =< A < 13:
	print(B/2)
else:
	print(0)
Problem p02706 (python)

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

print(max(n - sum(a), - 1))

Buggy submission (verdict: Runtime Error):
n , m = map(int, input().split())
a = list(map(int, input().split()))
print(max(n - sum(a)), -1)
Problem p02719 (python)

Fixed submission:
n,k =map(int, input().split())
m = n % k
print(min(m, k - m))

Buggy submission (verdict: Runtime Error):
a,b =map(int, input().split())
m = a % k
print(min(m, k - m))

Buggy submission (verdict: Runtime Error):
a,b =map(int, input().split())
m = a % k
print(min(m, k - m))

Buggy submission (verdict: Runtime Error):
a,b =map(int, input().split())
m = a % k
print(min(m, k - m))
Problem p02584 (python)

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

ans = 0
count = X // D



if X >= 0:
    if K <= count:
        ans = X - D * K
    else:
        ans = X - D * count
        if ((K - count) % 2 == 1):
            ans = ans - D
else:
    if K <= (-1) * count:
        ans = X + D * K
    elif X % D == 0:
        ans = X - D * count 
        if ((K + count) % 2 == 1):
            ans = ans + D
    else:
        ans = X - D * (count + 1) 
        if ((K + count + 1) % 2 == 1):
            ans = ans + D

if ans < 0:
    ans = ans * (-1)

print(ans)

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

ans = 0
count = X // D
if X >= 0:
    if K <= count:
        ans = X - D * K
    else:
        ans = X - D * count
        if ((K - count) % 2 == 1):
            ans = ans - D
else:
    if K <= -1 * count:
        ans = X + D * K
    else:
        ans = X + D * xount
        if ((K - count) % 2 == 1):
            ans = ans + D

if ans < 0:
    ans = ans * (-1)

print(ans)
Problem p02700 (python)

Fixed submission:
A,B,C,D = map(int,input().split())
while True:
    C=C-B
    if C<=0:
        print("Yes")
        break

    A=A-D
    if A<=0:
        print("No")
        break

Buggy submission (verdict: Runtime Error):
A,B,C,D = map(int,input().split())
while A>0 && C>0:
    C=C-B
    A=A-D

if C<0:
    print("Yes")
else:
    print("No")
Problem p02553 (python)

Fixed submission:
def resolve():
    a, b, c, d = map(int, input().split())
    w = a*c
    x = a*d
    y = b*c
    z = b*d
    ans = max(w, x, y, z)
    print(ans)

resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    a, b, c, d = map(int, input().split()
    w = a*c
    x = a*d
    y = b*c
    z = b*d
    ans = max(w, x, y, z)
    print(ans)
    
    
resolve()
Problem p02603 (python)

Fixed submission:
def resolve():
    n = int(input())
    A = list(map(int, input().split()))
    funds = 1000
    stock = 0

    for i in range(n):
        if i > 0 and A[i] > A[i-1]:
            # sell
            funds += A[i] * stock
            stock = 0
        if i < n-1 and A[i] < A[i+1]:
            # buy
            stock += funds // A[i]
            funds -= A[i] * stock

    print(funds)

resolve()

Buggy submission (verdict: Runtime Error):

    n = int(input())
    A = list(map(int, input().split()))
    funds = 1000
    stock = 0

    for i in range(n):
        if i > 0 and A[i] > A[i-1]:
            # sell
            funds += A[i] * stock
            stock = 0
        if i < n-1 and A[i] < A[i+1]:
            # buy
            stock += funds // A[i]
            funds -= A[i] * stock

    print(funds)

resolve()
Problem p02642 (python)

Fixed submission:
def resolve():
    n = int(input())
    A = list(map(int, input().split()))
    max_a = max(A)
    m = set()
    checked = set()
    duplicated = set()

    for a in A:
        if a in checked:
            duplicated.add(a)
            continue

        i = 2
        while a*i <= max_a:
            m.add(a*i)
            i += 1

        checked.add(a)

    ans = 0
    for a in A:
        if a in duplicated: continue

        if a not in m:
            ans += 1
    
    print(ans)
 
resolve()

Buggy submission (verdict: Runtime Error):

    n = int(input())
    A = list(map(int, input().split()))
    max_a = max(A)
    m = set()
    checked = set()
    duplicated = set()

    for a in A:
        if a in checked:
            duplicated.add(a)
            continue

        i = 2
        while a*i <= max_a:
            m.add(a*i)
            i += 1

        checked.add(a)

    ans = 0
    for a in A:
        if a in duplicated: continue

        if a not in m:
            ans += 1
    
    print(ans)
 
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    n = int(input())
    a = list(map(int, input().split()))
    a = list(set(a))
    a.sort()

    if len(a) < 2:
        print(0)
        return

    ans = 0
    for i in range(n):
        for j in range(min(i+1,n)):
            if i == j: continue
            
            if a[i] % a[j] == 0:
                break
        else:
            ans += 1

    print(ans)

resolve()
Problem p02706 (python)

Fixed submission:
from sys import stdin

holiday_count, task_count = stdin.readline().rstrip().split()
holiday_count = int(holiday_count)
tasks_days = sum([int(x) for x in stdin.readline().rstrip().split()])

remain = holiday_count - tasks_days
if remain < 0:
  print(-1)
else:
  print(remain)

Buggy submission (verdict: Runtime Error):
from sys import stdin
 
r = int(stdin.readline().rstrip())
print(r*2*3.1415)
Problem p02612 (python)

Fixed submission:
n = int(input())
ans = 1000 - n % 1000
if ans == 1000:
    ans = 0
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(stdin.readline().rstrip())
ans = 1000 - n % 1000
if ans == 1000:
    ans = 0
print(ans)
Problem p02553 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
m = list()
m.append(a*c)
m.append(a*d)
m.append(b*c)
m.append(b*d)
print(max(m))

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
m = list()
list.append(a*c)
list.append(a*d)
list.append(b*c)
list.append(b*d)
print(max(m))
Problem p02613 (python)

Fixed submission:
N = int(input())
C0 = C1 = C2 = C3 = 0
for _ in range(N):
    S = input()
    if S == "AC":
        C0 += 1
    elif S == "WA":
        C1 += 1
    elif S == "TLE":
        C2 += 1
    elif S == "RE":
        C3 += 1

print("AC x %d"%C0)
print("WA x %d"%C1)
print("TLE x %d"%C2)
print("RE x %d"%C3)

Buggy submission (verdict: Runtime Error):
N = int(input())
C0 = 0
C1 = 0
C2 = 0
C3 = 0
for i in range(N):
    if input() == "AC":
        C0 += 1
    elif input() == "WA":
        C1 += 1
    elif input() == "TLE":
        C2 += 1
    elif input() == "RE":
        C3 += 1
print("AC × %d",C0)
print("WA × %d",C1)
print("TLE × %d",C2)
print("RE × %d",C3)
Problem p03494 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = 0
def GCD(a,b):
    if a < b:
        a,b = b,a
    while a % b != 0:
        a,b = b, a % b
    return b
if __name__ =="__main__":
    for i in range(N-1):
       A[i+1] = GCD(A[i],A[i+1])
    while A[N-1] % 2 == 0:
        A[N-1] //= 2
        ans += 1
    print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
A = list(map(int,input().split()))
ans = 0
def GCD(a,b):
    if a < b:
        a,b = b,a
    while a % b != 0:
        a,b = b, a % b
    print(b)

if __name__ =="__main__":
    for i in range(N-1):
       ans = GCD(A[i],A[i+1])
    print(ans)
Problem p02582 (python)

Fixed submission:
S = input()
r = 0

if S == "RRR":
  r = 3
elif S == "RRS" or S == "SRR":
  r = 2
elif S == "RSR" or S.count('R') == 1:
  r = 1
else:
  r = 0

print(r)

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

r = 0
for i in range(3):
  if i == 0 and S[0] == 'R':
    r += 1
   elif i < 2:
    if S[i] == S[i+1]:
      r += 1

print(r)
Problem p02613 (python)

Fixed submission:
n = int(input()); s = []
for _ in range(n):
  s.append(input())
 
dic = {"AC":0,
       "WA":0,
       "TLE":0,
       "RE":0}

for res in s:
  if res in dic: dic[res] += 1
  
for k in dic:
  print(f"{k} x {dic[k]}")

Buggy submission (verdict: Runtime Error):
n = int(input()); s = []
for _ in range(n):
  s.append(input())
 
dic = {"AC":0,
       "WA":0,
       "TLE":0,
       "RE":0}

for res in s:
  dic[s] += 1
  
for k in dic:
  print(f"{k} x {dic[k]}")
Problem p03071 (python)

Fixed submission:
a,b = (int(x) for x in input().split())
if a == b:
  print(2*a)
elif a < b:
  print(2*b - 1)
else:
  print(2*a - 1)

Buggy submission (verdict: Runtime Error):
a,b = (int(x) for x in input().split())
if a == b:
  print(2*a)
elif else a < b:
  print(2*b - 1)
else:
  print(2*a - 1)
Problem p02658 (python)

Fixed submission:
import sys
def main():

    n=int(input())
    p=list(map(int,input().split()))
    s=1
    p=sorted(p)
    for i in p:
        s*=i
        if i==0:
            print(0)
            sys.exit()
        elif s>=10**18+1:
            print(-1)
            sys.exit()
    print(s)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
def main():

    n=int(input())
    p=list(map(int,input().split()))
    s=1
    p=sorted(p)
    for i in p:
        s*=i
        if i==0:
            print(0)
            sys.exit()
        else s>=10**18+1:
            print(-1)
            sys.exit()
    print(s)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
def main():

n=int(input())
p=tuple(map(int,input().split()))
s=1
for i in range(n):
    s*=p[i]
if s>=10**18+1:
    print(-1)
    sys.exit()
print(s)

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

Fixed submission:
N, M=map(int,input().split())
a=list(map(int,input().split()))
if N-sum(a)>=0:
  print(N-sum(a))
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
N, M=map(int,input.split())
a=list(map(int,input.split()))
if N-sum(a)>=0:
  print(N-sum(a))
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
N, M=map(int,input.split())
a=[map(int,input.split())]
if N-sum(a)>=0:
  print(N-sum(a))
else:
  print(-1)
Problem p02713 (python)

Fixed submission:
import math
K=int(input())
k=0
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            d=math.gcd(a,b)
            d=math.gcd(d,c)
            k+=d
print(k)

Buggy submission (verdict: Runtime Error):
mport math
K=int(input())
k=0
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            d=math.gcd(a,b)
            d=math.gcd(d,c)
            k+=d
print(k)
Problem p02717 (python)

Fixed submission:
X,Y,Z=map(int,input().split())
print(Z ,X, Y)

Buggy submission (verdict: Runtime Error):
X,Y,Z=map(int,input().split())
print(Y Z X)
Problem p02718 (python)

Fixed submission:
N,M=map(int,input().split())
a=list(map(int,input().split()))
a=sorted(a, reverse=True)
if sum(a)/(4*M)<=a[M-1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
a=list(map(int,input().split()))
a=sorted(a, reversed =True)
if sum(a)/(4*M)<=a[M-1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
a=[map(int,input().split()) for i in range(N)]
a=sorted(a, reversed =True)
if sum(a)/(4*M)<=a[M-1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
a=[int(input()) for i in range(N)]
a=sorted(a,reverse=True)
if sum(a)/(4*M)<=a[M-1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
a=[int(input()) for i in range(N)]
a=sorted(a) reversed=True
if sum(a)/(4*M)<=a[M-1]:
  print("Yes")
else:
  print("No")
Problem p02755 (python)

Fixed submission:
a,b=map(int,input().split())
k=[]
o=[]
p=[]
for i in range(1,5000):
    if int(i*0.08)==a:
        k.append(i)
for j in range(1,5000):
    if int(j*0.1)==b:
        o.append(j)
for t in range(len(k)):
    for u in range(len(o)):
        if k[t]==o[u]:
            p.append(k[t])
if p==[]:
    print(-1)
else:
    print(min(p))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
k=[]
o=[]
p=[]
for i in range(1,101):
    if i==A//1.08:
        k.append(i)
for j in range(1,101):
    if j==b//1.1:
        o.append(j)
for t in range(len(k)):
    for u in range(len(o)):
        if k[t]==o[u]:
            p.append(k[t])
if p==[]:
    print(-1)
else:
    print(min(p))
Problem p02780 (python)

Fixed submission:
n,k=map(int,input().split())
a=[int(s) for s in input().split()]
b=[0]*k
c=0
v=[0]*n
v[0]=a[0]
for i in range(n-1):
    v[i+1]=v[i]+a[i+1]
mx=v[k-1]
for i in range(k,n):
    g=v[i]-v[i-k]
    mx=max(mx,g)  
    
print((mx+k)/2)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=[int(s) for s in input().split()]
b=[0]*k
c=0
v[0]=a[0]
for i in range(n):
    v[i+1]=v[i]+a[i+1]
mx=v[2]
for i in range(3,n):
    g=v[i]-v[i-2]
    mx=max(mx,g)  
    
print((mx+1)/2)
Problem p02727 (python)

Fixed submission:
X, Y, A, B, C = map(int, input().split())
p = sorted(list(map(int, input().split())), reverse=True)[:X]
q = sorted(list(map(int, input().split())), reverse=True)[:Y]
r = list(map(int, input().split()))
ans = sum(sorted(p + q + r, reverse=True)[:X + Y])
print(ans)

Buggy submission (verdict: Runtime Error):
X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

px = p[:X]
qy = q[:Y]
print(qy)
while r and min(px[-1], qy[1]) < r[0]:
  px.sort(reverse=True)
  qy.sort(reverse=True)
  if px[-1] < qy[-1]:
    px[-1] = r[0]
    r.pop(0)
  else:
    qy[-1] = r[0]
    r.pop(0)

print(sum(px) + sum(qy))
Problem p02953 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
ans = True
b = 999999
if ans == True:
  for i, x in enumerate(H[::-1]):
    if i != 0:
      if x <= b:
        b = x
      elif (x-1) <= b:
        b = x-1
      else:
        ans = False
        break
    else:
      b = x
if ans:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import fractions
A, B, C, D = map(int, input().split())
CD = C * D // fractions.gcd(C,D)
def n_div(k):
  return B // k - (A-1) // k
ans = B - A + 1 - n_div(C) - n_div(D) + n_div(CD)
print(ans)
Problem p02988 (python)

Fixed submission:
n = int(input())

li = list(map(int, input().split()))
cnt = 0
for i in range(1, n-1):
    li2 = li[i-1: i+2]
    if li2[1] == sorted(li2)[1]:
        cnt += 1
print(cnt)

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

li = list(map(int, input().split()))
cnt = 0
for i in range(n):
    li2 = li[i-2: i+1]
    if li2[1] == sorted(li2)[1]:
        cnt += 1

print(cnt)

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

li = list(map(int, input().split()))
cnt = 0
for i in range(n+1):
    li2 = li[i-2: i+1]
    if li2[1] == sorted(li2)[1]:
        cnt += 1

print(cnt)
Problem p02993 (python)

Fixed submission:
S = input()
if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
S = input()
if S[1] == S[2] or S[2] == S[3] or S[3] == S[4]:
  print("Bad")
else:
  print("Good")
Problem p03854 (python)

Fixed submission:
S = input()
r_S = S[::-1]
devide = ["dream", "dreamer", "erase", "eraser"]
r_devide = [d[::-1] for d in devide]
string = r_S

while string != '':
  can = False
  for d in r_devide:
    if string[:len(d)] == d:
      can = True
      string = string[len(d):]
  if can == False:
    break

if can:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):

  print("No")

Buggy submission (verdict: Runtime Error):
S = input()
r_S = S[::-1]
devide = ["dream", "dreamer", "erase", "eraser"]
r_devide = [d[::-1] for d in devide]
string = r_S

while string != '':
  can = False
  for d in r_devide:
    if string[:len(d)] == d:
      can = True
      string = string[len(d):]
      print(string)
  if can == False:
    break

if can:
  print("Yes")
else:
  print("No")
Problem p02600 (python)

Fixed submission:
X = int(input())
K =[400,600,800,1000,1200,1400,1600,1800,9999]
for k in range(8):
    if K[k]<=X and K[k+1]>X:
        print(8-k)
        break

Buggy submission (verdict: Runtime Error):
X = int(input())
K =[400,600,800,1000,1200,1400,1600,1800]
for k in range(8):
    if K[k]<=X and K[k+1]>X:
        print(8-k)
        break

Buggy submission (verdict: Runtime Error):
X = int(input())
K =[400,600,800,1000,1200,1400,1600,1800]
for k in range(8):
    if K[k]<=X and K[k+1]>X:
        print(8-k)
        exit()