TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
put=int(Input())
str=str(Intput())
print(str.count("ABC"))

Num=int(Input())
Str=str(Input())
print(str.count("ABC"))

N = int(input())
S = str(input())
print(S.count("ABC"))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = int(input())
S = input()

num = 0
for i in range(len(S)-2):
  if S[i:i+2] = "ABC":
    num += 1
  else:
    num = num

print(num)

N = int(input())
S = str(input())
 
num = 0
for i in range(N-2):
  if S[i:i+2] = "ABC":
    num += 1
  else:
    num += 0
print(num)

N = int(input())
S = input()
 
num = 0
for i in len(S)-2:
  if S[i:i+2] = "ABC":
    num += 1
  else:
    num = num
print(num)

N = int(input())
S = input()
 
num = 0
for i in range(N-2):
  if S[i:i+2] = "ABC":
    num += 1
  else:
    num += 0
print(num)

N = int(input())
S = str(input())

num = 0
for i in range(N-2):
  if S[i:i+3] == "ABC":
    num += 1
  else:
    num += 0
print(num)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = int(input())
S = list(input())
cnt =0
for i in range(n-2):
  if S[i] =="A":
    if S[i+1] =="B":
      if S[i+2] == "C":
        cnt +=1
print(cnt)

N = int(input())
S = list(input())
cnt =0
for i in range(N-2):
  if S[i] =="A":
    if S[i+1] =="B":
      if S[i+2] == "C":
        cnt +=1
print(cnt)

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input())
s = input()

print(s.count("ABC")

n = int(input())
s= input()
print(s.count("ABC"))

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
s = input()
print(s.count('ABC'))

n=int(input())
s=input()
ans=0
for i in range(n-2):
  if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
    ans+=1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = int(input())
S = input()
ans = 0
for i in range(N - 2):
    if S[i] == "A" and [i + 1] == "B" and S[i + 2] == "C":
        ans += 1
print(ans)

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

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N=int(input())
S=input
c=0
for i in range(0,N-2):
  if S[i:i+2]="ABC":
    c+=1
return c    

N=int(input())
S=input
c=0
for i in range(0,N-2):
  if S[i;i+2]="ABC":
    c+=1
return c    

N=int(input())
S=input()
c=0
for i in range(N-2):
  if S[i:i+3]=="ABC":
    c+=1
print(c) 

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n=int(input())
s=input()
j=0
count=0
for i in range(n):
    u=s[i:i+1]
    print(u)
    if j==0 and u=="A":
        j=1
    elif j==0 and u!="A":
        j=0
    elif j==1 and u=="B":
        j=2
    elif j==1 and u!="B":
        j=0
    elif j==2 and u=="C":
        j=0
        count+=1
    elif j==2 and u!="C":
        j=0
print(count)

n=int(input())
s=input()
j=0
count=0
for i in range(n):
    u=s[i:i+1]
    #print(u)
    if j==0 and u=="A":
        j=1
    elif j==0 and u!="A":
        j=0
    elif j==1 and u=="B":
        j=2
    elif j==1 and u!="B":
        j=0
    elif j==2 and u=="C":
        j=3
        count+=1
    elif j==2 and u!="C":
        j=0
print(count)

n=int(input())
s=input()
count=0
for i in range(n):
    u=s[i:i+3]
    if u=="ABC":
        count=count+1
    #print(u)

print(count)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n=int(input())

s=input()
counter=0 
for i in range(n-2):
    if s[i]=="a" and s[i+1]=="b" and s[i+2]=="c":
        counter = counter + 1
print(counter)

n=int(input())

s=input()
counter=0 
for i in range(n-2):
    if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
        counter = counter + 1
print(counter)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
def main():
  N = int(input())
  S = str(input())
  l = 0
  ans = 0
  p = ''
  for i in range(N):
      if S[i] == 'A' and p == '':
          l += 1
          p = S[i]
      elif S[i] == 'B' and l == 1 and p == 'A':
          l += 1
      elif S[i] == 'C' and l == 2 and p == 'B':
          ans += 1
          l = 0
      else:
          l = 0
          p = ''
  print(ans)
main()

def main():
  N = int(input())
  S = str(input())
  ans = 0
  for i in range(N - 2):
      if S[i] == 'A' and S[i + 1] == 'B' and S[i + 2] == 'C':
        ans += 1
  print(ans)
main()

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):

def search(N):
    ans = False
    if not N >= 90:
        for i in range(1,10):
            if N%i == 0 and 1 <= N // i <= 9:
                ans = True
                break
            else:
                pass        
    return ans

N = int(input())
if search(N):
    print("Yes")
else:
    print("No")




def splitlist(List, n=3):
    N = len(List)
    for i in range(N):
        yield List[i:i+n]

_ = int(input())
S = list(input())
S1 = list(splitlist(S))

import collections
print(S1.count(["A", "B", "C"]))

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
inputA= int(input())
inputB =map(input())

print(inputB.count('ABC'))

inputA,inputB =map(input())

print(inputB.count('ABC'))

inputA= int(input())
inputB =map(str,input())

print(inputB.count('ABC'))

N = int(input())
S = str(input())


if S[:N//2] == S[N//2:N]:
    print("Yes")
else:
    print("No")

inputA= int(input())
inputB =map(str,input().split())

print(inputB.count('ABC'))

inputA= int(input())
inputB =input()

print(inputB.count('ABC'))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N=int(input())
S=input()
count=0
for i in range(N-2):
  if(S[i:3:]=="ABC"):
    count+=1
print(count)

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

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

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
# -*- coding: utf-8 -*-
n = int(input())
s = list(input())
 
result = 0
for range(len(s)):
  if s > n - 3:
    break
  if (s[i] == 'A' and s[i+1] == 'B' and s[i+2] == 'C'):
    result = result + 1
    
print(result)


# -*- coding: utf-8 -*-
n = int(input())
s = list(input())

result = 0
for(int i = 0; i < n - 3; i++):
  if (s[i] == 'A' and s[i+1] == 'B' and s[i+2] == 'C'):
    result = result + 1
    
print(result)

n = int(input())
s = list(input())

result = 0
for i in range(len(s)):
    if (i > n - 3):
        break
    if (s[i] == 'A' and s[i+1] == 'B' and s[i+2] == 'C'):
        result = result + 1

print(result)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input()); s = input() ; c = 0

for i in range(n):
    a = s[i-3:i]
    print(a)
    if a == 'ABC':
        c += 1
print(c)

n = int(input())
s = input()
ans = 0

for i in range(n-2):
    print(s[i:i+3])
    if s[i:i+3] == 'ABC':
        ans += 1
print(ans)

n = int(input())
s = input()
ans = 0

for i in range(n-2):
    if s[i:i+3] == 'ABC':
        ans += 1
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
https://atcoder.jp/contests/abc150/submitinput()
s = input()
ans = 0
while 1:
    pos = s.find('ABC')
    if pos == -1:
        break
    ans += 1
    s = s[pos + 3:]
print(ans)

input()
s = input()
ans = 0
while 1:
    pos = s.find('ABC')
    if pos == -1:
        break
    ans += 1
    s = s[pos + 3:]
print(ans)

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = int(input())
S = input()
count = 0
for i in range(N-2):
  print(S[i:i+3])
  if S[i:i+3] == 'ABC':
    count += 1
print(count)

N = int(input())
S = input()
count = 0
for i in range(N-2):
  if S[i:i+3] == 'ABC':
    count += 1
print(count)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = int(input())
S = str(input())

cnt = 0

for i in range(0,len(S):
  if S[i]  == 'A' and  S[i+1] == 'B' and S[i+2] == 'C':
   cnt += 1


print(cnt)


N = int(input())
S = str(input())

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)

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input())
s = str(input())
count = 0
for i in range(n):
    if s[i] == 'a' or 'A':
        if s[i + 1] == 'b' or 'B':
            if s[i + 2] == 'c' or 'C':
                count += 1
print(count)

n = int(input())
s = str(input())
count = 0
for i in range(n):
    if s[i] == 'a':
        if s[i + 1] == 'b':
            if s[i + 2] == 'c':
                count += 1
print(count)

n = int(input())
s = str(input())
count = 0
for i in range(n):
    if s[i] == 'a' or s[i] == 'A':
        if i + 1 < n:
            if s[i + 1] == 'b' or s[i + 1] == 'B':
                if i + 2 < n:
                    if s[i + 2] == 'c' or s[i + 2] ==  'C':
                        count += 1
print(count)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N=int(input())
A=input()

i=0
ans=0
while(True):
  if i>N-3:
    break
  if A[i]=='A' and A[i+1]=='B' and A[i+2]=='C':
    ans+=1
    i+=3
  else:
    i+=1

N=int(input())
A=input()

i=0
ans=0
while(True):
  if i>N-3:
    break
  if A[i]=='A' and A[i+1]=='B' and A[i+2]=='C':
    ans+=1
    i+=3
  else:
    i+=1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = int(input())
S = str(input())
p = "abc"
print(S.count("abc"))


N = int(input())
S = str(input())
S = S.replace("abc","pq")
print(N - len(S))


N = int(input())
S = str(input())
p = "abc"
print(N.count(p))

N = int(input())
S = str(input())
p = "abc"
print(S.count(p))


N = int(input())
S = str(input())
S.replace("abc","pq")
print(N - len(S))


N = int(input())
S = str(input())
p = "abc"
print(len(re.findall("abc", S)))


N = int(input())
S = str(input())
p = "abc"
print(s.count(p))

N = int(input())
S = input()
p = "abc"
print(s.count(p))

N = int(input())
S = str(input())
S.replace("abc","pq")
print(len(S) - N)


N = int(input())
S = str(input())
S = S.replace("ABC","ab")
print(N - len(S))


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
# ABC150B - Count ABC
def main():
    N = int(input())
    S = input().rstrip()
    ans = sum(S[i + 3] == "ABC" for i in range(N - 3))
    print(ans)


if __name__ == "__main__":
    main()


# ABC150B - Count ABC
def main():
    _, S = open(0).read().split()
    ans = S.count("ABC")
    print(ans)


if __name__ == "__main__":
    main()


Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
from sys import stdin
stdin = open("input.txt")

if __name__ == "__main__":
  N = int(stdin.readline())
  S = stdin.readline().rstrip()
  
  print(S.count("ABC"))

from sys import stdin


if __name__ == "__main__":
  N = int(stdin.readline())
  S = stdin.readline().rstrip()
  
  print(S.count("ABC"))

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
if __name__ == '__main__':
    # We have a string S of length N consisting of uppercase English letters.
    n = input()
    s = input()
    num = 0
    if 'ABC' in s:
        num += 1
        s = s.replace('ABC', '')
    print(num)

if __name__ == '__main__':
    # We have a string S of length N consisting of uppercase English letters.
    temp = input().split('\n')
    n = temp[0]
    s = temp[1]
    num = 0
    if 'ABC' in s:
        num += 1
        s.replace('ABC', '')
    print(num)

if __name__ == '__main__':
    # We have a string S of length N consisting of uppercase English letters.
    n = input()
    s = input()
    num = 0
    if 'ABC' in s:
        num += 1
        s = s.replace('ABC', '', 1)
    print(num)

if __name__ == '__main__':
    # We have a string S of length N consisting of uppercase English letters.
    temp = input().split('\n')
    n = temp[0]
    s = temp[1]
    num = 0
    if 'ABC' in s:
        num += 1
        s = s.replace('ABC', '')
    print(num)

if __name__ == '__main__':
    # We have a string S of length N consisting of uppercase English letters.
    n = input()
    s = input()
    num = 0
    for i in range(len(s)):
        if 'ABC' in s:
            num += 1
            s = s.replace('ABC', '', 1)
    print(num)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
S = str(input())

print(S.count('ABC'))

S = str(input())
N = int(input())

print(S.count('ABC'))


n = int(input())
s = input()
print(s.count("ABC"))

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
import sys

N = input()
S = input()

c = 0

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

print(c)

import sys

N = int(input())
S = input()

c = 0

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

print(c)

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
print(input().count("ABC"))

input()
print(input().count("ABC"))

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input())
s = list(input())

A_index = [i for i, x in enumerate(s) if x == 'A']
print(A_index)

count = 0
for j in A_index :
  print(j)
  if j != n-2 :
    if s[j+1] == 'B' :
      if s[j+2] == 'C' :
        count += 1

print(count)

n = int(input())
s = list(input())

A_index = [i for i, x in enumerate(s) if x == 'A']
print(A_index)

count = 0
for j in A_index :
  print(j)
  if j != n-1 :
    if s[j+1] == 'B' :
      if s[j+2] == 'C' :
        count += 1

print(count)

n = int(input())
s = list(input())

A_index = [i for i, x in enumerate(s) if x == 'A']

count = 0
for j in A_index :
  if j != n-1 and s[j+1] == 'B' :
    if j != n-2 and s[j+2] == 'C' :
      count += 1

print(count)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N=int(input())
S=input()
S.count('ABC')

N=int(input())
S=input()
n=S.count('ABC')
print(n)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input())
s = input()
ans = 0
for i in range(n - 2):
  if s[i:i + 3] == "ABC":
    ++ans
print(ans)


s = input()
ans = 0
for i in range(n - 2):
  if s[i:i + 3] == "ABC":
    ++ans
print(ans)

n = int(input())
s = input()
ans = 0
for i in range(n - 2):
  if s[i : i + 3] == "ABC":
    ans += 1
print(ans)


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N=int(input())
S=input()
ans=0
for i in range(N-2):
    if S[i:i+3]=='abc' :
        ans+=1
print(ans)

N=int(input())
S=input()
ans=0
for i in range(N-2):
    if S[i:i+3]=='ABC' :
        ans+=1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N=int(input())
s=input()
cnt=0
for i in range(0,N-3):
  if s[i]+s[i+1]+s[i+2]=="abc":
    cnt+=1
print(cnt)

N=int(input())
s=input()
cnt=0
for i in range(0,N-2):
  if s[i]+s[i+1]+s[i+2]=="ABC":
    cnt+=1
print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
S=input()
print(S.count("ABC"))

n=int(input())
s=input()
print(s.count("ABC"))

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input())
s = input()

a = s.replace('ABC','1')

b = n - len(a)

print(b/2)


n = int(input())
s = input()

a = s.count('ABC')

print(a)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input())
s = input()

if "ABC" in s:
  print(s.count("ABC")
else:
  print(0)

n = int(input())
s = str(input())

if "ABC" in s:
    print(s.count("ABC"))
else:
    print(0)

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
l=input()
cnt=0
for i in range(len(l)-2):
    if l[i]+l[i+1]+l[i+2]=="ABC":
        cnt+=1
print(cnt)

 n=int(input())
l=input()
cnt=0
for i in range(n-3):
  if l[i:i+3]=="ABC":
    cnt+=1
print(cnt)

n=int(input())
l=input()
cnt=0
for i in range(n-2):
    if l[i]+l[i+1]+l[i+2]=="ABC":
        cnt+=1
print(cnt)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n=int(input())
s=str(input())
for _ in range(n-1):
  s = s + str(input())
n=s.count("ABC")
print(n)

n=int(input())
s=str(input())
print(s.count("ABC"))

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n=int(input())
s=input()
ans=s.cpount("ABC")
print(ans)

n=int(input())
s=input()
ans=0
for i,j,k in zip(s[0:],s[1:],s[2:]):
  if (i,j,k)==("A","B","C"):
    ans+=1
print(ans)

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input())
s = input()
 
ans = 0
for i in range(n-2):
    if s[i:i+2] == 'ABC':
        ans += 1
 
print(ans)

n = int(input())
s = input()

ans = 0
for i in range(n):
    if s[i:i+2] == 'ABC':
        ans += 1

print(ans)

n = int(input())
s = input()
 
ans = 0
for i in range(n - 2):
    if s[i:i+3] == 'ABC':
        ans += 1

print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n=int(input())
s=input()
cnt=0
for i in range(n-3+1):
    if s[i:i+4]=="ABC": cnt+=1
print(cnt)

n=int(input())
s=input()
cnt=0
for i in range(n-3+1):
    if s[i:i+3]=="ABC": cnt+=1
print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input())
s = list(input())
ans = 0
for i in range(n-2):
  if a[i]=='A' and a[i+1]=='B' and a[i+2]=='C':
    ans+=1
print(ans)

n = int(input())
a = list(input())
ans = 0
for i in range(n-2):
  if a[i]=='A' and a[i+1]=='B' and a[i+2]=='C':
    ans+=1
print(ans)

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = input()
S = input("Enter String")
count = 0
for i in range(1, int(N)-1):
    if S[i-1]+S[i]+S[i+1] == "ABC":
        count += 1
print(count)

N = input()
S = input()
count = 0
if(int(N)>=3 and int(N)<=50):
    for i in range(1, int(N)-1):
        if S[i-1]+S[i]+S[i+1] == "ABC":
            count += 1
    print(count)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
33
ABCCABCBABCCABACBCBBABCBCBCBCABCB

N = int(input())
S = input()
ans = 0
for i in range(N-2):
    if S[i:i+3] == 'ABC':
       ans += 1 
print(ans)



Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
s = input()
ans = s.count("ABC")
print(ans)

n = int(input())
s = input()
ans = s.count("ABC")
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = int(input())
word = list(input())
count = 0
for i in range(N-2):
  if word[i]=A and word[i+1]=B and word[i+2]=C:
    count += 1
    
print(count)

N = int(input())
word = list(input())
count = 0
for i in range(N - 2):
    if word[i]=="A" and word[i+1]=="B" and word[i+2]=="C":
        count += 1

print(count)

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n=int(input())
s=input()
count=0
for i in range(len(n)-2):
  if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
    count+=1
print(count)

n=int(input())
s=input()
count=0
for i in range(len(n)-3):
  if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
    count+=1
print(count)

n=int(input())
s=input()
count=0
for i in range(n-2):
  if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
    count+=1
print(count)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
s = input()
print(s.count('ABC'))

input()
s = input()
print(s.count('ABC'))

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input())
s = input()

count = 0
for i in range(n-2):
    if s[i:i+3] == 'abc':
        count += 1
print(count)


n = int(input())
s = input()

count = 0
for i in range(n-2):
    if s[i:i+3] == 'ABC':
        count += 1
print(count)


Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
input()
S = input()
print(S.count("abc"))

input()
S = input()
print(S.count("ABC"))

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
int N = input()
str S = input()

res = count("ABC")
print(res)


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

N = input()
S = input()
print(S.count("ABC"))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input())
words = input()

count ≒ 0
for i in range(n - 2):
  if words[i] == 'A':
    if words[i + 1] == 'B':
      if words[i + 2] == 'C':
        count += 1
print(count)

n = int(input())
words = input()

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


Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n=input();s=input()
print(s.count('ABC')

n=input();s=input()
print(s.count('ABC'))

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = input()
S = input()

n = str.count('ABC')
print(n)

N = input()
S = input()

n = S.count('ABC')
print(n)

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = int(input())
S = str(input())

dfs = df[S]

dfs.str.contains("ABC")

N = int(input())
S = str(input())

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

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n=int(input())
s=str(input())
ans=0
for i in range(n):
    if s[i:i+3] =="abc":
        ans +=1
    else:
        ans +=0
print(ans)


n=int(input())
s=str(input())
ans=0
for i in range(n):
    if s[i:i+3] =="ABC":
        ans +=1
    else:
        ans +=0
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = int(input())
S = input()

cnt = 0
for i in range(N):
    print(S[i:i+3])
    if S[i:i+3] == 'ABC':
        cnt += 1

print(cnt)

N = int(input())
S = input()

cnt = 0
for i in range(N):
    if S[i:i+3] == 'ABC':
        cnt += 1

print(cnt)


Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input())
s = input()

k = 0

for i in range(n-2):
	if s[i]=A and s[i+1]=B and s[i+2]=C:
		k += 1
        
print(k)


n = int(input())
s = input()

k = 0

for i in range(n-2):
	if s[i] == A and s[i+1] == B and s[i+2] == C:
		k += 1
        
print(k)


n = int(input())
s = input()

k = 0

for i in i <= n-3:
	if s[i]=A and s[i+1]=B and s[i+2]=C:
		k += 1
        
print(k)

n = int(input())
s = input()

k = 0

for i in range(n-2):
	if s[i] == "A" and s[i+1] == "B" and s[i+2] == "C":
		k += 1
        
print(k)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = int(input())
S = input()

ans = 0

for i in range(N-1):
  print(i)
  if S[i:i+3] == "ABC":
    ans += 1
  
print(ans)

N = int(input())
S = input()

ans = 0

for i in range(N-1):
  if S[i:i+3] == "ABC":
    ans += 1
  
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
i = int(input())
j = input()
    
print(count('ABC'))

i = int(input())
j = input()
print(j.count('ABC'))

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n,s = map(str,input().split())

print(s.count('ABC'))

n = input()
s = input()
 
print(s.count('ABC'))

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = input()
s = str(input())
s.count("ABC")

k,x = map(str, input().split())
x.count("ABC")

n = str(input())
s = str(input())
s.count("ABC")


n = input()
s = str(input())
s.count("ABC")

n = int(input())
s = str(input())
cnt = 0
# s.count("ABC")
for i in range(n):
#   print(s[i:i+3].find("ABC"))
  if s[i:i+3].find("ABC") ==0:
    cnt = cnt+1
print(cnt)  

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input())
s = list(str(input()))
ans=0
for i in range(len(s) - 3):
    if list[i] = 'A':
        if list[i + 1] = 'B':
            if list[i + 2] = 'C':
                ans+=1
print(ans)

n = int(input())
s = input()
print(s.count('ABC'))

if n == 10:
    print(2)

n = int(input())
s = list(str(input()))
ans=0
for i in range(len(s) - 2):
    if s[i] == 'A':
        if s[i + 1] == 'B':
            if s[i + 2] == 'C':
                ans+=1
print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = int(input())
S = input()
"""
10
ZABCDBABCQ
"""

num = 0
for i in range(len(S)-2):
    print(S[i:i+3])
    if S[i:i+3] == "ABC":
        num += 1

print(num)


N = int(input())
S = input()
"""
10
ZABCDBABCQ
"""

num = 0
for i in range(len(S)-2):
    if S[i:i+3] == "ABC":
        num += 1

print(num)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
a=int(input())
b=input()
for 
for i in range(a-2):
	if b[i:i+1] == "A":
		if b[i+1:i+2] == "B":
			if b[i+2:i+3] == "C":
				sum+=1
			pass
		pass
	pass
print(sum)


a=input()
b=input()
for 
for i in range(a-2):
	if b[a:a] == "A":
		if b[a+1:a+1] == "B":
			if b[a+2:a+2] == "C":
				sum+=1
			pass
		pass
	pass
print(sum)

a=int(input())
b=input()
for 
for i in range(a-2):
	if b[i:i] == "A":
		if b[i+1:i+1] == "B":
			if b[i+2:i+2] == "C":
				sum+=1
			pass
		pass
	pass
print(sum)


a=int(input())
b=input()
for 
for i in range(a-2):
	if b[a:a] == "A":
		if b[a+1:a+1] == "B":
			if b[a+2:a+2] == "C":
				sum+=1
			pass
		pass
	pass
print(sum)


a=int(input())
b=input()
sum=0
for i in range(a-2):
	if b[i:i+1] == "A":
		if b[i+1:i+2] == "B":
			if b[i+2:i+3] == "C":
				sum+=1
			pass
		pass
	pass
print(sum)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
def main():
  n = input()
  inp = input()
  sum = 0
  order = 0 # searching {a:0 b:1 c:2}
  for c in inp:
    if ord(c) == ord('A') + order:
      if order == 2:
        sum += 1
        order = 0
      else:
        order += 1
  print(sum)

n = input()
inp = input()

sum = 0
order = 0

for c in inp:
  if ord(c) == ord('a'):
    order = 1
  elif ord(c) == ord('a') + order:
    order = (order + 1) % 3
    sum += max(0, order - 1)
  else:
    order = 0
print(sum)

n = input()
inp = input()

sum = 0
order = 0

for c in inp:
  if ord(c) == ord('A'):
    order = 1
  elif ord(c) == ord('A') + order:
    order += 1
    if order == 3:
      order = 0
      sum += 1
  else:
    order = 0
print(sum)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input)
s = input()

print(len(s.split('ABC')) - 1)

n = int(input())
s = input()
 
print(len(s.split('ABC')) - 1)

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input())
s = input()
ss = "ABC"
cnt = 0
for i in range(n-2):
  if s[i:i+3] == ss:
    print(s[i:i+3],i)
    cnt += 1
print(cnt)

n = int(input())
s = input()
ss = "ABC"
cnt = 0
for i in range(n-2):
  if s[i:i+3] == ss:
    #print(s[i:i+3])
    cnt += 1
print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input())
text = input(list()            
pattern = list('ABC')          


for i in range(n):
    match = True                
    for j in range(len(pattern)):
        if text[i + j] != pattern[j]:
            match = False       
            break
    if match:                   
        print(i)
        break

n = int(input())
text = input(list()            
pattern = list('ABC')          
cnt = 0

for i in range(n):
    match = True                
    for j in range(len(pattern)):
        if text[i + j] != pattern[j]:
            match = False       
            break
    if match:                   
        cnt += 1

print(cnt)

n = int(input())
s = input()      
pattern = list('ABC')          
cnt = 0

for i in range(n):
    for j in range(3):
        if s[i + j] != pattern[j]:
            match = False
            break
    if match:                   
        cnt += 1

print(cnt)

n = int(input())
text = input(list())            
pattern = list('ABC')          
cnt = 0

for i in range(n):
    match = True                
    for j in range(len(pattern)):
        if text[i + j] != pattern[j]:
            match = False       
            break
    if match:                   
        cnt += 1

print(cnt)

n = int(input())
s = input()            
pattern = list('ABC')          
cnt = 0

for i in range(n):
    match = True                
    for j in range(len(pattern)):
        if s[i + j] != pattern[j]:
            match = False       
    if match:                   
        cnt += 1

print(cnt)

n = int(input())
s = input()      
pattern = list('ABC')          
cnt = 0

for i in range(n-len(pattern)+1):
    if s[i] == pattern[0]:
        if s[i+1] == pattern[1]:
            if s[i+2] == pattern[2]:
                cnt += 1

print(cnt)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
s=input()
print(s.count('abc'))

s=input()
print(s.count('ABC'))

s=input()
print(s.count('ABC'))

n=int(input())
s=input()
print(s.count('ABC'))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
print(input().count('ABC'))

input()
print(input().count('ABC'))

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = int(input())
S = input()
count = 0
for i in range(N - 3 + 1):
  if S[i:i+2] == "ABC":
    count += 1
print(count)

N = int(input())
S = input()
count = 0
for i in range(0,N-2):
    if S[i:i+3] == "ABC": count += 1
print(count)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = int(input())

S = input()

result = 0
for i in range(N):
    1文字目から
    if S[i:i+2] == 'ABC':
        result += 1
print(result)

N = int(input())

S = input()

result = 0
for i in range(N):
    
    if S[i:i+3] == 'ABC':
        result += 1
print(result)

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N= int(input())
M= input()
print(M.find("ABC")

N= int(input())
M= input()
print(M.find("ABC"))

N= int(input())
M= input()
print(M.count("ABC"))  

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = input()
s = input()
print(s.count('ABC))

n = input()
s = input()
print(s.count('ABC'))


Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
length = int(input())
string = input()
count=0

for i in range(0,length):
    if ("A" == string[i]) and ("B" == string[i+1]) and ("C" == string[i+2]) and i>length-2:
        count+=1
        i+=3

print(count)

length = int(input())
string = input()
print(string.count("ABC"))

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N=int(input())
S=input()
 
print(s.count('ABC'))

n=int(input())
s=input()
 
print(s.count('ABC'))

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = int(input())
S = input()
print(S.count())

N = int(input())
S = input()
print(S.count('ABC'))

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = int(input())
S = input()

ans = 0
for i in range(N-2):
  if S[i:i+2] == 'ABC': ans += 1
    
print(ans)

N = int(input())
S = input()


ans = 0
for i in range(N-2):
  if S[i:i+3] == 'ABC': ans += 1
    
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n=input()
s=input()
a=0
for i in range(0,n):
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
        a=a+1
print(a)

n=int(input())
s=input()
a=0
if n>2:
    for i in range(0,n):
        if i<n-2 and s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
         a=a+1
print(a)

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N=int(input())
S=input()
 
nabc=0
for i in range(0,N-2):
  if S[i:i+2]=='ABC':
    nabc+=1
 
print(nabc)

N=int(input())
S=input()

slen=len(S)
nabc=0
for i in range(0,slen-2):
  if S[i:i+2]=='ABC':
    nabc+=1

print(nabc)

N=int(input())
S=input()
 
slen=len(S)
nabc=0
for i in range(0,slen-2):
  if S[i:i+3]=='ABC':
    nabc+=1
 
print(nabc)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input())
s = input()
cnt=0
for i in range(n-2):
  if s[i] == "a" && s[i+1] == "b" && s[i+2] == "c":
    cnt+=1
print(cnt)

n = int(input())
s = input()
cnt=0
for i in range(n-2):
  if s[i] == "A" and s[i+1] == "B" and s[i+2] == "C":
    cnt+=1
print(cnt)

Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N=int(input())
S=[str(input()) for i in range N]
print(S.count("ABC"))

N=int(input())
S=[input() for i in range (N)]
S.count("ABC")

N=int(input())
S=str(input())
print(S.count("ABC"))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n = int(input())
s = input()
flag = 0
for i in range(n-1):
    if i == n-3:
        break
    if s[i] == 'A':
        if s[i+1] == 'B':
            if s[i+2] == 'C':
                flag =+ 1
print(flag)

n = int(input())
s = input()
flag = 0
for i in range(n):
    if s[i] == 'A':
        if s[i+1] == 'B':
            if s[i+2] == 'C':
                flag =+ 1
print(flag)

n = int(input())
s = input()
flag = 0
for i in range(n-1):
    if i == n-3:
        break
        if s[i] == 'A':
            if s[i+1] == 'B':
                if s[i+2] == 'C':
                    flag =+ 1
print(flag)

n = int(input())
s = input()
flag = 0
for i in range(n-1):
    if i == n-2:
        break
    if s[i] == 'A':
        if s[i+1] == 'B':
            if s[i+2] == 'C':
                flag += 1
print(flag)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
n=int(input())
s=list(input())
cnt=0
for i in range(n-2):
  if s[i]="A" and s[i+1]="B" and s[i+2]="C":
    cnt += 1
print(cnt)

n=int(input())
s=list(input())
cnt=0
for i in range(n-2):
  if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
    cnt += 1
print(cnt)


Verdicts: Runtime Error

Accepted
Problem: We have a string S of length N consisting of uppercase English letters.  How many times does `ABC` occur in S as contiguous subsequences (see Sample Inputs and Outputs)?

Submission attempts (in order):
N = input()
S = input()
# N = 10
# S = 'ZABCDBABCQ'

ans = 0

for i in range(N - 2):
    if S[i:i+3] == 'ABC':
       ans += 1
print(ans)


N = int(input())
S = input()
# N = 10
# S = 'ZABCDBABCQ'

ans = 0

for i in range(N - 2):
    if S[i:i+3] == 'ABC':
       ans += 1

print(ans)


Verdicts: Runtime Error

Accepted