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

Fixed submission:
# https://atcoder.jp/contests/abc139/tasks/abc139_a
S = input()
T = input()

correct = 0
for i in range(0, 3):
    if S[i] == T[i]:
        correct += 1
        
print(correct)

Buggy submission (verdict: Runtime Error):
S, T = input().split()

correct = 0
for i in range(0, 3):
    if S[i] == T[i]:
        correct += 1
        
print(correct)
Problem p02765 (python)

Fixed submission:
import numpy as np

i = list(map(int, input().split()))
N = i[0]
R = i[1]

if N>=10:
    print(R)
else:
    print(R+(100*(10-N)))

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

i = list(map(int, input().split()))
N = i[0]
R = i[1]

if N>=10:
    print(R)
else:
    print(R-(100*(10-N))
Problem p03555 (python)

Fixed submission:
line1 = list(input())
line2 = list(input())
overall = line1 + line2

gyaku = overall[::-1]

if overall == gyaku:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
line1 = list(raw_input())
line2 = list(raw_input())
overall = list1 + list2

gyaku = overall[::-1]

if overall == gyaku:
    print("YES")
else:
    print("NO")
Problem p02787 (python)

Fixed submission:
#!/usr/bin/env python3
from itertools import product, permutations, combinations
from bisect import bisect_right,bisect_left
INF = float('inf')

H, N=map(int, input().split())
dp = [0 for i in range(H + 10**4 + 1)]

hm = list(list(map(int, input().split())) for i in range(N))

for i in range(1, H+1):
    dp[i] = min(list(dp[i - h] + m for h, m in hm))
print(dp[H])

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
from itertools import product, permutations, combinations
from bisect import bisect_right,bisect_left
INF = float('inf')

H, N=map(int, input().split())
dp = [0 for i in range(H + 1)]

hm = list(list(map(int, input().split())) for i in range(N))

for i in range(1, H+1):
    dp[i] = min(list(dp[i - h] + m for h, m in hm))
print(dp[H])

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
from itertools import product, permutations, combinations
from bisect import bisect_right,bisect_left
INF = float('inf')

H, N=map(int, input().split())
dp = [0 for i in range(H + 10)]

hm = list(list(map(int, input().split())) for i in range(N))

for i in range(1, H+1):
    dp[i] = min(list(dp[i - h] + m for h, m in hm))
print(dp[H])
Problem p02801 (python)

Fixed submission:
S=input()

print(chr(ord(S)+1))

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

print(chr(ord(S)+1)
Problem p02817 (python)

Fixed submission:
S,T=map(str, input().split())
print(T+S)

Buggy submission (verdict: Runtime Error):
S,T=map(int, input().split())
print(T+S)
Problem p02885 (python)

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

if (a/2 <= b):
    print(0)
else:
    print(int(2*(a/2 - b)))

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

if (a/2 >= b):
    print(0)
else:
    print(2*(a/2 - b))
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=int(input().split())
print(max([a+b,a-b,a*b]))

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

Fixed submission:
n=int(input())
plist=list(map(int, input().split()))
k=0
for i in range(1,n+1):
    if i != plist[i-1]:
        k+=1
if k <= 2:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
n=int(input())
plist=list(map(int, input().split()))
k=0
for i in range(1,n+1):
    if i != plist[i]:
        k+=1
if k <= 2:
    print('YES')
else:
    print('NO')
Problem p02971 (python)

Fixed submission:
n=int(input())
alist=[int(input()) for i in range(n)]
b=sorted(alist, reverse=True)
for a in alist:
    if a < b[0]:
        print(b[0])
    elif b[0] <= a:
        print(b[1])

Buggy submission (verdict: Runtime Error):
n=int(input())
alist=[int(input()) for i in range(n)]
b=alist.sort(reverse=True)
for a in alist:
    if a < b[0]:
        print(b[1])
    elif b[0] <= a:
        print(b[0])

Buggy submission (verdict: Runtime Error):
n=int(input())
alist=[int(input()) for in range(n)]
max = 0
for i,a in enumerate(alist):
    max_a = max(alist[0:i])
    max_b = max(alist[i+1:])
    print(max([max_a, max_b]))
Problem p02983 (python)

Fixed submission:
L,R=map(int, input().split())
n=R-L
ans=[]
if n == 1:
    print((L*R)%2019)
elif n < 2019:
    for i in range(n+1):
        for j in range(1,n+1):
            l=L+i
            r=l+j
            if r > R:
                break
            ans.append((l*r) % 2019)
    print(min(ans))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
L,R=map(int, input().split())
n=R-L
ans=[]
if L < 2019:
    for i in range(n+1):
        l=L+i
        ans.append(l % 2019)
    a=ans.sort()
    print(a[0]*a[1])
else:
    if R < 4038:
        for i in range(n+1):
            l=L+i
            ans.append(l % 2019)
        a=ans.sort()
        print(a[0]*a[1])
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
L,R=map(int, input().split())
n=R-L
ans=[]

for i in range(n):
    l=L+i
    for j in range(i+1, n):
        r=l+j
        if r > R:
            break
        ans.append((l*r) % 2019)
print(min(ans))

Buggy submission (verdict: Runtime Error):
L,R=map(int, input().split())
n=R-L
x=[i+L for i in range(n)]
ans=[]

for i in range(n):
    l=L+i
    for j in range(i+1, n):
        r=l+j
        if r >= R:
            break
        ans.append((l*r) % 2019)
print(min(ans))
Problem p03000 (python)

Fixed submission:
n,x=map(int,input().split())
l=list(map(int, input().split()))
d=0
dlist=[]
dlist.append(0)
for i in range(1,n+1):
    d=d+l[i-1]
    if d <= x:
        dlist.append(d)
print(len(dlist))

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=list(map(int, input().split()))
d=0
dlist=[]
dlist.append(0)
for i in range(2,n+2):
    d=d+l[i-1]
    if d <= x:
        dlist.append(d)
print(len(dlist))
Problem p03035 (python)

Fixed submission:
a,b=map(int, input().split())
if a <= 5:
    print(0)
elif 6 <= a and a <= 12:
    print(int(b/2))
else:
    print(b)

Buggy submission (verdict: Runtime Error):
a,b=map(int, sinput().split())
if a >= 13:
    print(b)
elif 6 <= a and a <= 12:
    print(b/2)
else:
    print(0)
Problem p03037 (python)

Fixed submission:
N, M = map(int, input().split())
l, r = 1, N
for i in range(M):
    L, R = map(int, input().split())
    l = max(l, L)
    r = min(r, R)

print(max(0, r - l + 1))

Buggy submission (verdict: Runtime Error):
N,M=map(int, input().split())
pass_id = range(1,N+1)

for i in range(M):
    L,R=map(int, input().split())
    for id in pass_id:
        if not id in range(L,R+1):
            pass_id.pop(pass_id.index(id))
print(len(pass_id))
Problem p03080 (python)

Fixed submission:
n=input()
s = input()
r_cnt = 0
b_cnt = 0
for color in s:
  if color == 'R':
    r_cnt += 1
  else:
    b_cnt += 1
else:
  if r_cnt > b_cnt:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
s = input()
r_cnt = 0
b_cnt = 0
for color in s:
  if color == 'R':
    r_cnt += 1
    if r_cnt > (s.length/2):
      print('Yes')
      break
  else:
    b_cnt += 1
    if b_cnt > (s.length/2):
      print('No')
      break
else:
  if r_cnt > b_cnt:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
s = input()
r_cnt = 0
b_cnt = 0
for color in s:
  if color == 'R':
    r_cnt += 1
    if r_cnt > (s.length/2):
      print('Yes')
      break
  else:
    b_cnt += 1
    if b_cnt > (s.length/2):
      print('No')
      break

Buggy submission (verdict: Runtime Error):
s = input()
for color in s:
Problem p03105 (python)

Fixed submission:
a,b,c=map(int, input().split())
if b >= a*c:
    print(c)
else:
    print(b//a)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int, input.split())
max=a*c
if b >= max:
    print(c)
else:
    print(b//a)
Problem p03109 (python)

Fixed submission:
import datetime
s=input()

input_date = datetime.datetime.strptime(s, "%Y/%m/%d")
heisei = datetime.datetime(2019,4,30)

if input_date <= heisei:
    print('Heisei')
else:
    print('TBD')

Buggy submission (verdict: Runtime Error):
from datetime import datetime
input_date = datetime.datetime.strptime(input(), "%Y%m%d")

heisei = datetime.datetime(2019,4,30)
if input_date < heisei:
    print('Heisei')
else:
    print('TBD')

Buggy submission (verdict: Runtime Error):
from datetime import datetime
input_date = datetime.datetime(input(), "%Y%m%d")

heisei = datetime.datetime(2019,4,30)
if input_date < heisei:
    print('Heisei')
else:
    print('TBD')
Problem p03110 (python)

Fixed submission:
n=int(input())
sum=0

for i in range(n):
    value,unit=map(str, input().split())
    if unit == 'BTC':
        sum += float(value) * 380000
    else:
        sum+=float(value)
print(sum)

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

for i in range(n):
    value,unit=map(int, input().split())
    if unit == 'BTC':
        sum += value * 380000
    else:
        sum+=value
print(sum)
Problem p03126 (python)

Fixed submission:
n,m=map(int, input().split())
cnt = [0]*m
for i in range(n):
    like = list(map(int, input().split()))
    k = like.pop(0)
    for j in like:
        cnt[j-1] += 1

all_like=0
for _ in cnt:
    if _ == n:
        all_like += 1
print(all_like)

Buggy submission (verdict: Runtime Error):
n,m=map(int, input().split())
cnt = [0]*m
for i in range(n):
    like = list(map(int, input().split()))
    k = like.pop(0)
    for j in like:
        cnt[j] += 1

all_like=0
for _ in cnt:
    if _ == n:
        all_like += 1
Problem p03145 (python)

Fixed submission:
ab,bc,ca=map(int,input().split())
print(int(ab*bc*0.5))

Buggy submission (verdict: Runtime Error):
ab,bc,ca=map(int,input().spit())
print(ab*bc*0.5)
Problem p03146 (python)

Fixed submission:
s = int(input())
def f(x):
  if x % 2 == 0:
    return x/2
  else:
    return 3 * x + 1

X = [s]
m = 1
next = s

while True:
  m += 1
  next = f(next)
  if next in X:
    break
  else:
    X.append(next)
    
print(m)

Buggy submission (verdict: Runtime Error):
s=int(input())
an=[0]*1000000
tmp=[False]*300
an[0] = s
for i in range(1, 1000000):
    if an[i-1] % 2 == 0:
        an[i] = int(an[i-1]/2)
    else:
        an[i] = 3*an[i-1] + 1
    if not tmp[an[i]]:
        tmp[an[i]] = True
    else:
        print(i+1)
        exit()

Buggy submission (verdict: Runtime Error):
s=int(input())
an=[0]*1000000
tmp=[False]*300
an[0] = s
for i in range(1, 1000000):
    if an[i-1] % 2 == 0:
        an[i] = an[i-1]/2
    else:
        an[i] = 3*an[i-1] + 1
    if not tmp[an[i]]:
        tmp[an[i]] = True
    else:
        print(i)
        exit()
Problem p03211 (python)

Fixed submission:
s=input()
xlist=[abs(int(s[i:i+3])-753) for i in range(len(s)-2)]
print(min(xlist))

Buggy submission (verdict: Runtime Error):
s=input()
import math
xlist=[math.abs(int(s[i:i+2])-753) for i in range(0,len(s)-3)]
print(min(xlist))
Problem p03289 (python)

Fixed submission:
S=input()

judge = "AC" if (S[0] == 'A' and S[2:-1].count('C') == 1 and S[1:].replace('C', '').islower()) else "WA"
print(judge)

Buggy submission (verdict: Runtime Error):
S=input()
judge='AC'
cnt = 0

for i in len(S):
    if S[i].isupper():
        if i == 0 or i == len(S) - 2 or S[i] != 'C':
            judge = 'WA'
        cnt+=1

if cnt != 1:
    judge = 'WA'
print(judge)
Problem p03316 (python)

Fixed submission:
N=input()
sn = 0
for n in N:
    sn += int(n)

if int(N) % sn == 0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N=input()
sn = 0
for n in N:
    sn += int(n)

if N % sn == 0:
    print('Yes')
else:
    print('No')
Problem p03324 (python)

Fixed submission:
d,n=map(int,input().split())
if n < 100:
  print(n*(100**d))
else:
  print((n+1)*100**d)

Buggy submission (verdict: Runtime Error):
d,n=map(int,input().spilit())
if d==0:
  print('5')
else:
  a=100**d
  print(a*n)
Problem p03338 (python)

Fixed submission:
N=int(input())
S=input()
print(max(len(set(S[:i]) & set(S[i:])) for i in range(N)))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
print(max(len(set(S[:i]&set(S[i:])) for i in range(N))))
Problem p03370 (python)

Fixed submission:
#!/usr/bin/env python3
from itertools import product, permutations, combinations
from bisect import bisect_right,bisect_left
INF = float('inf')

N,X=map(int, input().split())
M=[int(input()) for i in range(N)]
Y = X - sum(M)

cnt = N
cnt += (Y // min(M))
print(cnt)

Buggy submission (verdict: Runtime Error):
N,X=map(int, input().split())
M=list(map(int, input().split()))
X = X - sum(M)
cnt += N
cnt += X // min(M)
print(cnt)
Problem p03471 (python)

Fixed submission:
N,Y=map(int, input().split())
result = ["-1","-1","-1"]
for i in range(N+1):
    for j in range(N-i+1):
        k = N - (i + j) 
        x = 10000 * i + 5000 * j + 1000 * k
        if Y == x:
            result = [str(i), str(j), str(k)]
            break
print(" ".join(result))

Buggy submission (verdict: Runtime Error):
N,Y=map(int, input().split())
result = [-1,-1,-1]
for i in range(N):
    for j in range(N):
        k = N - i + j 
        sum = 10000*i + 5000* j + 1000*k
        if Y == sum:
            result = [i, j, k]
            break
print(result.join(" "))

Buggy submission (verdict: Runtime Error):
N,Y=map(int, input().split())
result = [-1,-1,-1]
for i in range(N):
    for j in range(N):
        k = N - i + j 
        sum = 10000*i + 5000* j + 1000*k
        if Y == sum:
            result = [i, j, k]
            break
print(" ".join(result))
Problem p02947 (python)

Fixed submission:
import collections
from math import factorial

N =int(input())
cnts = [frozenset(collections.Counter(list(input())).items()) for _ in range(N)]
xs = collections.Counter(cnts)
ans = 0
for _,v in xs.items():
    if v>1:
        a = factorial(v) // (2*factorial(v - 2))
        ans +=a
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
from math import factorial

N =int(input())
cnts = [frozenset(collections.Counter(list(input())).items()) for _ in range(N)]
xs = collections.Counter(cnts)
ans = 0
for _,v in xs.items():
    if v>=1:
        a = factorial(v) // (2*factorial(v - 2))
        ans +=a
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
from scipy.special import comb
N =int(input())
cnts = [frozenset(collections.Counter(list(input())).items()) for _ in range(N)]
xs = collections.Counter(cnts)
ans = 0
for _,v in xs.items():
    if v>=1:
        a = comb(v, 2, exact=True)
        ans +=a
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
from scipy.special import comb
N =int(input())
cnts = [frozenset(collections.Counter(list(input())).items()) for _ in range(N)]
xs = collections.Counter(cnts)
ans = 0
for _,v in xs.items():
    if v>=1:
        a = comb(v, 2, exact=True)
        ans +=a
print(ans)
Problem p02969 (python)

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

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

def chop(As):
    res = []
    minibatch=[As[0]]
    for i in range(len(As)-1):
        if As[i]<As[i+1]:
            minibatch.append(As[i+1])
        else:
            res.append(minibatch)
            minibatch=[As[i+1]]
    if minibatch:
        res.append(minibatch)
    return res

def kakutei(remains):
    deletes = []
    for i in range (1,len(remains)):
        if remains[0][-1]<remains[i][0]:
            remains[0].extend(remains[i])
            deletes.append(i)
    x = remains[0].copy()
    for d in deletes[::-1]:
        del remains[d]
    del remains[0]
    return (x,remains)

chopped = chop(As)
remains = chopped
res = []
while remains:
    x, remains = kakutei(remains)
    res.append(x)
print(len(res))
Problem p03071 (python)

Fixed submission:
M,N = [int(x) for x in input().split()]
print(M+N if M==N else 2*max(M,N)-1)

Buggy submission (verdict: Runtime Error):
M,N = [int(x) for x in input()]
print(M+N if M==N else 2*max(M,N)-1)
Problem p03171 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
dp = [[0] * n for _ in range(n)]
for i in range(n):
    dp[i][i] = a[i]

for i in range(n - 2, -1, -1):
    for j in range(i + 1, n):
        dp[i][j] = max(a[i] - dp[i + 1][j], a[j] - dp[i][j - 1])

print(dp[0][n - 1])

Buggy submission (verdict: Runtime Error):
def main():
	n = int(input())
	a = list(map(int, input().split()))
	dp = [[0] * n for _ in range(n)]
	for i in range(n):
    	dp[i][i] = a[i]

	for i in range(n - 2, -1, -1):
    	for j in range(i + 1, n):
        	dp[i][j] = max(a[i] - dp[i + 1][j], a[j] - dp[i][j - 1])
	print(dp[0][n - 1])
main()

Buggy submission (verdict: Runtime Error):
n = int(input())
a = tuple(map(int, input().split()))
dp = [(0,) * n for _ in range(n)]
for i in range(n):
    dp[i][i] = a[i]

for i in range(n - 2, -1, -1):
    for j in range(i + 1, n):
        dp[i][j] = max(a[i] - dp[i + 1][j], a[j] - dp[i][j - 1])

print(dp[0][n - 1])

Buggy submission (verdict: Runtime Error):
def main():
	n = int(input())
	a = list(map(int, input().split()))
	dp = [[0] * n for _ in range(n)]
	for i in range(n):
    	dp[i][i] = a[i]
	for i in range(n - 2, -1, -1):
    	for j in range(i + 1, n):
        	dp[i][j] = max(a[i] - dp[i + 1][j], a[j] - dp[i][j - 1])
    print(dp[0][n-1])
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def calc():
	n = int(input())
	a = list(map(int, input().split()))
	dp = [[0] * n for _ in range(n)]
	for i in range(n):
    	dp[i][i] = a[i]
	for i in range(n - 2, -1, -1):
    	for j in range(i + 1, n):
        	dp[i][j] = max(a[i] - dp[i + 1][j], a[j] - dp[i][j - 1])
    return dp[0][n-1]
ans = calc()
print(ans)

Buggy submission (verdict: Runtime Error):


def calc():
	n = int(input())
	a = list(map(int, input().split()))
    dp = [[0] * n for _ in range(n)]
    for i in range(n):
        dp[i][i] = a[i]

    for i in range(n - 2, -1, -1):
        for j in range(i + 1, n):
            dp[i][j] = max(a[i] - dp[i + 1][j], a[j] - dp[i][j - 1])
    return dp[0][n-1]

print(calc())

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

def calc():
    dp = [[0] * n for _ in range(n)]
    for i in range(n):
        dp[i][i] = a[i]

    for i in range(n - 2, -1, -1):
        for j in range(i + 1, n):
            dp[i][j] = max(a[i] - dp[i + 1][j], a[j] - dp[i][j - 1])

dp = calc()
print(dp[0][n - 1])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(x) for x in input().split()]
def calc():
	dp=[]
	for i in range(n):
		dp.append([0]*n)
	for i in range(n):
   		dp[i][i] = a[i]
	for i in range(n - 2, -1, -1):
    	for j in range(i + 1, n):
        	dp[i][j] = max(a[i] - dp[i + 1][j], a[j] - dp[i][j - 1])
    return dp
print(calc()[0][n - 1])

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

dp=[]
for i in range(n):
	dp.append(0)
for i in range(n):
    dp[i][i] = a[i]

for i in range(n - 2, -1, -1):
    for j in range(i + 1, n):
        dp[i][j] = max(a[i] - dp[i + 1][j], a[j] - dp[i][j - 1])

print(dp[0][n - 1])
Problem p03359 (python)

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

Buggy submission (verdict: Runtime Error):
    a,b = [int(x) for x in input().split()]     
    if a <= b:
        print(a)
    if a > b:
        print(a-1)
Problem p03477 (python)

Fixed submission:
a,b,c,d = [int(x) for x in input().split()]
s = a+b
t = c+d
if s==t:
    print("Balanced")
elif s>t:
    print("Left")
else:
    print("Right")

Buggy submission (verdict: Runtime Error):
a,b,c,d = [int(x) for x in input()]
s = a+b
t = c+d
if s==t:
    print("Balanced")
elif s>t:
    print("Left")
else:
    print("Right")
Problem p03773 (python)

Fixed submission:
A,B=map(int,input().split())
print((A+B)%24)

Buggy submission (verdict: Runtime Error):
A,B=int(input().split())
print((A+B)%24)

Buggy submission (verdict: Runtime Error):
A,B=int(input())
print((A+B)%24)
Problem p02812 (python)

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy submission (verdict: Runtime Error):
N = input()
S = input()
count = 0
for i in range(1,int(N)-1):
  if S[i-1] + S[i] + S[i+1] = "ABC":
    count = count + 1
print(count)

Buggy submission (verdict: Runtime Error):
N = input()
S = input()
print(S.count("ABC"))

Buggy submission (verdict: Runtime Error):
n = input()
s = input()
flag = 0
for i in range(1,int(n)-1):
  if s[i-1] + s[i] + s[i+1] = "ABC":
    flag += 1
print(flag)

Buggy submission (verdict: Runtime Error):
n = input()
s = input()
count = 0
for i in range(1,int(n)-1):
  if s[i-1] + s[i] + s[i+1] = "ABC":
    count = count + 1
print(count)

Buggy submission (verdict: Runtime Error):
    n = input()
    s = input()
    flag = 0
    for i in range(1,int(n)-1):
    	if s[i-1]+s[i]+[i+1] = "ABC":
        	flag += 1
    print(flag)

Buggy submission (verdict: Runtime Error):
n = input()
s = input()
flag = 0
for i in range(1,int(n)-1):
	if s[i-1]+s[i]+[i+1] = "ABC"
    	flag += 1
print(flag)

Buggy submission (verdict: Runtime Error):
n = input()
s = input()
flag = 0
for i in range(1,n-1):
	if s[i-1]+s[i]+[i+1] = "ABC"
    	flag=flag+1
print(flag)

Buggy submission (verdict: Runtime Error):
n = input()
s = input()
flag = 0
for i in range(1,n-1):
	if s[i-1]+s[i]+[i+1] = "ABC":
    	flag++
print(flag)

Buggy submission (verdict: Runtime Error):
n = input()
s = input()
flag = 0
for i in range(1,int(n)-1):
	if s[i-1]+s[i]+[i+1] = "ABC"
    	flag++
print(flag)
Problem p02817 (python)

Fixed submission:
str1,str2 = input().split()
str3 = str2 + str1 
print(str3)

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

if k >= a :
  if k >= b :
    if a + b >= k :
      a1 = 0
      b1 = b - k + a
    else :
      a1 = 0
      b1 = 0
  else :
    a1 = 0
    b1 = b - k + a
else :
  a1 = a - k
  b1 = b

print(a1,b1)
Problem p02818 (python)

Fixed submission:
a,b,k = (int(x) for x in input().split())

if k >= a :
  if k >= b :
    if a + b >= k :
      a1 = 0
      b1 = b - k + a
    else :
      a1 = 0
      b1 = 0
  else :
    a1 = 0
    b1 = b - k + a
else :
  a1 = a - k
  b1 = b

print(a1,b1)

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

if k >= a :
  if k >= b :
    if a + b >= k :
      a1 = 0
      b1 = b - k + a
    else :
      a1 = 0
      b1 = 0
  else :
    a1 = 0
    b1 = b - k + a
else :
  a1 = a - k

print(a1,b1)
Problem p02830 (python)

Fixed submission:
n = int(input())
str1,str2 = input().split()
str3 = ""

for i in range(0,n):
  str = (str1 + str2)[i::n]
  str3 += str

print(str3)

Buggy submission (verdict: Runtime Error):
n = int(input())
str1 = input()
str2 = input()
str3 = ""

for i in range(0,n):
  str = (str1 + str2)[i::n]
  str3 += str

print(str3)
Problem p04043 (python)

Fixed submission:
I=input().split()
c5=0
c7=0

for i in I:
  if i=="5":
    c5+=1
  elif i=="7":
    c7+=1
if c5==2 and c7==1:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
I=input().split()
c5=0
c7=0

for i in I:
  if i=="5":
    c5+=1
  elif i=="7":
    c7+=1
if c5==2 and c7=1:
  print("YES")
else:
  print("NO")