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 = map(int, input().split())
S = input()

a = 0
b = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
import math
N,A,B = map(int,input().split())
S = input()
a_count = 0
b_count = 0
for i in range(N):
	if S[i] == "a":
		if a_count + b_count > A + B -1:
			print("No")
		else:
			print("Yes")
			a_count += 1
	elif S[i] == "b":
		if A + B >= a_count + b_count + 1 and B >= b_count + 1 :
			print("Yes")
			b_count += 1
		else:
			print("No")
	else:
		print("No")

Submission status: Accepted

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

Submission status: Accepted

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

count_b = 0
count = 0
ans = ['No']*N
for j,i in enumerate(S):
    if i == 'a':
        if count < A+B:
            ans[j] = 'Yes'
            count += 1
    elif i == 'b':
        if count < A+B and count_b < B:
            ans[j] = 'Yes'
            count += 1
            count_b += 1

[print(i) for i in ans]

Submission status: Accepted

Solution code:
n,a,b = map(int,input().split())
s = input()
total = a+b
cnt_t = 0
cnt_b = 0
for i in s:
  if i == 'a' and total > cnt_t:
    print('Yes')
    cnt_t += 1
  elif i == 'b' and total > cnt_t and b > cnt_b:
    print('Yes')
    cnt_t += 1
    cnt_b += 1
  else:
    print('No')

Submission status: Accepted

Solution code:
#B問題
N,A,B = map(int,input().split())
s = list(str(input()))
normal = 0
foreign = 0
for i in range(N):
    if s[i] == "a":
        if normal < A+B:
            normal+=1
            print("Yes")
        else:
            print("No")
    elif s[i] == "b":
        if normal < A+B and foreign < B:
            normal+=1
            foreign+=1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

all_passed = 0
foreign_passed = 0
for s in S :
    if (s == 'a' and all_passed < A+B) :
        all_passed += 1
        print("Yes")
        continue
    
    if (s == 'b' and all_passed < A+B and foreign_passed < B) :
        all_passed += 1
        foreign_passed += 1
        print("Yes")
        continue
    
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

a, b = 0, 0
for s in S:
    if s == "a" and a + b < A + B:
        print("Yes")
        a += 1
    elif s == "b" and 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()
a = 0
b = 0
for s in S:
    if s == 'a':
        a += 1
        print("Yes" if a+b <= A+B else "No")
    elif s == 'b':
        b += 1
        print("Yes" if a+b <= A+B and b <= B else "No" )
        b = min(b,B)
    else:
        print("No")

Submission status: Accepted

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

    if p == "c":
        print("No")

Submission status: Accepted

Solution code:
N, a, b = map(int, input().split())
s = input()
abcnt = 0
bcnt = 0
for c in s:
    if c == 'a' and abcnt < a + b:
        abcnt += 1
        print('Yes')
    elif c == 'b' and abcnt < a + b and bcnt < b:
        abcnt += 1
        bcnt += 1
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - Qualification simulator
https://atcoder.jp/contests/code-festival-2016-qualb/tasks/codefestival_2016_qualB_b

"""
import sys


def solve(N, A, B, S):
    ans = []
    total_qualified = 0
    b_qualified = 0
    for ch in S:
        if ch == 'a':
            if total_qualified < A+B:
                ans.append('Yes')
                total_qualified += 1
            else:
                ans.append('No')
        elif ch == 'b':
            if total_qualified < A+B and b_qualified < B:
                ans.append('Yes')
                total_qualified += 1
                b_qualified += 1
            else:
                ans.append('No')
        else:
            ans.append('No')
    return ans


def main(args):
    N, A, B = map(int, input().split())
    S = input()
    ans = solve(N, A, B, S)
    print(*ans, sep='\n')


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(len(S)):
    if S[i]=="c":
        print("No")
    elif S[i]=="a":
        if tsuuka < A+B:
            print("Yes")
            tsuuka+=1
        else:
            print("No")
    else:
        if tsuuka < A+B and kaigai<B:
            print("Yes")
            tsuuka+=1
            kaigai+=1
        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(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 < 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=0
foreignQual=0
for t in S:
    if qual<A+B:
        if t=="a":
            qual+=1
            print("Yes")
        elif t=="b" and foreignQual<B:
            qual+=1
            foreignQual+=1
            print("Yes")
        else:print("No")
    else:print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 参考 https://atcoder.jp/contests/code-festival-2016-qualb/submissions/3090756
n, a, b=map(int,input().split())
for s in input():
    if s=='a':
        if a+b>0:
            print('Yes')
            a-=1
        else:
            print('No')
    elif s=='b'and a+b>0 and b>0:
        print('Yes')
        b-=1
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = []
num_passed = 0
num_foreign = 0
for ch in S:
    if ch == "a":
        ans.append(num_passed < A + B)
    elif ch == "b":
        num_foreign += 1
        ans.append((num_passed < A + B) and (num_foreign <= B))
    else:
        ans.append(False)

    num_passed += 1 if ans[-1] else 0

print("\n".join(map(lambda x: "Yes" if x else "No", ans)))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N,A,B=MAP()
S=input()

sm=bsm=0
for i in range(N):
    if S[i]=='a':
        if sm<A+B:
            sm+=1
            Yes()
        else:
            No()
    elif S[i]=='b':
        if sm<A+B and bsm<B:
            sm+=1
            bsm+=1
            Yes()
        else:
            No()
    else:
        No()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

sumy = 0
sumf = 0
for _s in s:
  if _s == 'c':
    print('No')
  elif _s == 'a':
    if sumy < a + b:
      print('Yes')
      sumy += 1
    else:
      print('No')
  else:
    if sumy < a + b and sumf < b:
      print('Yes')
      sumy += 1
      sumf += 1
    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(N):
  if S[i] == 'a' and a+b < A+B:
    a += 1
    print('Yes')
  elif S[i] == 'b' and a+b < A+B and b < B:
    b += 1
    print('Yes')
  else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
count=0
fcount=0
for s in input():
#    print(s,count,fcount)
    if s=="c":
        print("No")
    elif s=="a":
        if count<a+b:
            print("Yes")
            count+=1
        else:
            print("No")
    else:
        fcount+=1
        if count<a+b and fcount<=b:
            print("Yes")
            count+=1
        else:
            print("No")

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
apb=a+b
s=list(input())
juni=0
kokunai=0
kaigai=0
for i in s:
  if i=='a':
    kokunai+=1
    if kokunai+kaigai<=apb:
      print('Yes')
    else:
      print('No')
  elif i=='b':
    kaigai+=1
    if kokunai+kaigai<=apb and b>=kaigai:
      print('Yes')
    else:
      kaigai-=1
      print('No')
  else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys  # {{{
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools
# }}}

# pre-defined{{{
sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)]  # can also use string module
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]
from inspect import currentframe
def dump(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' => '+repr(arg) for arg in args), file=sys.stderr)
# }}}

def local_input():# {{{
    from pcm.utils import set_stdin
    import sys
    from pathlib import Path
    parentdir = Path(os.path.dirname(__file__)).parent
    inputfile = parentdir.joinpath('test/sample-1.in')
    if len(sys.argv) == 1:
        set_stdin(inputfile)
# }}}

def solve():
    N, A, B = map(int, input().split())
    S = input()

    c = 0
    o = 0
    for n in range(N):
        i = S[n]
        if (i=='a'):
            if c < A+B:
                print("Yes")
                c += 1
            else:
                print("No")
        elif (i=='b'):
            o += 1
            if c < A+B and o<=B:
                print("Yes")
                c += 1
            else:
                print("No")
        else:
            print("No")
    return 0

if __name__ == "__main__":# {{{
    try:
        local_input()
    except:
        pass
    solve()
# vim: set foldmethod=marker:}}}

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
S = input()
li = list(S)
kaigai = 0
tsuka = 0
for x in li:
    if x == 'a':
        if tsuka + 1 <= A+B:
            print('Yes')
            tsuka += 1
        else:
            print('No')
    elif x == 'b':
        if tsuka +1 <= A+B and kaigai + 1 <=B :
            print('Yes')
            tsuka += 1
        else:
            print('No')
        kaigai += 1
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

anss = ['No'] * N
numA = numB = 0
for i, S in enumerate(Ss):
    if S == 'a':
        if numA + numB < A + B:
            anss[i] = 'Yes'
            numA += 1
    elif S == 'b':
        if numA + numB < A + B and numB < B:
            anss[i] = 'Yes'
            numB += 1

print('\n'.join(anss))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n,a,b = li()
s = ns()

cnt = 0
frank = 1

for i, si in enumerate(s):
    if si == 'a':
        if cnt < a+b:
            cnt += 1
            print("Yes")
        else:
            print("No")
            
    elif si == 'b':
        if cnt < a+b and frank <= b:
            cnt += 1
            frank += 1
            print("Yes")
        else:
            print("No")
            
    else:
        print("No")

Submission status: Accepted

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

ans = ['No'] * N
p = b = 0
for i,c in enumerate(S):
    if c == 'a':
        if p < A+B:
            ans[i] = 'Yes'
            p += 1
    elif c == 'b':
        if p < A+B and b < B:
            ans[i] = 'Yes'
            p += 1
            b += 1
print(*ans,sep='\n')

Submission status: Accepted

Solution code:
import sys
from fractions import gcd
from itertools import groupby as gb
from itertools import permutations as perm
from collections import Counter as C
from collections import defaultdict as dd
sys.setrecursionlimit(10**5)

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

kaigai = 0
all = 0

for c in s:
    if c == 'a':
        if all < a + b:
            all += 1
            print('Yes')
        else:
            print('No')
    if c == 'b':
        if all < a + b and kaigai < b:
            all += 1
            kaigai += 1
            print('Yes')
        else:
            print('No')
    if c == 'c':
        print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt_a, cnt_b = 0, 0
for i in range(N):
  if S[i] == 'a' and cnt_a + cnt_b < A+B:
    print("Yes")
    cnt_a += 1
  elif S[i] == 'b' and cnt_a + cnt_b < A+B and cnt_b < B:
    print("Yes")
    cnt_b += 1
  else:
    print("No")

Submission status: Accepted

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