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

Fixed submission:
n, a = map(int, open(0).read().split())
print(n * n - a)

Buggy submission (verdict: Runtime Error):
A, B, C, D, E, F = map(int, input().split())
max_sugar = E / (100 + E)
res = 0 
ans = [0, 0]
for a in range(F // 100*A + 1): 
        for b in range(F // 100*B + 1): 
                for c in range(int(F * max_sugar) // C + 1):
                        for d in range(int(F * max_sugar) // D + 1): 
                                mass = 100*A*a + 100*B*b + C*c + D*d 
                                sugar = C*c + D*d 
                                if 0 < mass <= F and sugar / mass <= max_sugar:
                                        if res <= sugar / mass:
                                                res = sugar / mass 
                                                ans = [mass, sugar]
                                else:
                                        break
print(str(ans[0]) + " " + str(ans[1]))
Problem p03854 (python)

Fixed submission:
S = list(input())
S.reverse()
S = "".join(S)
ans = "YES"
while len(S) > 0:
        if S[:5] == "maerd" or S[:5] == "esare":
                S = S[5:]
        elif S[:6] == "resare":
                S = S[6:]
        elif S[:7] == "remaerd":
                S = S[7:]
        else:
                ans = "NO"
                break
print(ans)

Buggy submission (verdict: Runtime Error):
S = list(input())
S.reverse()
S = "".join(S)
ans = "YES"
while len(S) > 0:
        print(S)
        if S[:5] == "maerd" or S[:5] == "esare":
                S = S[5:]
        elif S[:6] == "resare":
                S = S[6:]
        elif S[:7] == "remaerd":
                S = S[7:]
        else:
                ans = "NO"
                break
print(ans)
Problem p03944 (python)

Fixed submission:
W, H, N = map(int, input().split())
xy = [list(map(int, input().split())) for i in range(N)]
x_black = [0] * W 
y_black = [0] * H 
def get_area(x, y, a): 
        if a == 1:
                for i in range(x):
                        x_black[i] = 1 
        if a == 2:
                for i in range(x, W): 
                        x_black[i] = 1 
        if a == 3:
                for i in range(y):
                        y_black[i] = 1 
        if a == 4:
                for i in range(y, H): 
                        y_black[i] = 1 
for i in xy: 
        get_area(i[0], i[1], i[2])
print(x_black.count(0) * y_black.count(0))

Buggy submission (verdict: Runtime Error):
W, H, N = map(int, input().split())
xy = [list(map(int, input().split())) for i in range(N)]
x_black = [0] * W 
y_black = [0] * H 
def get_area(x, y, a): 
        if a == 1:
                x_black[:x] = [1] * x 
        if a == 2:
                x_black[x:W] = [1] * (W - x)
        if a == 3:
                y_black[y] = [1] * y 
        if a == 4:
                y_black[y:H] = [1] * (H - y)
for i in xy: 
        get_area(i[0], i[1], i[2])
print(x_black.count(0) * y_black.count(0))
Problem p02995 (python)

Fixed submission:
from fractions import gcd

A,B,C,D = map(int, input().split())

lcm = (C*D) // gcd(C,D)

b_sum = B - ((B//C) + (B//D) - (B//lcm))

a = A-1
a_sum = a - ((a//C) + (a//D) - (a//lcm))

print(b_sum - a_sum)

Buggy submission (verdict: Runtime Error):
import math

A,B,C,D = map(int, input().split())

lcm = (C*D) // math.gcd(C,D)

b_sum = B - ((B//C) + (B//D) - (B//lcm))

a = A-1
a_sum = a - ((a//C) + (a//D) - (a//lcm))

print(b_sum - a_sum)

Buggy submission (verdict: Runtime Error):
import math

def lcm(a,b):
    return (a*b) // math.gcd(a,b)

A,B,C,D = map(int, input().split())

b_sum = B - ((B//C) + (B//D) - (B//lcm(C,D)))

a = A-1
a_sum = a - ((a//C) + (a//D) - (a//lcm(C,D)))

print(b_sum-a_sum)
Problem p02706 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))
sumA = 0
cnt = 0

for i in A:
    sumA = sumA + A[cnt]
    cnt = cnt +1

if sumA > N:
    print(-1)
else:
    print(N-sumA)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [int(x) for x in input().split()]
sumA = 0

for i in A:
    sumA = sumA + A[i]

if sumA > N:
    print(-1)
else:
    print(N-sumA)
Problem p02717 (python)

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

Buggy submission (verdict: Runtime Error):
a, b, c = int(input().split())
if a >= 1 and a <= 100:
    if b >= 1 and b <= 100:
        if c >= 1 and c <= 100:
            a, b = b, a
            a, c = c, a
print(a, b, c)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
if a >= 1 and a <= 100:
    if b >= 1 and b <= 100:
        if c >= 1 and c <= 100:
            a, b = b, a
            a, c = c, a
print(a, b, c)

Buggy submission (verdict: Runtime Error):
int a, b, c
a, b, c = c, a, b
print(a, b, c)
Problem p02718 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))

check = ((1 / (4 * M)) * sum(A))
x = 0
for item in A:
    if item < check:
        x += 1

ans = N - x

if ans >= M :
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
acc = n+m
arr = list(map(int, input().split()))
sums = 0
count = 0
for i in arr:
    sums = sums + i
check = (1 / (4*m))*sums
for i in arr:
    if i < check:
        count += 1
    else:
        if i == sums
            count = 0
            break
        continue
if count >= 1:
    print("No")
else:
    print("Yes")
Problem p02646 (python)

Fixed submission:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
# if (v-w)*t>=(b-a):print("YES")
# else:print("NO")
q = abs(a-b)
e = (v-w)*t
if q<=e:
	print("YES")
else:
	print("NO")

Buggy submission (verdict: Runtime Error):
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
if a<b and v<=w:print("NO")
else:
	z = (b-a)/(v-w)
	if z==int(z) and z<=t:print("YES")
	else:print("NO")
Problem p02582 (python)

Fixed submission:
S = input()

if S == "RRR":
    print(3)
elif S == "SSS":
    print(0)
elif S[0:2] == "RR" or S[1:3] == "RR":
    print(2)
else:
    print(1)

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

if S == "RRR":
    print(3)
elif S[0,1] == "R" or S[1,2] == "R":
    print(2)
elif S[0,1] == "S" or S[1,2] == "S":
    print(1)
else:
    print(0)
Problem p02694 (python)

Fixed submission:
X = int(input())

money = 100
cnt = 0

while money < X:
    money += money//100
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
from decimal import Decimal

X = int(input())

money = 100
cnt = 0

while money < X:
    money = Decimal(money*1.01)
    cnt += 1
print(cnt)
Problem p03101 (python)

Fixed submission:
H, W = map(int, input().split())
h, w = map(int, input().split())

h2 = H - h
w2 = W - w

print(h2*w2)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
drink = []
cost = 0
count = 0
d_count = 0
rest = 0


for _ in range(N):
    Drink = list(map(int, input().split()))
    drink.append(Drink)
    drink.sort()

for i in range(N):
    cost += drink[i][0] * drink[i][1]
    d_count += drink[i][1]
    count += 1
    if d_count > M:
      break
      
cost -= drink[count-1][0] * drink[count-1][1]
d_count -= drink[count-1][1]
rest = M - d_count
cost += rest * drink[count-1][0]
print(cost)
Problem p03103 (python)

Fixed submission:
N, M = map(int, input().split())
drink = []
cost = 0
d_count = 0


for _ in range(N):
    drink.append(list(map(int, input().split())))
    
drink = sorted(drink)

for i in range(N):
    cost += drink[i][0] * drink[i][1]
    d_count += drink[i][1] 
    if d_count > M:
      cost -= drink[i][0] * (d_count - M)
      break
      

print(cost)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
drink = []
cost = 0
count = 0
d_count = 0
rest = 0


for _ in range(N):
    drink.append(list(map(int, input().split())))
    drink.sorted(drink)

for i in range(N):
    cost += drink[i][0] * drink[i][1]
    d_count += drink[i][1]
    count += 1
    if d_count > M:
      break
      
cost -= drink[count-1][0] * drink[count-1][1]
d_count -= drink[count-1][1]
rest = M - d_count
cost += rest * drink[count-1][0]
print(cost)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
drink = []
cost = 0
count = 0
d_count = 0
rest = 0
 
 
for _ in range(N):
    drink.append(list(map(int, input().split())))
    drink.sorted()
 
for i in range(N):
    cost += drink[i][0] * drink[i][1]
    d_count += drink[i][1]
    count += 1
    if d_count > M:
      break
      
cost -= drink[count-1][0] * drink[count-1][1]
d_count -= drink[count-1][1]
rest = M - d_count
cost += rest * drink[count-1][0]
print(cost)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
drink = []
cost = 0
count = 0
d_count = 0
rest = 0


for i in range(N):
    Drink = list(map(int, input().split()))
    drink.append(Drink)
    drink.sort()
    for j in range(drink[i][1]):
      d_count += 1
      cost += drink[i][0]
      if d_count == M or d_count == drink[i][1]
print(cost)
Problem p03105 (python)

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

num = b // a

if num <= c:
  print(num)
else:
  print(c)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
list = []

for i in range(1, 101):
  if a%i == 0 and b %i == 0:
    list.append(i)
    list.sort(reverse=True)
    
print(list[k-1])

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

num1 = 11 // 2

if num <= c:
  print(num)
else:
  print(c)
Problem p03210 (python)

Fixed submission:
num = int(input())

if num == 3or num == 5 or num == 7:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
num = input()
li = []

for i in range(len(num) - 2):
  li.append(abs(int(num[i]) * 100 + int(num[i+1]) * 10 + int(num[i+2]) - 753))

print(min(li))
Problem p02602 (python)

Fixed submission:
N,K=map(int,input().split())
A=list(map(int,input().split()))
for i in range(K,N):
  if A[i]/A[i-K]>1:
    print ('Yes')
  else:
    print ('No')

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
B=1
for i in range(K,N):
  for j in range(K):
    B=B*A[0+i-K+j]
  if B*A[i]/A[i-K]>B:
    print ('Yes')
  else:
    print ('No')

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
B=1
for i in range(K,N):
  for j in range(K):
    B=B*A[0+i-K+j]
  if B*A[i]/A[i-K]>B:
    print ('Yes')
  else:
    print ('No')
Problem p02612 (python)

Fixed submission:
a=int(input())
b=a%1000
if b==0 : c=0
else :c=1000-b
print(str(c))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=a%1000
if b==0 : c=0
else :c=1000-b n
print(str(c))
Problem p02658 (python)

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

if 0 in a:
    print(0)
else:
    m=1
    for i in a:
        m*=i
        if 10**18 < m:
            print(-1)
            break
    else:
        print(m)

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

if 0 in a:
    print(0)
else:
    m=1
    for i in a:
        m*=a[i]
        if m> 10**18:
            print(-1)
            break
        else:
            print(m)
Problem p02947 (python)

Fixed submission:
from math import factorial
N = int(input())
P = {}
ans = 0
def counter(s):
    ret = [0]*26
    for ss in s:
        ret[ord(ss)-ord('a')] += 1
    return tuple(ret)
for _ in range(N):
    s = input()
    c = counter(s)
    if not c in P.keys():
        P[c] = 1
    else:
        P[c] += 1
for v in P.values():
    if v > 1:
        ans += factorial(v) // factorial(2) // factorial(v-2)
print(ans)

Buggy submission (verdict: Runtime Error):
from math import factorial
N = int(input())
P = {}
ans = 0
def counter(s):
    ret = [0]*26
    for ss in s:
        ret[ord(ss)-ord('a')] += 1
    return tuple(ret)
for _ in range(N):
    s = input()
    c = counter(s)
    if not c in P.keys():
        P[c] = 1
    else:
        P[c] += 1
for v in P.values():
    ans += factorial(v) // factorial(2) // factorial(v-2)
print(ans)

Buggy submission (verdict: Runtime Error):
from math import factorial
N = int(input())
P = {}
ans = 0
def counter(s):
    ret = [0]*26
    for ss in s:
        ret[ord(ss)-ord('a')] += 1
    return tuple(ret)
for _ in range(N):
    s = input()
    c = counter(s)
    if not c in P.keys():
        P[c] = 1
    else:
        P[c] += 1
for v in P.values():
    ans += factorial(v) / factorial(2) / factorial(v-2)
print(int(ans))
Problem p02972 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = [0]*N
n = N
for a in (reversed(A)):
    if n*2 > N:
        B[n-1] = a
        n -= 1
        continue
    total = 0
    for i in range(2,N+2):
        if n*i <= N:
            total += B[n*i-1]
        else:
            if a == total % 2:
                B[n-1] = 0
            else:
                B[n-1] = 1
            break
    n -= 1

M = sum(B)
print(M)
C = [str(n+1) for n, v in enumerate(B) if v == 1]
print(' '.join(C))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = [0]*N
n = N
for a in (reversed(A)):
    if n*2 > N:
        B[n-1] = a
        n -= 1
        continue
    total = 0
    for i in range(2,N+2):
        if n*i <= N:
            total += B[n*i-1]
        else:
            if a == total % 2:
                B[n-1] = 0
            else:
                B[n-1] = 1
    n -= 1

print(tmp)
Problem p03047 (python)

Fixed submission:
N, K = list(map(int, input().split()))
print(N-K+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
c = 0
tail_A = 0
head_B = 0
B_A = 0
def count(S):
    if len(S) == 1:
        return 0
    c = 0
    for i in range(len(S)-1):
        if S[i] == 'A' and S[i+1] == 'B':
            c += 1
    return c

for _ in range(N):
    s = input()
    c += count(s)
    if s[-1] == 'A':
        if s[0] == 'B':
            B_A += 1
        else:
            tail_A += 1
    else:
        if s[0] == 'B':
            head_B += 1

if tail_A > 0 and head_B > 0:
    c = c + B_A + 1
    tail_A -= 1
    head_B -= 1
elif tail_A == 0 and head_B > 0:
    c = c + B_A
    head_B -= 1
elif tail_A > 0 and head_B == 0:
    c = c + B_A
    tail_A -= 1
else:
    c = c + B_A - 1

c += min(tail_A, head_B)
print(c)

Buggy submission (verdict: Runtime Error):
N = int(input())
count = 0
tail_A = 0
head_B = 0
B_A = 0
for _ in range(N):
    s = input()
    count += s.count('AB')
    if s[-1] == 'A':
        if s[0] == 'B':
            B_A += 1
        else:
            tail_A += 1
    else:
        if s[0] == 'B':
            head_B += 1

if tail_A > 0 and head_B > 0:
    count = count + B_A + 1
    tail_A -= 1
    head_B -= 1
elif tail_A == 0 and head_B > 0:
    count = count + B_A
    head_B -= 1
elif tail_A > 0 and head_B == 0:
    count = count + B_A
    tail_A -= 1

count += min(tail_A, head_B)
print(count)
Problem p03105 (python)

Fixed submission:
A, B, C = list(map(int, input().split()))
max_i = B//A
print(min(max_i, C))

Buggy submission (verdict: Runtime Error):
class Union_find(object):
    def __init__(self, N):
        #親の番号を格納する。親だった場合は-(その集合のサイズ)
        self.parent = [-1]*(N)
    #Aがどのグループに属するか
    def root(self, A):
        if self.parent[A] < 0:
            return A
        else:
            #親を繋ぎ変えて高速化
            self.parent[A] = self.root(self.parent[A])
            return self.parent[A]
    def size(self, A):
        return -self.parent[self.root(A)]
    # A,Bをくっつける
    def connect(self, A, B):
        # A,Bを直接つなぐのでなく、root(A),root(B)をつなぐ
        A = self.root(A)
        B = self.root(B)
        if A == B:
            return False
        # 大きい方に小さい方をくっつける
        if self.size(A) < self.size(B):
            A, B = B, A
        self.parent[A] += self.parent[B]
        self.parent[B] = A
        return True

N, M = list(map(int, input().split()))
A = []
B = []
for _ in range(M):
    a, b = list(map(int, input().split()))
    A.append(a-1)
    B.append(b-1)
uni = Union_find(N)
result = []
unconv = int(N*(N-1)/2)
for a, b in zip(reversed(A), reversed(B)):
    result.append(unconv)
    size_a = uni.size(a)
    size_b = uni.size(b)
    if uni.connect(a, b):
        unconv -= size_a*size_b
for r in reversed(result):
    print(r)
Problem p03240 (python)

Fixed submission:

def check(cx, cy, H, x, y, h):
    if (h == 0) and (abs(cx-x)+abs(cy-y) > H):
        return True
    if H-h == abs(cx-x)+abs(cy-y):
        return True
    else:
        return False

def a():
    N = int(input())
    xs = []
    ys = []
    hs = []
    for _ in range(N):
        i = input().split(' ')
        xs.append(int(i[0]))
        ys.append(int(i[1]))
        hs.append(int(i[2]))
    
    for i, h in enumerate(hs):
        if h==0:
            continue
        else:
            init_x = xs[i]
            init_y = ys[i]
            init_h = h
            break
    for cx in range(101):
        for cy in range(101):
            H = abs(cx-init_x)+abs(cy-init_y)+init_h
            flag_stop = False
            for x, y, h in zip(xs, ys, hs):
                if not check(cx, cy, H, x, y, h):
                    flag_stop = True
                    break
            if flag_stop:
                continue
            else:
                print('{} {} {}'.format(cx, cy, H))
                return
a()

Buggy submission (verdict: Runtime Error):

def check(cx, cy, H, x, y, h):
    if (h == 0) and (abs(cx-x)+abs(cy-y) > H):
        return True
    if H-h == abs(cx-x)+abs(cy-y):
        return True
    else:
        return False

def a():
    N = int(input())
    xs = []
    ys = []
    hs = []
    for _ in range(N):
        i = input().split(' ')
        xs.append(int(i[0]))
        ys.append(int(i[1]))
        hs.append(int(i[2]))
    
    for i, h in enumerate(hs):
        if h==0:
            continue
        else:
            init_x = xs[i]
            init_y = ys[i]
            init_h = h
            break
    for cx in range(101):
        for cy in range(101):
                H = abs(cx-init_x)+abs(cy-init_y)+init_h
            flag_stop = False
            for x, y, h in zip(xs, ys, hs):
                if not check(cx, cy, H, x, y, h):
                    flag_stop = True
                    break
            if flag_stop:
                continue
            else:
                print('{} {} {}'.format(cx, cy, H))
                return
a()
Problem p03260 (python)

Fixed submission:
s = input()
a,b = s.split(' ')
a = int(a)
b = int(b)
if (a%2 == 0) or (b%2 == 0):
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
from fractions import gcd
def fun():
    nx = input()
    N, X = nx.split(' ')
    N = int(N)
    X = int(X)
    cities = [int(c) for c in input().split(' ')]
    cities.append(X)
    x = sorted(cities)
    nx = x[1:]
    dist = [nn - x[i] for i, nn in enumerate(nx)]
    if N==1:
        print(dist[0])
        return
    min_gcd = 10000000000
    for i, d in enumerate(dist[:-1]):
        dp = dist[i+1]
        gc = gcd(d, dp)
        if gc < min_gcd:
            min_gcd = gc
    print(min_gcd)

fun()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    W = []
    for n in range(N):
        W.append(input())
    for i, w in enumerate(W):
        if i==0:
            prev_w = w
            continue
        for wn in W[:i]:
            if w == wn:
                print('No')
                return 
        if prev_w[-1] != w[0]:
            print('No')
            return
        prev_w = w
    print('Yes')
    return

main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    W = []
    for n in range(N):
        W.append(input())
    for i, w in enumerate(W):
        prev_w = w
        if i==0:
            continue
        for wn in W[:i]:
            if w == wn:
                print('No')
                return 
        if prev_w[-1] != w[0]:
            print('No')
            return
    print('Yes')
    return

main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    W = []
    for n in range(N):
        W.append(input())
    for i, w in enumerate(W):
        prev_w = w
        if i==0:
            continue
        for wn in W[:i-1]:
            if w == wn:
                print('No')
                return 
        if prev_w[-1] != w[0]:
            print('No')
            return
    print('Yes')
    return

main()
Problem p02582 (python)

Fixed submission:
s = input()
a = s.count("RRR")
b = s.count("RR")
if a == 1:
    print(3)
elif b == 1:
    print(2)
else:
    if s.count("R") > 0:
        print(1)
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
str=input()
a=str.count("RRR")
b=str.count("RR")
if a==1:
  print(3)
elif b==1:
  print(2)
else:
  if s.count("R")>0:
    print(1)
  else:
    print(0)
Problem p02681 (python)

Fixed submission:
S = input()
T = input()
if T[:-1] == S:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S , T = input().split(' ')
if S in T:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S, T = input().split()
if S in T:
    print("Yes")
else:
    print("No")
Problem p02694 (python)

Fixed submission:
X = int(input())
Amount = 100
Year = 0
while Amount < X:
    P = Amount * 0.01
    if P >= 1:
        Amount+= int(P)
        Year+=1
print(Year)

Buggy submission (verdict: Runtime Error):
G = int(input())
A, B = map(int,input().split())
Total = 'OK'
for i in range(A,B+1):
    if i% G != 0:
        Total = 'NG'
print(Total)
Problem p02789 (python)

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

if n==m:
    print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
from fractions import gcd

N = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
l = 1
res = 0
for x in a:
  l = x * l // gcd(x, l)
for x in a:
  res += l//x
  res %= mod
print(res)
Problem p02640 (python)

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

ans = 'No'

for i in range(x + 1):
    j = x - i
    if (j*2 + i*4 == y):
        ans = "Yes"
print(ans)

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())

ans = 'No'

for i in range(x + 1):
    j = x - a
    if (j*2 + i*4 == y):
        ans = "Yes"
print(ans)

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())

ans = 'No'

for i in range(x + 1):
    j = x - a
    if (j*2 + i*4 == y):
        ans = "Yes"):
print(ans)
Problem p02582 (python)

Fixed submission:
s = input()
ans = 0
if "RRR" in s:
    ans = 3
elif "RR" in s:
    ans = 2
elif "R" in s:
    ans = 1
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = []
cnt = 0
for i in range(len(s)):
    if s[i] == "R":
        cnt += 1
    else: 
        ans.append(cnt)
        cnt = 0
print(max(ans))
Problem p02600 (python)

Fixed submission:
x = int(input())
if 400 <= x <= 599: ans = 8
elif 600 <= x <= 799: ans = 7
elif 800 <= x <= 999: ans = 6
elif 1000 <= x <= 1199: ans = 5
elif 1200 <= x <= 1399: ans = 4
elif 1400 <= x <= 1599: ans = 3
elif 1600 <= x <= 1799: ans = 2
elif 1800 <= x <= 1999: ans = 1
print(ans)

Buggy submission (verdict: Runtime Error):
x = int(input())
if 400 <= x <= 599: ans = 8
elif 600 <= x <= 799: ans = 7
elif 800 <= x <- 999: ans = 6
elif 1000 <= x <= 1199: ans = 5
elif 1200 <= x <= 1399: ans = 4
elif 1400 <= x <= 1599: ans = 3
elif 1600 <= x <= 1799: ans = 2
elif 1800 <= x <= 1999: ans = 1
print(ans)