Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = int(input())
b = int(input())

result = 0
for n in range(1, N + 1):
   sum_n = 0
   for i in str(n):
       sum_n += int(i)
   if a <= sum_n <= b:
       result += n
print(result)


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

result = 0
for n in range(1, N + 1):
   sum_n = 0
   for i in str(n):
       sum_n += int(i)
   if a <= sum_n <= b:
       result += n
print(result)
Buggy python submission (verdict: Runtime Error):
num1, num2 = [int(i) for i in input().split()]
if num1 == num2
    print('Yes')
else
    print('No')

Fixed submission:
num1, num2 = [int(i) for i in input().split()]
if num1 == num2:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
import sys

num1, num2 = [int(i) for i in input().split()]
if (num1 = num2){
    print('Yes')
}else{
    print('No')
}

Fixed submission:
num1, num2 = [int(i) for i in input().split()]
if num1 == num2:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split())) 
count = 0
ans = 0

for i in range(10):
    ans = (r*f) - D 
    count = count + 1
    print(ans)
    if(count == 10):
        break


Fixed submission:
A = list(map(int, input().split())) 
r = A[0]
D = A[1]
f = A[2]
 
 
count = 0
ans = 0
 
for i in range(10):
    f = (r*f) - D 
    count = count + 1
    print(f)
    if(count == 10):
        break

Buggy python submission (verdict: Runtime Error):
r, D, f = map(int, input().split())
count = 0
ans = 0

for i in range(10):
    ans = (r*f) - D 
    count = count + 1
    print(ans)
    if(count = 10):
        break

Fixed submission:
A = list(map(int, input().split())) 
r = A[0]
D = A[1]
f = A[2]
 
 
count = 0
ans = 0
 
for i in range(10):
    f = (r*f) - D 
    count = count + 1
    print(f)
    if(count == 10):
        break
Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))
S = input()

B = S[A[1]]

if(B == "A"):
    B = "a"
else if(B == "B"):
    B = "b"
else:
    B = "c"

S[A[1]] = B
print(S)

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

C = A[1]
D = A[0]
ans = ""

B = S[C-1]

#print(B)

if(B == "A"):
    B = "a"
elif(B == "B"):
    B = "b"
else:
    B = "c"

#print(B)

for i in range(D):
    if (i == C-1 ):
        ans = ans + B
        continue
    ans = (ans + S[i]) 

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
import subprocess
import re
import datetime
import os

A = []
A[0] = int(input())
A[1] = int(input())
A[2] = int(input())
A[3] = int(input())
A[4] = int(input())
k = int(input())

S = A.sorted()

V = (S[4] - S[0])
if V <= k:
    print("Yay!")
else:
    print(":(")
    

Fixed submission:
import sys
import subprocess
import re
import datetime
import os

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

A = [a,b,c,d,e]
S = sorted(A)



V = (S[4] - S[0])
if V <= k:
    print("Yay!")
else:
    print(":(")
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())

if A == B:
    print(C)
elif A == C:
    print(B)
else:
    print(A)

Fixed submission:
A = input().split()

if A[0] == A[1]:
    print(A[2])
elif A[0] == A[2]:
    print(A[1])
else:
    print(A[0])
Buggy python submission (verdict: Runtime Error):
import os, sys, re, math

A,B,C,D = [int(s) for s in input().split(' ')]

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

ret = B // C - (A-1) // C
ret += B // D - (A-1) // D
ret -= B // lcm - (A-1) // lcm
print(B-A+1-ret)


Fixed submission:
import os, sys, re, math

A,B,C,D = [int(s) for s in input().split(' ')]

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

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

ret = B // C - (A-1) // C
ret += B // D - (A-1) // D
ret -= B // lcm - (A-1) // lcm
print(B-A+1-ret)

Buggy python submission (verdict: Runtime Error):
import os, sys, re, math

A,B,C,D = [int(s) for s in input().split(' ')]

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

ret = B // C - (A-1) // C
ret += B // D - (A-1) // D
ret -= B // lcm - (A-1) // lcm
print(B-A+1-ret)


Fixed submission:
import os, sys, re, math

A,B,C,D = [int(s) for s in input().split(' ')]

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

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

ret = B // C - (A-1) // C
ret += B // D - (A-1) // D
ret -= B // lcm - (A-1) // lcm
print(B-A+1-ret)
Buggy python submission (verdict: Time Limit Exceeded):
import os, sys, re, math

N = int(input())

#memo = [0 for _ in range(int(2*1e5)+1)]
memo = [0 for _ in range(2*int(1e9)+100)]

for _ in range(N):
	A,B = [int(s) for s in input().split(' ')]
	memo[B] += A

s = 0
flg = True
for i in range(len(memo)):
	s += memo[i]
	if s > i:
		flg = False
		break
if flg:
	print('Yes')
else:
	print('No')


Fixed submission:
import os, sys, re, math

N = int(input())

#memo = [0 for _ in range(int(2*1e5)+1)]
memo = {}

for _ in range(N):
	A,B = [int(s) for s in input().split(' ')]
	if B in memo:
		memo[B] += A
	else:
		memo[B] = A

s = 0
flg = True
key = list(memo.keys())
key = sorted(key)
for i in range(len(key)):
	s += memo[key[i]]
	if s > key[i]:
		flg = False
		break
if flg:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
import os, sys, re, math

N = int(input())

#memo = [0 for _ in range(int(2*1e5)+1)]
memo = [0 for _ in range(2*int(1e5)+100)]

for _ in range(N):
	A,B = [int(s) for s in input().split(' ')]
	memo[B] += A

s = 0
flg = True
for i in range(len(memo)):
	s += memo[i]
	if s > i:
		flg = False
		break
if flg:
	print('Yes')
else:
	print('No')


Fixed submission:
import os, sys, re, math

N = int(input())

#memo = [0 for _ in range(int(2*1e5)+1)]
memo = {}

for _ in range(N):
	A,B = [int(s) for s in input().split(' ')]
	if B in memo:
		memo[B] += A
	else:
		memo[B] = A

s = 0
flg = True
key = list(memo.keys())
key = sorted(key)
for i in range(len(key)):
	s += memo[key[i]]
	if s > key[i]:
		flg = False
		break
if flg:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import os, sys, re, math, queue


def run_it():
	H,W = list(map(int,input().split(' ')))
	
	s_ary = []
	l_memo = [[0 for j in range(W)] for i in range(H)]
	r_memo = [[0 for j in range(W)] for i in range(H)]
	u_memo = [[0 for j in range(W)] for i in range(H)]
	b_memo = [[0 for j in range(W)] for i in range(H)]
	
	for _ in range(H):
		s_ary.append(input())
	
	for h in range(H):
		for w in range(W):
			if s_ary[h][w] == '.':
				if w == 0:	
					l_memo[h][w] = 1
				elif w > 0:
					l_memo[h][w] = l_memo[h][w-1] + 1
				if h == 0:
					u_memo[h][w] = 1
				elif h > 0:
					u_memo[h][w] = u_memo[h-1][w] + 1
			
			if s_ary[-h-1][-w-1] == '.':
				if w == 0:
					r_memo[-h-1][-w-1] = 1
				elif w > 0:
					r_memo[-h-1][-w-1] = r_memo[-h-1][-w] + 1	
				if h == 0:
					b_memo[-h-1][-w-1] = 1
				elif h > 0:
					b_memo[-h-1][-w-1] = b_memo[-h][-w-1] + 1
	
	ret = 0
	for h in range(H):
		for w in range(W):
			tmp = l_memo[h][w] + r_memo[h][w] + u_memo[h][w] + b_memo[h][w] - 3
			ret = max(ret, tmp)
	
	print(ret)
				
if sys.platform == 'ios':
	for i in range(2):
		sys.stdin = open('Dtest' + str(i) + '.txt')
		run_it()
else:
	run_it()

Fixed submission:
import os, sys, re, math, queue


def run_it():
	H,W = list(map(int,input().split(' ')))
	
	s_ary = []
	l_memo = [[0 for j in range(W)] for i in range(H)]
	r_memo = [[0 for j in range(W)] for i in range(H)]
	u_memo = [[0 for j in range(W)] for i in range(H)]
	b_memo = [[0 for j in range(W)] for i in range(H)]
	
	for _ in range(H):
		s_ary.append(input())
	
	for h in range(H):
		for w in range(W):
			if s_ary[h][w] == '.':
				if w == 0:	
					l_memo[h][w] = 1
				elif w > 0:
					l_memo[h][w] = l_memo[h][w-1] + 1
				if h == 0:
					u_memo[h][w] = 1
				elif h > 0:
					u_memo[h][w] = u_memo[h-1][w] + 1
			
			if s_ary[-h-1][-w-1] == '.':
				if w == 0:
					r_memo[-h-1][-w-1] = 1
				elif w > 0:
					r_memo[-h-1][-w-1] = r_memo[-h-1][-w] + 1	
				if h == 0:
					b_memo[-h-1][-w-1] = 1
				elif h > 0:
					b_memo[-h-1][-w-1] = b_memo[-h][-w-1] + 1
	
	ret = 0
	for h in range(H):
		for w in range(W):
			tmp = l_memo[h][w] + r_memo[h][w] + u_memo[h][w] + b_memo[h][w] - 3
			ret = max(ret, tmp)
	
	print(ret)
				
if sys.platform == 'ios':
	for i in range(2):
		sys.stdin = open('Dtest' + str(i) + '.txt')
		run_it()
else:
	run_it()
Buggy python submission (verdict: Time Limit Exceeded):
import os, sys, re, math

N, M = [int(s) for s in input().split(' ')]

cards = [True for _ in range(N+1)]
cards[0] = False

for _ in range(M):
    l,r = [int(s) for s in input().split(' ')]
    for i in range(1,l):
        cards[i] = False
    for j in range(r+1,len(cards)):
        cards[j] = False

print(sum(cards))


Fixed submission:
import os, sys, re, math

N, M = [int(s) for s in input().split(' ')]

min_idx = 1
max_idx = 1e+5

for _ in range(M):
    l,r = [int(s) for s in input().split(' ')]
    min_idx = max(min_idx, l)
    max_idx = min(max_idx, r)
if max_idx >= min_idx:
    print(min(N, int(max_idx - min_idx + 1)))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
import os, sys, re, math, queue

N = int(input())
colors = [-1 for _ in range(N+1)]
nodes = {}

for _ in range(N-1):
	u,v,w = list(map(int,input().split(' ')))
	if u in nodes:
		nodes[u].append((v,w % 2))
	else:
		nodes[u] = [(v,w % 2)]

	if v in nodes:		
		nodes[v].append((u,w % 2))
	else:
		nodes[v] = [(u,w % 2)]

q = queue.Queue()
fst = list(nodes.keys())[0]
q.put((fst,0))

while not q.empty():
	pos, color = q.get()
	colors[pos] = color
	for cand in nodes[pos]:
		if colors[cand[0]] == -1:
			q.put((cand[0], (color+cand[1]) % 2)

for i in range(N):
	print(colors[i+1])
		


Fixed submission:
import os, sys, re, math, queue

N = int(input())

nodes = {}
colors = [-1 for _ in range(N+1)]
for _ in range(N-1):
    s = input().split(' ')
    u,v,w = int(s[0]), int(s[1]), int(s[2])
    if u not in nodes:
        nodes[u] = [(v,w)]
    else:
        nodes[u].append((v,w))

    if v not in nodes:
        nodes[v] = [(u,w)]
    else:
        nodes[v].append((u,w))

q = queue.Queue()
f = list(nodes.keys())[0]
q.put((f,0))

while not q.empty():
    cur = q.get()
    colors[cur[0]] = cur[1]
    next = nodes[cur[0]]
    for n in next:
        if colors[n[0]] == -1:
            if n[1] % 2 == 0:
                q.put((n[0], cur[1]))
            else:
                q.put((n[0], (cur[1]+1) % 2))

for i in range(N):
    print(colors[i+1])
Buggy python submission (verdict: Runtime Error):
import os, sys, re, math

n,k = input().split(',')
print(int(n)-int(k)+1)

Fixed submission:
import os, sys, re, math

n,k = input().split(' ')
print(int(n)-int(k)+1)
Buggy python submission (verdict: Time Limit Exceeded):
import os, sys, re, math

r,g,b,n = input().split(' ')
r,g,b,n = int(r), int(g), int(b), int(n)

ret = 0
ri = 0
while (ri * r <= n):
    rg = 0
    while (rg * g <= n - ri * r):
        if ((n - ri *r - rg * g) % b == 0):
            ret += 1    
        rg += 1
    ri += 1

print(ret)


Fixed submission:
import os, sys, re, math

r,g,b,n = input().split(' ')
r,g,b,n = int(r), int(g), int(b), int(n)

ret = 0
ri = 0
while (ri * r <= n):
    rg = 0
    while (rg * g <= n - ri * r):
        if ((n - ri * r - rg * g) % b == 0):
            ret += 1
        rg += 1
    ri += 1

print(ret)
Buggy python submission (verdict: Runtime Error):
import os, sys, re, math

inary = [int(s) for s in raw_input().split(' ')]

t = inary[0]
ret = 0
while t < inary[2]:
  ret += inary[1]
  t += inary[0]

print(ret)

Fixed submission:
import os, sys, re, math

a,b,t = [s for s in input().split(' ')]
A = int(a)
B = int(b)
T = int(t) + 0.5
t = A
ret = 0
while  t < T:
  ret += B
  t += A

print(ret)
Buggy python submission (verdict: Time Limit Exceeded):
import os, sys, re, math, fractions

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

def common_gcd(ex_idx):
    ret = 0
    for i in range(N):
        if i != ex_idx:
            if ret == 0:
                ret = A[i]
            else:
                ret = fractions.gcd(ret, A[i])
    return ret

ret = 1
for j in range(N):
    ret = max(ret, common_gcd(j))

print(ret)


Fixed submission:
import os, sys, re, math, fractions

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

memo_L = [1] * N
memo_R = [1] * N

for i in range(N):
    if i == 0:
        memo_L[i] = A[i]
        memo_R[i] = A[N-1]
    elif i == N - 1:
        memo_L[i] = fractions.gcd(A[i], memo_L[i-1])
        memo_R[i] = fractions.gcd(A[0], memo_R[i-1])
    else:
        memo_L[i] = fractions.gcd(A[i], memo_L[i-1])
        memo_R[i] = fractions.gcd(A[N-1-i], memo_R[i-1])

memo_R.reverse()

ret = 1
for j in range(N):
    if j == 0:
        ret = max(ret, memo_R[1])
    elif j == N-1:
        ret = max(ret, memo_L[j-1])
    else:
        common_gcd = fractions.gcd(memo_L[j-1], memo_R[j+1])
        ret = max(ret, common_gcd)

print(ret)

Buggy python submission (verdict: Runtime Error):
import os, sys, re, math

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

def common_gcd(ex_idx):
    ret = 0
    for i in range(N):
        if i != ex_idx:
            if ret == 0:
                ret = A[i]
            else:
                ret = math.gcd(ret, A[i])
    return ret

ret = 1
for j in range(N):
    ret = max(ret, common_gcd(j))

print(ret)


Fixed submission:
import os, sys, re, math, fractions

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

memo_L = [1] * N
memo_R = [1] * N

for i in range(N):
    if i == 0:
        memo_L[i] = A[i]
        memo_R[i] = A[N-1]
    elif i == N - 1:
        memo_L[i] = fractions.gcd(A[i], memo_L[i-1])
        memo_R[i] = fractions.gcd(A[0], memo_R[i-1])
    else:
        memo_L[i] = fractions.gcd(A[i], memo_L[i-1])
        memo_R[i] = fractions.gcd(A[N-1-i], memo_R[i-1])

memo_R.reverse()

ret = 1
for j in range(N):
    if j == 0:
        ret = max(ret, memo_R[1])
    elif j == N-1:
        ret = max(ret, memo_L[j-1])
    else:
        common_gcd = fractions.gcd(memo_L[j-1], memo_R[j+1])
        ret = max(ret, common_gcd)

print(ret)
Buggy python submission (verdict: Runtime Error):
import os, sys, re, math

N,K = map(int,input().split(' '))

candle = list(map(int,input().split(' ')))
ret = math.inf

for i in range(N-K+1):
    s = candle[i]
    e = candle[i+K-1]
    if e < 0:
        ret = min(-s, ret)
    elif s > 0:
        ret = min(e, ret)
    else:
        ret = min(-s*2+e, -s+e*2, ret)

print(ret)


Fixed submission:
import os, sys, re, math

N,K = map(int,input().split(' '))

candle = list(map(int,input().split(' ')))
ret = float('inf')

for i in range(N-K+1):
    s = candle[i]
    e = candle[i+K-1]
    if e < 0:
        ret = min(-s, ret)
    elif s > 0:
        ret = min(e, ret)
    else:
        ret = min(-s*2+e, -s+e*2, ret)

print(ret)

Buggy python submission (verdict: Runtime Error):
import os, sys, re, math

N,K = map(int,input().split(' '))

candle = list(map(int,input().split(' ')))
ret = math.inf

for i in range(N-K+1):
    s = candle[i]
    e = candle[i+K-1]
    if e < 0:
        ret = min(-s, ret)
    elif s > 0:
        ret = min(e, ret)
    else:
        ret = min(-s*2+e, -s+e*2, ret)

print(ret)


Fixed submission:
import os, sys, re, math

N,K = map(int,input().split(' '))

candle = list(map(int,input().split(' ')))
ret = float('inf')

for i in range(N-K+1):
    s = candle[i]
    e = candle[i+K-1]
    if e < 0:
        ret = min(-s, ret)
    elif s > 0:
        ret = min(e, ret)
    else:
        ret = min(-s*2+e, -s+e*2, ret)

print(ret)
Buggy python submission (verdict: Runtime Error):
import os, sys, re, math

def oneidx(S):
    idx = -1
    for s in S:
        if s == '1':
            idx += 1
        else:
            break
    return idx

S = input()
N = int(input())
idx = oneidx(S)

if idx >= N:
    print(N)
else:
    print(S[idx+1])


Fixed submission:
import os, sys, re, math

def oneidx(S):
    idx = -1
    for s in S:
        if s == '1':
            idx += 1
        else:
            break
    return idx

S = input()
N = int(input()) - 1
idx = oneidx(S)

if idx >= N:
    print('1')
else:
    print(S[idx+1])
Buggy python submission (verdict: Time Limit Exceeded):
import os, sys, re, math

N,M = list(map(int,input().split(' ')))
ary = list(map(int,input().split(' ')))

s = [0 for i in range(N+1)]
for i in range(N):
    s[i+1] = ary[i] + s[i]

cnt = 0
for j in range(N,0,-1):
    for k in range(j,0,-1):
        if j == k:
            if s[j] % M == 0 and s[j] >= M:
                cnt += 1
        elif (s[j] - s[k]) % M == 0:
            cnt += 1
print(cnt)


Fixed submission:
import os, sys, re, math

N,M = list(map(int,input().split(' ')))
ary = list(map(int,input().split(' ')))

s = [0 for i in range(N+1)]
for i in range(N):
    s[i+1] = (ary[i] + s[i]) % M

m_map = {}

for j in range(0,N+1):
    if s[j] in m_map:
        m_map[s[j]] += 1
    else:
        m_map[s[j]] = 1

ret = 0
for i,v in m_map.items():
    if v >= 2:
        ret += v * (v-1) // 2
print(ret)
Buggy python submission (verdict: Time Limit Exceeded):
import os, sys, re, math

n = int(input())
a = list(map(int,input().split(' ')))


cnt = 0
while True:
    a.sort(reverse=True)
    if (sum(map(lambda x: x % 2, a))) == n:
        break
    flg = False
    for i in range(n):
        if a[i] % 2 == 0 and flg == False:
            a[i] = a[i] // 2
            flg = True
        else:
            a[i] = a[i] * 3
    cnt += 1

print(cnt)


Fixed submission:
import os, sys, re, math

n = int(input())
a = list(map(int,input().split(' ')))


cnt = 0
for ai in a:
    while ai % 2 == 0:
        cnt += 1
        ai = ai // 2
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
s = raw_input()

while s.find('ST') > -1:
    s = ''.join(s.split('ST'))

print len(s)

Fixed submission:
s = raw_input()

#while s.find('ST') > -1:
#    s = ''.join(s.split('ST'))
#
#print len(s)

temp = []
for i in range(len(s)):
    now = s[i]
    if len(temp) == 0:
        temp.append(now)
    elif temp[-1] + now == 'ST':
        temp.pop()
    else:
        temp.append(now)

print len(temp)
Buggy python submission (verdict: Runtime Error):
### -*- coding: utf-8 -*-

splited = input().split("\n")
N = int(splited[0])
nums = list(map(int, splited[1].split()))

hitting = 1
isHitOnce = False
for num in nums:
    if num == hitting:
        hitting += 1
        isHitOnce = True

if hitting == 1:
    print(-1)
else:
    print(N - (hitting - 1))

Fixed submission:
### -*- coding: utf-8 -*-

N = int(input())
nums = list(map(int, input().split()))
 
hitting = 1
isHitOnce = False
for num in nums:
    if num == hitting:
        hitting += 1
        isHitOnce = True
 
if hitting == 1:
    print(-1)
else:
    print(N - (hitting - 1))
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = map(int, input().split())
m = 1

if n > 1:
    for i, pi in enumerate(p):
        if pi <= i:
            continue
        elif all([pj >= pi for pj in p[:i]]):
            m += 1
        else:
            continue

print(m)


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

q = p[0]
p = p[1:]

m = 1

if n > 1:
    for pi in p:
        if q > pi:
            m += 1
            q = pi

print(m)

Buggy python submission (verdict: Runtime Error):
n = int(input())
p = map(int, input().split())
m = 1

if len(pi) > 1:
    for i, pi in enumerate(p):
        if pi <= i:
            continue
        elif all([pj >= pi for pj in p[:i]]):
            m += 1
        else:
            continue

print(m)


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

q = p[0]
p = p[1:]

m = 1

if n > 1:
    for pi in p:
        if q > pi:
            m += 1
            q = pi

print(m)
Buggy python submission (verdict: Runtime Error):
def read_ints(row):
    return list(map(int, row().split()))
  
row = stdin.readline
N,M = read_ints(row)
print(N == M)

Fixed submission:
def read_ints(row):
    return list(map(int, row().split()))
  
import sys
 
row =sys.stdin.readline
N,M = read_ints(row)
print("Yes" if N == M else "No")
Buggy python submission (verdict: Runtime Error):
import sys
# row = sys.stdin.readline
row = open('input.txt', 'r').readline
def read_string(row):
    return row().rstrip()
  
inp = read_string(row)
print(chr(ord(inp) + 1))

Fixed submission:
import sys

row = sys.stdin.readline
# row = open('input.txt', 'r').readline
def read_string(row):
    return row().rstrip()
  
inp = read_string(row)
print(chr(ord(inp) + 1))
Buggy python submission (verdict: Runtime Error):
import sys
row = sys.stdin.readline
 
 
def read_int(row):
    return int(row().rstrip())
 
def read_string(row):
    return row().rstrip()
  
N = read_int(row)
S = read_string(row)
 
cnt = 0
for i in range(0, len(S) -3):
    if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
        cnt +=1
print(cnt)
import sys
row = sys.stdin.readline


def read_int(row):
    return int(row().rstrip())

def read_string(row):
    return row().rstrip()
  
N = read_int(row)
S = read_string(row)

cnt = 0
for i in range(0, len(S) -2):
    if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
        cnt +=1
print(cnt)
提出情報
提出日時

Fixed submission:
import sys
row = sys.stdin.readline
def read_int(row):
    return int(row().rstrip())

def read_string(row):
    return row().rstrip()
  
N = read_int(row)
S = read_string(row)

cnt = 0
for i in range(0, len(S) -2):
    if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
        cnt +=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
import sys
row = sys.stdin.readline
 
def read_ints(row):
    return list(map(int, row().split()))
  
A ,B ,K = read_ints(row)
 
result_A = 0 if A <= K else A-K
result_B = max(B -(K-A)) if A <= K else B
print(result_A,result_B)

Fixed submission:
import sys
row = sys.stdin.readline
 
def read_ints(row):
    return list(map(int, row().split()))
  
A ,B ,K = read_ints(row)
 
print(max(0, A - K),max(0, B-max(0,(K-A))))
Buggy python submission (verdict: Runtime Error):
import sys
row = sys.stdin.readline
 
ls = list(row())
s = sum([1 for i in range(1, len(ls) + 1) if ls[i-1] == ls[i]])
print("Good" if s+1 == len(ls) else "Bad")


Fixed submission:
import sys
row = sys.stdin.readline
 
ls = list(row())
s = sum([1 for i in range(1, len(ls)) if ls[i-1] != ls[i]])
print("Good" if s+1 == len(ls) else "Bad")

Buggy python submission (verdict: Runtime Error):
import sys
row = sys.stdin.readline
 
ls = list(row())
s = sum([1 for i in range(1, len(ls) + 1) if ls[i-1] == ls[i]])
print("Good" if s == len(ls) else "Bad")


Fixed submission:
import sys
row = sys.stdin.readline
 
ls = list(row())
s = sum([1 for i in range(1, len(ls)) if ls[i-1] != ls[i]])
print("Good" if s+1 == len(ls) else "Bad")
Buggy python submission (verdict: Runtime Error):
x,y = input()
if x == y:
  print("Yes")
else:
  print("No")
 

Fixed submission:
x,y = input().split()
if x == y:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
if K % 2 == 0:
    a = N // K 
    b = N // (k / 2) - a 
    print(a**3 + b ** 3)
else:
    a = N // K
    print(a**3)

Fixed submission:
n,k = map(int,input().split())
if k % 2 ==1:
    a = n // k 
    print(a ** 3)
else:
    a = n // k
    if (a * k + k // 2) > n:
        print(2 * (a ** 3))
    else:
        print((a + 1) ** 3 + a ** 3)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
if K % 2 == 0:
    a = N // K 
    b = N // (k / 2) - a 
    print(a**3 + b ** 3)
else:
    a = N // K
    print(a**3)

Fixed submission:
n,k = map(int,input().split())
if k % 2 ==1:
    a = n // k 
    print(a ** 3)
else:
    a = n // k
    if (a * k + k // 2) > n:
        print(2 * (a ** 3))
    else:
        print((a + 1) ** 3 + a ** 3)