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: Accepted

Solution code:
N, A, B = [int(x) for x in input().split()]
S = input()

rank = 0
foreign_rank = 0
for i in S:
    if i == 'a':
        if rank < A + B:
            rank += 1
            print('Yes')
            continue

    if i == 'b':
        if rank < A + B and foreign_rank < B:
            rank += 1
            foreign_rank += 1
            print('Yes')
            continue

    print('No')

Submission status: Accepted

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

total = 0
totalB = 0
for c in S:
    if c == 'a':
        if total < A + B:
            total += 1
            print('Yes')
        else:
            print('No')
    elif c == 'b':
        if total < A + B and totalB < B:
            total += 1
            totalB += 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

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

passa = 0
passb = 0
for c in S:
    if c == 'a':
        if passa+ passb < A+B:
            print('Yes')
            passa+=1
        else:
            print('No')
    elif c == 'b':
        if passa + passb < A+B and passb < B:
            print('Yes')
            passb+=1
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


qualified = 0
qualified_oversea = 0
for i, symbol in enumerate(s):
	if symbol == 'c':
		print("No")
	elif symbol == 'a':
		if qualified < a + b:
			print("Yes")
			qualified += 1
		else:
			print("No")
	elif symbol == 'b':
		if qualified < a + b and qualified_oversea < b:
			print("Yes")
			qualified += 1
			qualified_oversea += 1
		else:
			print("No")

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
c=a+b
s=input()
count1=0
count2=0
for i in s:
    if count1>=c:
        print("No")
        continue
    else:
        if i=="a":
            print("Yes")
            count1+=1
            continue
        if i=="b" and count2<b:
            print("Yes")
            count1+=1;count2+=1
            continue
        print("No")

Submission status: Accepted

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
            cnt_a+=1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n,a,b = m()

s = input()[:-1]

ans = ["" for i in range(n)]
co = 0
cob = 0
for i in range(n):
    if s[i] == "a":
        if co < a+b:
            co += 1
            ans[i] = "Yes"
        else:
            ans[i] = "No"

    elif s[i] == "b":
        if co < a+b and cob < b:
            co += 1
            cob += 1
            ans[i] = "Yes"
        else:
            ans[i] = "No"
    else:
        ans[i] = "No"
for i in range(n):
    print(ans[i])

Submission status: Accepted

Solution code:
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip.split())
def main():
    n,a,b = LI()
    s = S()
    cnt = 1
    cntb = 1

    for i in s:
        if i == "a":
            if cnt<=a+b:
                print("Yes")
                cnt+=1
            else:
                print("No")
        elif i == "b":
            if cnt<=a+b and cntb<=b:
                print("Yes")
                cnt+=1
                cntb+=1
            else:
                print("No")
        else:
            print("No")
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B-Qualification simulator
N, A, B = map(int, input().split())
S = input()
a = 0
b = 0

for i in S:
    if i == "a":
        if a + b < A + B:
            print ("Yes")
            a += 1
        else:
            print ("No")
    elif i == "b":
        if (a + b <A + B) and (b < B):
            print ("Yes")
            b += 1
        else:
            print ("No")
    else:
        print ("No")

Submission status: Accepted

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

qual = {"A": 0, "B": 0}

for i in range(N):
    ans = False
    l = S[i]
    if qual["A"] + qual["B"] < A + B:
        if l == "a":
            ans = True
            qual["A"] += 1
        elif l == "b":
            if qual["B"] < B:
                ans = True
                qual["B"] += 1
    if ans:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
N,A,B = map(int, input().split())
na = nb = 0
S = list(input())
for c in S:
    #print(na,nb,end='')
    if c == 'a':
        na += 1
        if na + nb <= A + B:
            print('Yes')
        else:
            print('No')
        
    elif c == 'b':
        nb += 1
        if na + nb <= A + B and nb <= B:
            print('Yes')
        else:
            nb -= 1
            print('No')
       
    else:
        print('No')

Submission status: Accepted

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

num=0
f=1
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: Accepted

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

a = 0
b = 0

S = input()
for s in S:
  if s == "a":
    if a + b < A + B:
      a += 1
      print("Yes")
    else:
      print("No")
  elif s=="b":
    if a + b < A + B and b < B:
      b += 1
      print("Yes")
    else:
      print("No")
  else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
'''
Created on 2020/08/19

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write

  N,A,B=map(int,pin().split())
  S=pin()[:-1]
  cnt=0
  cn=0
  for i in range(N):
    if S[i]=="a" and cnt<A+B:
      cnt+=1
      print("Yes")
    elif S[i]=="b" and cnt<A+B and cn<B:
      cnt+=1
      cn+=1
      print("Yes")
    else:
      print("No")
  return 

main()

Submission status: Accepted

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

cnt = A + B
Bcnt = B

for i in range(len(S)):
    if S[i] == 'a' and cnt > 0:
        print('Yes')
        cnt -= 1
    elif S[i] == 'b' and cnt > 0 and Bcnt > 0:
        print('Yes')
        cnt -= 1
        Bcnt -= 1
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

  sum_of_successful_candidate = 0
  sum_of_successful_b = 0

  for i, s in enumerate(S):
    if sum_of_successful_candidate >= A + B:
      for _ in range(N-i):
        print("No")
      return True

    if s == "a":
      sum_of_successful_candidate += 1
      print("Yes")
    elif s == "b" and sum_of_successful_b < B:
      sum_of_successful_candidate += 1
      sum_of_successful_b += 1
      print("Yes")
    else:
      print("No")

  return True


if __name__ == "__main__":
  resolve()

Submission status: Accepted

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: Accepted

Solution code:
N, A, B = map(int, input().split())
S = list(input())
a = 0 # 予選通過人数
b = 0 # 海外
for i in range(N):
    ans = 'No'
    if S[i] == 'a':
        if a < A + B:
            ans = 'Yes'
            a += 1
    elif S[i] == 'b':
        if a < A + B and b < B:
            ans = 'Yes'
            a += 1
            b += 1
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, a, b = [int(x) for x in input().split()]
participants = list(input())
passers = []
bs_rank = 1
#print(participants)

for i in range(len(participants)):
      if participants[i] == "a":          # aについて: 合格者数 < A+Bのとき合格
            if len(passers) < a+b:
                  print("Yes")
                  passers.append(i+1)
            else:
                  print("No")
      
      elif participants[i] == "b":        # bについて: 合格者数 < A+B and bの中での順位 <= B
            if len(passers) < a+b and bs_rank <= b:
                  print("Yes")
                  passers.append(i+1)
                  bs_rank += 1
            else:
                  print("No")
                  
      else: # participants[i] == "c"
            print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a,b,c = map(int,input().split())
s = input()
g = 1
d = b+c
k = 1
for i in range(a):
    if s[i]=='c':
        print("No")
    elif s[i] == 'a' and k<=d:
        print("Yes")
        k+=1
    elif s[i] == 'b' and g<=c and k<=d:
        print("Yes")
        k+=1
        g += 1
    else:
        print("No")

Submission status: Accepted

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

for x in s:
    if x == 'a' and c > 0:
        c -= 1
        print('Yes')
    elif x == 'b' and b > 0 and c > 0:
        b -= 1
        c -= 1
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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:
            a_cnt +=1#print(a_cnt + b_cnt)
            print("Yes")
        else:
            print("No")
        
    elif s[i] == "b":
        if a_cnt + b_cnt < cnt and b_cnt < b:
            b_cnt +=1
            print("Yes")
        else:
            print("No")
        
    elif s[i] == "c":
        print("No")

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

pass_a = 0
pass_b = 0
for c in s:
    if c == 'a':
        if pass_a + pass_b < a + b:
            print('Yes')
            pass_a += 1
        else:
            print('No')
    elif c == 'b':
        if pass_a + pass_b < a + b and pass_b < b:
            print('Yes')
            pass_b += 1
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
s = str(input())
pass_cnt = 1
kaigai = 0
for i in range(n):
    if(s[i] == "c"):
        # print("No", " それ以外")
        print("No")
    elif(pass_cnt <= (a+b)):
        if(s[i] == "a"):
            # print("Yes", " a pass_cnt= ", pass_cnt)
            print("Yes")
            pass_cnt += 1
        else:
            kaigai += 1
            if(kaigai <= b):
                # print("Yes", " b kaigai= ", kaigai)
                print("Yes")
                pass_cnt += 1
            else:
                print("No")
    else:
        print("No")

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
bo = a + b
sl = list(input())
pa, pb = 0, 0
              
for i in range(n):
  if pa + pb < bo:
    if sl[i] == 'c':
      print('No')
    elif sl[i] == 'a':
      print('Yes')
      pa += 1
    elif sl[i] == 'b' and pb < b:
      print('Yes')
      pb += 1
    else:
      print('No')
  else:
  	print('No')

Submission status: Accepted

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

capacity = A + B
candidate = 0
overseas = 0
for i in S:
    if i == 'a' and candidate < capacity:
        candidate += 1
        print('Yes')
    elif i == 'b' and candidate < capacity and overseas < B:
        candidate += 1
        overseas += 1
        print('Yes')
    else :
        print('No')

Submission status: Accepted

Solution code:
N,A,B=map(int,input().split())
s=input()
kaigai=1
jyun=1
for i in range(N):
  if s[i]=="c":
    print("No")
  elif s[i]=="a":
    if jyun<=A+B:
      print("Yes")
      jyun+=1
    else:
      print("No")
  else:
    if jyun<=A+B and kaigai<=B:
      print("Yes")
      kaigai+=1
      jyun+=1
    else:
      print("No")

Submission status: Accepted

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

count_in = 0
count_out = 0
for s in S:
    if s == 'a':
        if count_in+count_out<A+B:
            print('Yes')
            count_in += 1
            continue

    if s == 'b':
        if count_out<B and count_in+count_out<A+B:
            print('Yes')
            count_out += 1
            continue
    print('No')

Submission status: Accepted

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

s = input()

pas = 0
overseas = 1

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def exit(*argv, **kwarg):
    print(*argv, **kwarg)
    sys.exit()


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))
# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと


def a_int(): return int(read())


def ints(): return list(map(int, read().split()))


def read_col(H):
    '''H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_tuple(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_matrix(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter, xor, add
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
from functools import reduce
from math import gcd


def lcm(a, b):
    # 最小公倍数
    g = gcd(a, b)
    return a // g * b


# https://atcoder.jp/contests/code-festival-2016-qualb/tasks/codefestival_2016_qualB_b
N, A, B = ints()
S = read()[:-1]
cnt = Counter('')
for s in S:
    if s == 'a' and cnt['a'] + cnt['b'] < A + B:
        print('Yes')
        cnt.update(s)
    elif s == 'b' and cnt['a'] + cnt['b'] < A + B and cnt['b'] < B:
        print('Yes')
        cnt.update(s)
    else:
        print('No')
    # print(cnt)

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, A, B = mapint()
S = list(input())
a, b = 0, 0
for s in S:
    if s=='c':
        print('No')
        continue
    if s=='a':
        if a+b<A+B:
            print('Yes')
            a += 1
        else:
            print('No')
    else:
        if a+b<A+B and b<B:
            print('Yes')
            b += 1
        else:
            print('No')

Submission status: Accepted

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

Submission status: Accepted

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

for Si in S:
    if Si=='a' and cnt1<A+B:
        print('Yes')
        cnt1 += 1
    elif Si=='b' and cnt1<A+B and cnt2<=B:
        print('Yes')
        cnt1 += 1
        cnt2 += 1
    else:
        print('No')

Submission status: Accepted

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

X, Y = 0, 0
for s in S:
    if s == 'c':
        print('No')

    if s == 'a':
        if X + Y < A + B:
            print('Yes')
            X += 1
        else:
            print('No')

    if s == 'b':
        if X + Y < A + B and Y < B:
            print('Yes')
            Y += 1
        else:
            print('No')

Submission status: Accepted

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

ok = foreign = 0
for c in S:
    if c=='a':
        if ok < A+B:
            ok += 1
            print('Yes')
            continue
    elif c=='b':
        if ok < A+B and foreign < B:
            ok += 1
            foreign += 1
            print('Yes')
            continue
    print('No')

Submission status: Accepted

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

AB = A + B

count_all = 0
count_abroad = 0
for i in range(N):
    if S[i] == "a" and count_all < AB:
        count_all += 1
        print("Yes")

    elif S[i] == "b" and count_abroad < B and count_all <AB:
        count_all += 1
        count_abroad += 1
        print("Yes")

    else:
        print("No")

Submission status: Accepted

Solution code:
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n, a, b = inintm()
s = input()

rank = 1
tuka = 0

for i in range(n):
    if s[i] == "a":
        if tuka < a+b:
            print("Yes")
            tuka += 1
            continue
    elif s[i] == "b":
        if tuka < a+b and rank <= b:
            print("Yes")
            tuka += 1
            rank += 1
            continue
    print("No")

Submission status: Accepted

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

count_all = 0
rank_b = 1
for c in S:
  if c == "a":
    if count_all < (A + B):
      print("Yes")
      count_all += 1
    else:
      print("No")
  elif c == "b":
    if count_all < (A + B) and (rank_b <= B):
      print("Yes")
      count_all += 1
      rank_b += 1
    else:
      print("No")
  elif c == "c":
    print("No")

Submission status: Accepted

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

count = 0
bi = 0
for s in S:
    ans = 'No'
    if count < A+B:
        if s == 'a':
            ans = 'Yes'
            count += 1
        if s == 'b' and bi < B:
            ans = 'Yes'
            count += 1
            bi += 1
    print(ans)