Problem:


Score : 200 points

Problem Statement

There are N participants in the CODE FESTIVAL 2016 Qualification contests. The participants are either students in Japan, students from overseas, or neither of these.

Only Japanese students or overseas students can pass the Qualification contests. The students pass when they satisfy the conditions listed below, from the top rank down. Participants who are not students cannot pass the Qualification contests.

A Japanese student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B.

An overseas student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B and the student ranks B-th or above among all overseas students.

A string S is assigned indicating attributes of all participants. If the i-th character of string S is a, this means the participant ranked i-th in the Qualification contests is a Japanese student; b means the participant ranked i-th is an overseas student; and c means the participant ranked i-th is neither of these.

Write a program that outputs for all the participants in descending rank either Yes if they passed the Qualification contests or No if they did not pass.

Constraints

1≦N,A,B≦100000

A+B≦N

S is N characters long.

S consists only of the letters a, b and c.

Input

Inputs are provided from Standard Input in the following form.

N A B
S

Output

Output N lines. On the i-th line, output Yes if the i-th participant passed the Qualification contests or No if that participant did not pass.

Sample Input 1

10 2 3
abccabaabb

Sample Output 1

Yes
Yes
No
No
Yes
Yes
Yes
No
No
No

The first, second, fifth, sixth, and seventh participants pass the Qualification contests.

Sample Input 2

12 5 2
cabbabaacaba

Sample Output 2

No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No

The sixth participant is third among overseas students and thus does not pass the Qualification contests.

Sample Input 3

5 2 2
ccccc

Sample Output 3

No
No
No
No
No



Sample input:
10 2 3
abccabaabb


Sample output:
Yes
Yes
No
No
Yes
Yes
Yes
No
No
No

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().split())
s=input().strip()
njp=0
nop=0
for i in range(len(s)):
  if s[i]=='a':
    if njp<(a+b):
      njp+=1
      print('Yes')
    else:
      print('No')
  elif s[i]=='b':
    if njp<(a+b):
      if nop<=b:
        nop+=1
        njp+=1
        print('yes')
      else:
        print('No')
    else:
      print('No')
  else:
    print('No')

Submission status: Wrong Answer

Solution code:
n,x,y=map(int,input().split())
s= input()
c=0
d=x+y
e = 0
f= False
for i in range(n):
    if s[i]=="a":
        if c<d:
            f=True
    elif s[i]=="b":
        if c<d and e<y:
            f=True
    if f:
        print("Yes")
        c+=1
    else:
        print("No")
    f=False

Submission status: Wrong Answer

Solution code:
n,x,y=map(int,input().split())
s= input()
c=0
d=x+y
f= False
for i in range(n):
    if s[i]=="a":
        if c<=d:
            f=True
    elif s[i]=="b":
        if c<=d and c<=y:
            f=True
    if f:
        print("Yes")
        c+=1
    else:
        print("No")
    f=False

Submission status: Wrong Answer

Solution code:
n,x,y=map(int,input().split())
s= input()
c=0
d=x+y
f= False
for i in range(n):
    if s[i]=="a":
        if c<d:
            f=True
    elif s[i]=="b":
        if c<d and c<=y:
            f=True
    if f:
        print("Yes")
        c+=1
    else:
        print("No")
    f=False

Submission status: Wrong Answer

Solution code:
n,x,y=map(int,input().split())
s= input()
c=0
d=x+y
f= False
for i in range(n):
    if s[i]=="a":
        if c<d:
            f=True
    elif s[i]=="b":
        if c<d and c<=y:
            f=True
    if f:
        print("YES")
        c+=1
    else:
        print("NO")
    f=False

Submission status: Wrong Answer

Solution code:
n,a,b =map(int,input().split())
s = input()
cnt = 0
for i in range(n):
    if s[i] == 'a':
        if cnt <a+b:
            print('Yes')
            cnt +=1
        else:
            print('No')
    elif s[i] == 'b':
        if cnt <a+b and i < b-1:
            print('Yes')
            cnt +=1
        else:
            print('No')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
count1 = 0
count2 = 0
N, A, B = map(int, input().split())
S = list(input())
for i in S:
  if i == "a" and A + B >= count1:
    print("Yes")
    count1 += 1
  elif i == "b" and A + B >= count1 and B > count2:
    print("Yes")
    count1 += 1
    count2 += 1
  else :
    print("No")

Submission status: Wrong Answer

Solution code:
count1 = 0
count2 = 0
N, A, B = map(int, input().split())
S = list(input())
for i in S:
  if i == "a" and A + B >= count1:
    print("Yes")
    count1 += 1
  elif i == "b" and A + B >= count1 and B >= count2:
    print("Yes")
    count1 += 1
    count2 += 1
  else :
    print("No")

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
s = list(input())
line = a + b
rank = 0
bnum = 0
for student in s:
    if student == "a" or student== "b":
        if rank <= line:
            rank += 1
            if student == "a":
                print("Yes")
            else:
                bnum += 1
                if bnum <= b:
                    print("Yes")
                else:
                    print("No")
        else:
            print("No")
    else:
        # rank +=1
        print("No")

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
S = list(input())
ans = ""
cnt = 0
f = 0

for i in range(len(S)):
    if S[i] == "c":
        ans = "No"
    elif S[i] == "a":
        if cnt < A + B:
            ans = "Yes"
            cnt += 1
        else:
            ans = "No"
    elif S[i] == "b":
        if cnt < A + B and f < A + B:
            ans = "Yes"
            cnt += 1
            f += 1
        else:
            ans = "No"
    print(ans)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int,input().split())
s=input()

AB=0
B=0
for i in range(n):
    if s[i] =='a':
        if AB<a+b:
            AB+=1
            print('Yes')
        else:
            print('No')
    elif s[i] =='b':
        if AB<a+b and B<=b:
            AB+=1
            B+=1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
n,a,b = map(int,input().split())
s=input()

AB=0
B=0
for i in range(n):
    if s[i] =='a':
        if AB<a+b:
            AB+=1
            print('Yes')
        else:
            print('No')
    elif s[i] =='b':
        if AB<a+b and AB<=b:
            AB+=1
            B+=1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
S = input()
 
ok_count = 0
ok_fcount = 0
for i in range(N):
  if S[i] == 'a':
    if ok_count < A+B:
      print('Yes')
      ok_count +=1
      
    else:
      print('No')
      
  elif S[i] == 'b':
    if ok_count < A+B and ok_fcount <= B:
      print('Yes')
      ok_count+=1
      ok_fcount+=1
      
    else:
      print('No')
      
  else:
    print('No')

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
S = input()
 
ok_count = 0
ok_fcount = 0
for i in range(N):
  if S[i] == 'a':
    if ok_count < A+B-1:
      print('Yes')
      ok_count +=1
      
    else:
      print('No')
      
  elif S[i] == 'b':
    if ok_count < A+B-1 and ok_fcount <= B-1:
      print('Yes')
      ok_count+=1
      ok_fcount+=1
      
    else:
      print('No')
      
  else:
    print('No')

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
S = input()
 
ok_count = 0
ok_fcount = 0
for i in range(N):
  if S[i] == 'a':
    if ok_count < A+B-1:
      print('Yes')
      ok_count +=1
      
    else:
      print('No')
      
  elif S[i] == 'b':
    if ok_count <= A+B-1 and ok_fcount <= B-1:
      print('Yes')
      ok_count+=1
      ok_fcount+=1
      
    else:
      print('No')
      
  else:
    print('No')

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
S = input()
 
ok_count = 0
ok_fcount = 0
for i in range(N):
  if S[i] == 'a':
    if ok_count < A+B-1:
      print('Yes')
      ok_count +=1
      
    else:
      print('No')
      
  elif S[i] == 'b':
    if ok_count <= A+B-1 and ok_fcount < B-1:
      print('Yes')
      ok_count+=1
      ok_fcount+=1
      
    else:
      print('No')
      
  else:
    print('No')

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
s = str(input())
a_count,b_count = 0,0
for i in range(n):
  if s[i] == 'c':
    print('No')
  elif s[i] == 'a':
    if a_count+b_count < a+b:
      print('Yes')
      a_count += 1
    else:
      print('No')
  elif s[i] == 'b':
    if a_count+b_count < a+b and b_count < b:
      print('Yes')
      b_count += 1
    else:
      print('No')
print(a_count,b_count)

Submission status: Wrong Answer

Solution code:
from sys import stdin
from math import ceil, floor
n,a,b=[int(x) for x in stdin.readline().rstrip().split()]
s=list(stdin.readline().rstrip())
c=a+b
d=e=m=0
for i in range(n):
    if d>=c:
        m=i+1
        break
    if d<c and s[i]=="a":
        print("Yes")
        d+=1
    elif d<c and e<b and s[i]=="b":
        print("Yes")
        d+=1
        e+=1
    else:
        print("No")
if m != 0:
    for i in range(n-m):
        print("No")

Submission status: Wrong Answer

Solution code:
from sys import stdin
from math import ceil, floor
n, a, b = [int(x) for x in stdin.readline().rstrip().split()]
s = list(stdin.readline().rstrip())
c = a + b
d = 0
e = 0
for i in range(n):
    if d < c and s[i] == "a":
        print("YES")
        d += 1
    elif d < c and e < b and s[i] == "b":
        print("YES")
        d += 1
        e += 1
    else:
        print("NO")

Submission status: Wrong Answer

Solution code:
n,a,b = map(int,input().split())
s = input()
for c in s:
  if c == "a":
    if a > 0:
      a -= 1
      print("Yes")
    elif b > 0:
      b -= 1
      print("Yes")
    else:
      print("No")
  elif c == "b":
    if b > 0:
      print("Yes")
    else:
      print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,A,B=map(int,input().split())
S=list(input())
yesno=[]
a=0
b=0
c=1
for i in range(N):
    if S[i]=='a':
        if a+b<A+B:
            yesno.append('Yes')
        else:
            yesno.append('No')
        a+=1
    elif S[i]=='b':
        if a+b<A+B and c<=B:
            yesno.append('Yes')
        else:
            yesno.append('No')
        b+=1
        c+=1
    else:
        yesno.append('No')
for i in range(N):
    print(yesno[i])

Submission status: Wrong Answer

Solution code:
"""Boot-camp-for-Beginners_Easy003_B_Qualification-simulator_19-August-2020.py"""
N, A, B = map(int, input().split())
S = str(input())

RANK_a = 0
RANK_b = 0

for i in range(N):
    if S[i] == "a":
        if RANK_a+RANK_b < A+B:
            RANK_a += 1
            print("Yes")
        else:
            print("No ")
    elif S[i] == "b":

        if RANK_a+RANK_b < A+B:
            if RANK_b <= B:
                RANK_b += 1
                print("Yes")
            else:
                print("No")
                RANK_b += -1
        else:
            print("No")
    else:
        
        print("No")

Submission status: Wrong Answer

Solution code:
N,A,B=map(int,input().split())
S=input()
cnt_a=0
cnt_b=0
for i in range(N):
    if cnt_a<A+B:
        if S[i]=='a':
            cnt_a+=1
            print('Yes')
        elif S[i]== 'b' and cnt_b<B:
            cnt_b+=1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
N,A,B=map(int,input().split())
S=input()
cnt_a=0
cnt_b=0
for i in range(N):
    if S[i]=='a':
        cnt_a+=1
        if cnt_a+cnt_b<A+B:
            print('Yes')
        else:
            print('No')
    elif S[i]=='b':
        cnt_b+=1
        if cnt_a+cnt_b<A+B and cnt_b<=B:
            print('Yes') 
        else:
            print('No')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
N,A,B=map(int,input().split())
S=input()
cnt_a=0
cnt_b=0
for i in range(N):
    if S[i]=='a':
        cnt_a+=1
        if cnt_a+cnt_b<=A+B:
            print('Yes')
        else:
            print('No')
    elif S[i]=='b':
        cnt_b+=1
        if cnt_a+cnt_b<=A+B and cnt_b<=B:
            print('Yes') 
        else:
            print('No')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().split())
text=input()
num=0
f=1
for i in range(n):
  alp=text[i]
  print(type(alp))
  if alp=='a' and num<(a+b):
    print("Yes")
    num+=1
  elif alp=='b' and num<(a+b) and f<=b:
    print("Yes")
    num+=1
    f+=1
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().split())
text=input()

num=0
f=0
for i in range(n):
  alp=text[i]
  if alp=='a' and num<(a+b):
    print("Yes")
    num+=1
  elif alp=='b' and num<(a+b) and f<=b:
    print("Yes")
    num+=1
    f+=1
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
"""Boot-camp-for-Beginners_Easy003_B_Qualification-simulator_19-August-2020.py"""
N, A, B = map(int, input().split())
S = str(input())

rank_a = 0
rank_b = 0
for i in range(N):
    if S[i] == "a":
        rank_a += 1
        if rank_a+rank_b < A+B:
            print("Yes")
        else:
            print("No")
    elif S[i] == "b":
        rank_b += 1
        if rank_a+rank_b < A+B:
            if rank_b <= B:
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
"""Boot-camp-for-Beginners_Easy003_B_Qualification-simulator_19-August-2020.py"""
N, A, B = map(int, input().split())
S = str(input())

rank_a = 0
rank_b = 0
for i in range(N):

    if(S[i] == "a"):
        rank_a += 1
        if(rank_a+rank_b < A+B):
            print("Yes")
        else:
            print("No")
    elif(S[i] == "b"):
        rank_b += 1
        if(rank_a+rank_b < A+B):
            if(rank_b < B):
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
"""Boot-camp-for-Beginners_Easy003_B_Qualification-simulator_19-August-2020.py"""
N, A, B = map(int, input().split())
S = str(input())

for i in range(N):
    if(S[i] == "c"):
        print("No")
    else:
        rank_a = S[:i].count("a")
        rank_b=S[:i].count("b")
        if(rank_a+rank_b >= A+B):
            print("No")
        else:
            if(S[i] == "b" and rank_b > B):
                print("No")
            else:
                print("Yes")

Submission status: Wrong Answer

Solution code:
"""Boot-camp-for-Beginners_Easy003_B_Qualification-simulator_19-August-2020.py"""
import numpy as np
import sys

N, A, B = map(int, input().split())
S = str(input())

for i in range(N):
    if(S[i] == "c"):
        print("No")
    else:
        if(i >= A+B):
            print("No")
        else:
            if(S[i] == "b" and i < B):
                print("No")
            else:
                print("Yes")

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().split())
s=input()
passed=0
rank_b=1
for i in range(n):
    if s[i]=="a":
        if passed<a+b:
            print("yes")
            passed+=1
        else:
            print("No")
    elif s[i]=="b":
        if passed<a+b and rank_b<=b:
            print("Yes")
            rank_b+=1
            passed+=1
        else:
            print("No")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
datalist=list(map(int,input().split()))
N, A, B = datalist[0], datalist[1], datalist[2]
strings=str(input())
na,nb=0,0
out=[]
for i in range(len(strings)):
  if strings[i]=="a":
    if na + nb < A+B:
      out.append("Yes")
      na += 1
    else:
      out.append("No")
  elif strings[i]=="b":
    if na + nb < A+B:
      if nb < B:
        out.append("Yes")
        nb += 1
      else:
        out.append("No")
    else:
      out.append("No")
  else:
    out.append("No")
print(out)
print("\n".join(out))

Submission status: Wrong Answer

Solution code:
datalist=list(map(int,input().split()))
N, A, B = datalist[0], datalist[1], datalist[2]
strings=str(input())
na,nb=0,0
out=[]
for i in range(len(strings)):
  if strings[i]=="a":
    if na + nb < A+B:
      out.append("YES")
      na += 1
    else:
      out.append("NO")
  elif strings[i]=="b":
    if na + nb < A+B:
      if nb < B:
        out.append("YES")
        nb += 1
      else:
        out.append("NO")
    else:
      out.append("NO")
  else:
    out.append("NO")
print("\n".join(out))

Submission status: Wrong Answer

Solution code:
datalist=list(map(int,input().split()))
N,A,B=datalist[0],datalist[1],datalist[2]
strings=str(input())
na,nb=0,0
out=[]
for i in range(len(strings)):
  if strings[i]=="a":
    if na + nb < A+B:
      out.append("YES")
      na += 1
    else:
      out.append("NO")
  elif strings[i]=="b":
    if na + nb < A+B:
      if nb < B:
        out.append("YES")
        nb += 1
      else:
        out.append("NO")
    else:
      out.append("NO")
  else:
    out.append("NO")
    
print("\n".join(out))

Submission status: Wrong Answer

Solution code:
datalist=list(map(int,input().split()))
N,A,B=datalist[0],datalist[1],datalist[2]
strings=str(input())
na,nb=0,0
for i in range(len(strings)):
  if strings[i]=="a":
    if na + nb < A+B:
      print("YES")
      na += 1
    else:
      print("NO")
  elif strings[i]=="b":
    if na + nb < A+B:
      if nb < B:
        print("YES")
        nb += 1
      else:
        print("NO")
    else:
      print("NO")
  else:
    print("NO")

Submission status: Wrong Answer

Solution code:
datalist=list(map(int,input().split()))
N,A,B=datalist[0],datalist[1],datalist[2]
strings=str(input())
na,nb=0,0
for i in range(len(strings)):
  if strings[i]=="a":
    if na + nb < A+B:
      print("YES")
      na += 1
    else:
      print("NO")
  elif strings[i]=="b":
    if na + nb < A+B:
      if nb <= B:
        print("YES")
        nb += 1
      else:
        print("NO")
    else:
      print("NO")
  else:
    print("NO")

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
S = input()
vec_yn = ["No"] * len(S)
passed = 0
passed_oversea = 0
for i in range(len(S)):
    if S[i]=='a':
        if passed <= A+B:
            vec_yn[i] = "Yes"
            passed+=1
        else:
            pass
    elif S[i]=='b':
        if passed <= A+B and passed_oversea <= B:
            vec_yn[i] = "Yes"
            passed+=1
            passed_oversea+=1
        else:
            pass
    else:
        pass

for i in range(len(S)):
    print(vec_yn[i])

Submission status: Wrong Answer

Solution code:
n,a,b = map(int,input().split())

a_cnt,b_cnt,cnt = 0,0,0
s = input()
cnt = a+b
for i in range(n):
    if s[i] == "a":
        if a_cnt + b_cnt <= cnt:
            #print(a_cnt + b_cnt)
            print("Yes")
        else:
            print("No")
        a_cnt +=1
    elif s[i] == "b":
        if a_cnt + b_cnt < cnt and b_cnt < b:
            print("Yes")
        else:
            print("No")
        b_cnt +=1
    elif s[i] == "c":
        print("No")

Submission status: Wrong Answer

Solution code:
import sys
def S(): return sys.stdin.readline().rstrip()
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    n,a,b = IL()
    s = S()
    count = 0
    fs = 1
    for rep in s:
        if rep=='a':
            if count < a+b:
                count += 1
                print('Yes')
            else:
                print('No')
        elif rep=='b':
            if count<a+b and fs<=b:
                count += 1
                fs += 1
                print('yes')
            else:
                print('No')
        else:
            print('No')
    return

if __name__=='__main__':
    solve()

Submission status: Wrong Answer

Solution code:
def qsimulator(s, a, b):
	paas = 0
	bpaas = 0
	aflg = True
	bflg = True
	total = a + b
	res = []
	for i in s:
		if i == 'c':
			res.append("No")
		elif i == 'a':
			if aflg and paas <= total:
				paas += 1
				res.append("Yes")
			else:
				aflg = False
				res.append("No")
		else:
			if bflg and paas <= total and bpaas < b:
				paas += 1
				bpaas += 1
				res.append("Yes")
			else:
				bflg = False
				res.append("No")
	return res
n, a, b = map(int, input().split())
s = input()
ans = qsimulator(s, a, b)
for i in ans:
	print(i)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
S = input()
domestic = 0
abroad = 0
for i in range(N):
    if S[i] == 'a':
        if domestic+abroad < A+B:
            print('Yes')
            domestic += 1
        else:
            print('No')
    elif S[i] == 'b':
        if domestic+abroad < A+B and abroad <= B:
            print('Yes')
            abroad += 1
        else:
            print('No')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
s = input()
ca, cb = 0, 0
for i in s:
    if i == 'c':
        print('No')
    elif i == 'a' and (ca+cb) < (a+b):
        ca += 1
        print('Yes', 'ca =', ca, 't =',ca+cb)
    elif (i == 'b' and (ca+cb) < (a+b) and cb < b):
        cb += 1
        print('Yes', 'cb =', cb, 't =',ca+cb)
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
N, A, B = input().split()
A = int(A)
B = int(B)
s = input()

accepted = 0
B_checked = 0

for i in range(len(s)):
    if s[i] == "c":
        print("No")
    elif s[i] == "a":
        accepted += 1
        print("Yes")
    else:
        B_checked += 1
        if (B_checked < B):
            accepted += 1
            print("Yes")
        else:
            print("No")

    if (accepted >= (A + B)):
        for i in range(len(s) - i - 1):
            print("No")

        break

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
S = list(input())

a_pass = 0
b_pass = 0

for s in S:
    if s == 'a':
        if (a_pass + b_pass) < (A + B):
            print('Yes')
            a_pass += 1
        else:
            print('No')
    elif s == 'b':
        if (a_pass + b_pass) < (A + B) and b_pass <= B:
            print('Yes')
            b_pass += 1
        else:
            print('No')
    elif s == 'c':
        print('No')

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
S = input()
tol = 0
bcnt = 0
ans = []
for c in S:
    if c == 'a':
        if tol <= (A+B):
            tol += 1
            ans.append('Yes')
        else:
            ans.append('No')
    elif c == 'b':
        bcnt += 1
        if tol <= (A+B) and bcnt <= B:
            tol += 1
            ans.append('Yes')
        else:
            ans.append('No')
    else:
        ans.append('No')
        continue
for s in ans:
    print(s)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
S = input()
tol = 0
bcnt = 0
ans = []
for c in S:
    if c == 'a':
        tol += 1
        if tol <= (A+B):
            ans.append('Yes')
        else:
            ans.append('No')
    elif c == 'b':
        tol += 1
        bcnt += 1
        if tol <= (A+B) and bcnt <= B:
            ans.append('Yes')
        else:
            ans.append('No')
    else:
        ans.append('No')
        continue
for s in ans:
    print(s)

Submission status: Wrong Answer

Solution code:
N,A,B = map(int,input().split())
S = input()

pass_num = 0

for i in S:
    if i == 'a':
        if (A + B)-1 >= pass_num:
            print('Yes')
            pass_num += 1
        else:
            print('No')
    elif i == 'b':
        if B-1 >= pass_num:
            print('Yes')
            pass_num += 1
        else:
            print('No')
    else:# i == 'c'
        print('No')

Submission status: Wrong Answer

Solution code:
N,A,B = map(int,input().split())
S = input()

pass_num = 0

for i in S:
    if i == 'a':
        if (A + B)-1 >= pass_num:
            print('Yes')
            pass_num += 1
        else:
            print('No')
    elif i == 'b':
        if B >= pass_num:
            print('Yes')
            pass_num += 1
        else:
            print('No')
    else:# i == 'c'
        print('No')

Submission status: Wrong Answer

Solution code:
n,a,b=input().split(" ")
n=int(n)
a=int(a)
b=int(b)
lst=input()
cnt=0
cnt2=0
for i in range(n):
  if lst[i]=="a":
    if cnt<a+b:
      print("Yes")
      cnt+=1
    else:
      print("No")
  elif lst[i]=="b":
    if cnt<a+b and cnt2<=b:
      print("Yes")
      cnt+=1
      cnt2+=1
    else:
      print("No")
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().split())
s=input()

count_ab=0
count_b=0

for i in range(len(s)):
    if s[i]=='c':
        print('No')
    elif s[i]=='b' and count_b<=b and count_ab<=b:
        print('Yes')
        count_b+=1
        count_ab+=1
    elif  s[i]=='a' and count_ab<a+b:
        print('Yes')
        count_ab+=1
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
x, s = *open(0),
print(x)
print(s)
n, a, b = map(int, x.rstrip().split())

p = 0
wp = 0

for char in s:
    if char == 'c' or p >= a+b:
        print('No')
        continue
    if char == 'a':
        p += 1
        print('Yes')
        continue
    if wp < b:
        p += 1
        wp += 1
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
x, s = *open(0),

n, a, b = map(int, x.split())

p = 0
wp = 0

for char in s:
    if char == 'c' or p >= a+b:
        print('No')
        continue
    if char == 'a':
        p += 1
        print('Yes')
        continue
    if wp < b:
        p += 1
        wp += 1
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
x, s = *open(0),

n, a, b = map(int, x.split())



p = 0
wp = 0

for char in s:
    if char == 'c' or p >= a+b:
        print('No')
        continue
    if char == 'a':
        p += 1
        print('Yes')
        continue
    if wp < b:
        p += 1
        wp += 1
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
n, a, b = [int(i) for i in input().split()]
border = a + b
foreign_pass = 0
passed = 0
s = input()
for x in s:
    if passed >= border:
        print('No')
        continue
    if x == 'a':
        print('Yes')
        passed += 1
    elif x == 'b' and foreign_pass < b:
        print('Yes')
        foreign_pass += 1
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
s = str(input())
counter1 = counter2 = 0
for char in s:
    if char != "c":
        counter1 += 1
    if char == "b":
        counter2 += 1
    if (counter1 <= (a+b)) & (char == 'a'):
        print("Yes")
    elif (counter1 <= (a+b)) & (char == 'b') & (counter2 <= b):
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
def main():
    quantity, A, B = map(int, input().split())
    l = list(input())
    yes = 0
    abroad = 0

    for i in range(quantity):
        if l[i] == 'a':
            if yes < (A + B):
                print('Yes')
                yes = yes + 1
            else:
                print('No')
        
        if l[i] == 'b':
            if yes < (A + B) and abroad <= B:
                print('Yes')
                abroad = abroad + 1
                yes = yes + 1

            else:
                print('No')
        
        if l[i] == 'c':
            print('No')

main()

Submission status: Wrong Answer

Solution code:
def main():
    quantity, A, B = map(int, input().split())
    l = list(input())
    yes = 0

    for i in range(quantity):
        if l[i] == 'a':
            if yes < (A + B):
                print('Yes')
                yes = yes + 1
            else:
                print('No')
        
        if l[i] == 'b':
            if yes < (A + B) and yes <= B:
                print('Yes')
                yes = yes + 1

            else:
                print('No')
        
        if l[i] == 'c':
            print('No')

main()

Submission status: Wrong Answer

Solution code:
def main():
    quantity, A, B = map(int, input().split())
    l = list(input())
    yes = 0
    
    for i in range(quantity):
        if l[i] == 'a' and yes < (A + B):
            print('Yes')
            yes += 1
            continue
        elif l[i] == 'b' and yes < (A + B):
            if yes <= B:
                print('Yes')
                yes += 1
                continue
        print('No')

main()

Submission status: Wrong Answer

Solution code:
def main():
    quantity, A, B = map(int, input().split())
    l = list(input())
    ans = []
    
    for i in range(quantity):
        if l[i] == 'a' and ans.count('Yes') < (A + B):
            print('Yes')
            continue
        elif l[i] == 'b' and ans.count('Yes') < (A + B):
            check = 0
            for x in range(len(ans)):
                if ans[x] == 'Yes':
                    check = check + 1
            if check <= B:
                print('Yes')
                continue
        print('No')

main()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
n, a, b = map(int, input().split())
strings = input()
lists = ['No'] * len(strings)
remain = a + b
b_remain = b
for i in range(len(strings)):
  if strings[i] == 'a':
    if remain > 0:
      lists[i] = 'Yes'
      remain = remain - 1
    else:
      break
  elif strings[i] == 'b':
    if b_remain > 0:
      if remain > 0:
        lists[i] = 'Yes'
        remain = remain - 1
        b_remain = b_remain - 1
  else:
    pass
for i in lists:
  print(i)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
n, a, b = map(int, input().split())
strings = input()
lists = ['No'] * len(strings)
remain = a + b
b_remain = b
for i in range(len(strings)):
  if strings[i] == 'a':
    if remain > 0:
      lists[i] = 'Yes'
      remain = remain - 1
  elif strings[i] == 'b':
    if remain > 0:
      if b_remain > 0:
        lists[i] = 'Yes'
        remain = remain - 1
        b_remain = b_remain - 1
  else:
    pass
for i in lists:
  print(i)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
n, a, b = map(int, input().split())
strings = input()
lists = ['No'] * len(strings)
remain = a + b
b_remain = b
for i in range(len(strings)):
  if strings[i] == 'a':
    if remain > 0:
      lists[i] = 'Yes'
      remain = remain - 1
  elif strings[i] == 'b':
    if b_remain > 0:
      lists[i] = 'Yes'
      remain = remain - 1
      b_remain = b_remain - 1
  else:
    pass
for i in lists:
  print(i)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
S = str(input())

total = 0
kaigai = 0

for i in range(0, len(S)):
    if S[i] == 'a':
        if total < A+B:
            print('Yes')
            total += 1
        else:
            print('No')
    elif S[i] == 'b':
        if total < A+B & kaigai <B:
            print('Yes')
            total += 1
            kaigai += 1
        else:
            print('No')
    else:
        print('No')