Problem p02812 (python)

Fixed submission:
N = int(input())
S = str(input())
 


count = 0    
for i in range(N-2):
  if S[i] == 'A':
    if S[i+1] == 'B' and S[i+2] == 'C':
      count += 1
    
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
 
__DEBUG__ = False
 
def main():
    count = 0    
    for i in range(N-2):
        if __DEBUG__: print(f"checking {S[i]} at index: {i}")
        if S[i] == 'A':
            if S[i+1] == 'B' and S[i+2] == 'C':
                count += 1
                # continue
    return count
 
    
if __name__ == '__main__':
  print(main())

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
 
__DEBUG__ = False
 
def solution():
    count = 0    
    for i in range(N-2):
        if __DEBUG__: print(f"checking {S[i]} at index: {i}")
        if S[i] == 'A':
            if S[i+1] == 'B' and S[i+2] == 'C':
                count += 1
                # continue
    return count
 
    
if __name__ == '__main__':
  	import sys, threading
  	sys.setrecursionlimit(200000)
    threading.stack_size(10240000)
    print(solution())

Buggy submission (verdict: Runtime Error):
def read_int(): return int(input())
N = read_int()
def read_str(): return input().strip()
S = list(read_str())
 
__DEBUG__ = False
 
def solution():
    count = 0    
    for i in range(N-2):
        if __DEBUG__: print(f"checking {S[i]} at index: {i}")
        if S[i] == 'A':
            if S[i+1] == 'B' and S[i+2] == 'C':
                count += 1
                # continue
    return count
 
    
if __name__ == '__main__':
  	import sys, threading
  	sys.setrecursionlimit(200000)
    threading.stack_size(10240000)
    print(solution())

Buggy submission (verdict: Runtime Error):
def read_int(): return int(input())
N = read_int()
def read_str(): return input().strip()
S = list(read_str())
 
__DEBUG__ = False
 
def solution():
    count = 0    
    for i in range(N-2):
        if __DEBUG__: print(f"checking {S[i]} at index: {i}")
        if S[i] == 'A':
            if S[i+1] == 'B' and S[i+2] == 'C':
                count += 1
                # continue
    return count
 
    
if __name__ == '__main__':
  	import sys
  	sys.setrecursionlimit(200000)
    print(solution())

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 14 09:20:52 2020

@author: zkwbl7u
"""

def read_int(): return int(input())
N = read_int()
def read_str(): return input().strip()
S = list(read_str())

__DEBUG__ = False

def solution():
    count = 0    
    for i in range(N-2):
        if __DEBUG__: print(f"checking {S[i]} at index: {i}")
        if S[i] == 'A':
            if S[i+1] == 'B' and S[i+2] == 'C':
                count += 1
                # continue
    return count

    
if __name__ == '__main__':
    print(solution())

Buggy submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc150/tasks/abc150_b
import sys
def read_int(): return int(input())
def read_str(): return input().strip()
def read_str_n(): return list(map(str, input().split()))

def error_print(*args): print(*args, file=sys.stderr)
def mt(f):
    import time
 
    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()
 
        error_print(e - s, 'sec')
        return ret
 
    return wrap



__DEBUG__ = False

if __DEBUG__:
    N = 33
    S = list('ABCCABCBABCCABACBCBBABCBCBCBCABCB')
else:
    N = read_int()
    # print(f"N = {N}")
    S = list(read_str())
    # print(f"S = {S}")
    

@mt
def solution():
    count = 0    
    for i in range(N-2):
        if __DEBUG__: print(f"checking {S[i]} at index: {i}")
        if S[i] == 'A':
            if S[i+1] == 'B' and S[i+2] == 'C':
                count += 1
                continue
    return count

    
if __name__ == '__main__':
    solution()

Buggy submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc150/tasks/abc150_b
import sys
def read_int(): return int(input())
def read_str(): return input().strip()
def read_str_n(): return list(map(str, input().split()))

def error_print(*args): print(*args, file=sys.stderr)
def mt(f):
    import time
 
    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()
 
        error_print(e - s, 'sec')
        return ret
 
    return wrap



__DEBUG__ = False

if __DEBUG__:
    N = 33
    S = list('ABCCABCBABCCABACBCBBABCBCBCBCABCB')
else:
    N = read_int()
    # print(f"N = {N}")
    S = list(read_str())
    # print(f"S = {S}")
    

@mt
def solution():
    count = 0    
    for i in range(N-2):
        if __DEBUG__: print(f"checking {S[i]} at index: {i}")
        if S[i] == 'A':
            if S[i+1] == 'B' and S[i+2] == 'C':
                count += 1
                continue
    
    print(f"{count}")
    
if __name__ == '__main__':
    solution()

Buggy submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc150/tasks/abc150_b
import sys
def read_int(): return int(input())
def read_str_n(): return list(map(str, input().split()))

def error_print(*args): print(*args, file=sys.stderr)
def mt(f):
    import time
 
    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()
 
        error_print(e - s, 'sec')
        return ret
 
    return wrap



__DEBUG__ = False

if __DEBUG__:
    N = 33
    S = list('ABCCABCBABCCABACBCBBABCBCBCBCABCB')
else:
    N = read_int()
    S = read_str_n()

@mt
def solution():
    count = 0    
    for i in range(N-2):
        if __DEBUG__: print(f"checking {S[i]} at index: {i}")
        if S[i] == 'A':
            if S[i+1] == 'B' and S[i+2] == 'C':
                count += 1
                continue
    
    
    print(f"{count}")
    
if __name__ == '__main__':
    solution()

Buggy submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc150/tasks/abc150_b
import sys
def read_int(): return int(input())
def read_str_n(): return list(map(str, input().split()))

def error_print(*args): print(*args, file=sys.stderr)
def mt(f):
    import time
 
    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()
 
        error_print(e - s, 'sec')
        return ret
 
    return wrap



__DEBUG__ = False

if __DEBUG__:
    N = 33
    S = list('ABCCABCBABCCABACBCBBABCBCBCBCABCB')
else:
    N = read_int()
    S = read_str_n()

@mt
def solution():
    count = 0    
    for i in range(N-2):
        if __DEBUG__: print(f"checking {S[i]} at index: {i}")
        if S[i] == 'A':
            if S[i+1] == 'B' and S[i+2] == 'C':
                count += 1
                continue
    
    
    print(f"{count}")
    
if __name__ == '__main__':
    solution()