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()

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

Submission status: Accepted

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

counter1 = counter2 = 1
for char in s:
    if (counter1 <= (a+b)) & (char == 'a'):
        print("Yes")
        counter1 += 1
    elif (counter1 <= (a+b)) & (char == 'b') & (counter2 <= b):
        print("Yes")
        counter1 += 1
        counter2 += 1
    else:
        print("No")

Submission status: Accepted

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':
            abroad = abroad + 1
            if yes < (A + B) and abroad <= B:
                print('Yes')
                yes = yes + 1

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

main()

Submission status: Accepted

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

passed = 0
foreigners = 0

for i in range(N):
    # 国内学生
    if S[i] == "a":
        if passed < (A + B):
            passed += 1
            print("Yes")
        else:
            print("No")

    # 海外学生
    if S[i] == "b":
        foreigners += 1
        if passed < (A + B) and foreigners <= B:
            passed += 1
            print("Yes")
        else:
            print("No")

    if S[i] == "c":
        print("No")

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
S = input()
a, b = 0, 0
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())
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 and kaigai <B:
            print('Yes')
            total += 1
            kaigai += 1
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))

n, a, b = MI()
s = input()
ok = 0
rank = 0
for si in s:
    if si == 'a':
        if ok < a+b:
            print("Yes")
            ok += 1
        else:
            print("No")
    elif si == 'b':
        rank += 1
        if ok < a+b and rank <= b:
            print("Yes")
            ok += 1
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

Solution code:
from sys import stdin
N,A,B = [int(x) for x in stdin.readline().rstrip().split()]
S = stdin.readline().rstrip()
#print(N,A,B)
#print(S)
n=0 #予選通過者人数
n_f=0 #海外学生通過者人数
for i in S:
  if i == "a":
    if n < A+B:
      print("Yes")
      n+=1
    else:
      print("No")
    continue
    
  if i == "b":
    if n < A+B and n_f < B:
      print("Yes")
      n+=1
      n_f+=1
    else:
      print("No")
    continue
    
  if i =="c":
    print("No")

Submission status: Accepted

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 and kaigai <B:
            print('Yes')
            total += 1
            kaigai += 1
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

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

passed = 0
foreign = 0

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

Submission status: Accepted

Solution code:
def LI(): return list(map(int, input().split()))
def I(): return map(int, input().split())


mod = 10**9 + 7


def main():
    n, a, b = I()
    s = input()
    yn = []
    for i in range(n):
        if s[i] == 'a':
            if a + b > 0:
                print('Yes')
                if a > 0:
                    a -= 1
                else:
                    b -= 1
            else:
                print('No')
        elif s[i] == 'b':
            if a + b > 0 and b > 0:
                print('Yes')
            else:
                print('No')
            if b > 0:
                b -= 1
        else:
            print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

s = list(input())
rank = 0
brank = 0
for s_i in s:
  if s_i=='a':
    if rank==a+b:
      print("No")
      continue
    rank+=1
    print("Yes")
  elif s_i=='b':
    if rank==a+b:
      print("No")
      continue
    if brank==b:
      print("No")
      continue
    rank+=1
    brank+=1
    print("Yes")
  else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N,A,B = map(int,input().split())
S = input()
total = A+B
for i in range(N):
    if S[i]=='c':
        print('No')
    elif total>0:
        if S[i] == 'a':
            print('Yes')
            total = total-1
        elif S[i] =='b' and B>0:
            print('Yes')
            total = total-1
            B = B-1
        else:
            print('No')
    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 = list(input())

yes_num = 0
gai = 0

for i in s:
    if i == "a":
        if yes_num < a + b:
            yes_num += 1
            print("Yes")
        else:
            print("No")
    
    elif i == "b":
        if yes_num < a+b and gai < b:
            yes_num += 1
            gai += 1
            print("Yes")
        else:
            print("No")
    
    elif i == "c":
        print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3


def main():
    n, a, b = map(int,input().split())
    s = input()
    sanka = 0
    sankaigai = 0

    for hito in s:
        if hito is "c":
            print("No")
        elif hito is "a":
            if sanka < a+b:
                print("Yes")
                sanka+=1
            else:
                print("No")
        elif hito is "b":
            if sanka < a+b:
                if sankaigai < b:
                    print("Yes")
                    sanka+=1
                    sankaigai+=1
                else:
                    print("No")
            else:
                print("No")
        else:
            print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

N, A, B = ri_()
S = rs()
a = 0
b = 0
for i in S:
    if i == 'a':
        if a < A + B:
            print('Yes')
            a += 1
        else:
            print('No')
    elif i == 'b':
        if a < A + B and b <= B - 1:
            print('Yes')
            a += 1
        else:
            print('No')
        b += 1
    else:
        print('No')

Submission status: Accepted

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

passCount = 0
overseaPassCount = 1
for k,v in enumerate(S):
  if v == "c":
    print("No")
  elif v == "b":
    if passCount<A+B and overseaPassCount<=B :
      print("Yes")
      overseaPassCount += 1
      passCount += 1
    else:
      print("No")
  elif v == "a":
    if passCount<A+B :
      print("Yes")
      passCount += 1
    else:
      print("No")

  else :
    None

Submission status: Accepted

Solution code:
def main(N, A, B ,S):
    status = [None for _ in range(N)]
    c_all, c_for = 0, 0
    for i, s in enumerate(S):
        if s == 'a' and c_all < A + B:
            c_all += 1
            status[i] = 'Yes'
        elif s == 'b' and c_all < A + B and c_for < B:
            c_all += 1
            c_for += 1
            status[i] = 'Yes'
        else:
            status[i] = 'No'
    return status


if __name__ == "__main__":
    N, A, B = map(int, input().split())
    S = input()
    ans = main(N, A, B, S)
    for i in ans:
        print(i)

Submission status: Accepted

Solution code:

def resolve():
    n, a, b = input().strip().split(' ')
    n, a, b = [int(n), int(a), int(b)]
    s = input().strip()
    a_passed = 0
    b_passed = 0
    for i in range(len(s)):
        if s[i] == 'a':
            if a_passed + b_passed < a + b:
                a_passed = a_passed + 1
                print('Yes')
            else:
                print('No')
        elif s[i] == 'b':
            if a_passed + b_passed < a + b and b_passed < b:
                b_passed = b_passed + 1
                print('Yes')
            else:
                print('No')
        else:
            print('No')
resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
# template by 3xC and starkizard.
# contributors: 

#####################################################################################
from __future__ import division, print_function 

import sys
import os
from collections import Counter, deque, defaultdict
import itertools
import math
import io


"""Uncomment modules according to your need"""


# from bisect import bisect_left, bisect_right, insort
# from heapq import heappop, heapify, heappush
# from random import randint as rn
# from Queue import Queue as Q
# from copy import deepcopy
# from decimal import *
# import re
# import operator

#####################################################################################
# this enables you to write python3 code with PyPy2 (Python 2)
if sys.version_info[0] < 3:
    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

#####################################################################################

"""value of mod"""
MOD = 998244353
mod = 10**9 + 7

"""Uncomment next 4 lines if doing huge recursion"""
# import threading
# threading.stack_size(1<<27)
# sys.setrecursionlimit(10000

def prepare_factorial(mod=mod):
    """ returns two lists, factorial and inverse factorial modulo argument by default 10**9 +7 """
    # Comment code out when you don't need inverse factorial or vice versa
    fact = [1]
    for i in range(1, 200005):
        fact.append((fact[-1] * i) % mod)

    ifact = [0] * 200005
    ifact[200004] = pow(fact[200004], mod - 2, mod)
    for i in range(200004, 0, -1):
        ifact[i - 1] = (i * ifact[i]) % mod
 
    return fact, ifact

def modinv(n, p):
    """ returns N inverse modulo p """
    return pow(n, p - 2, p)
 
def ncr(n, r,  fact, ifact):
    """ takes 4 arguments: n , r and factorial and inverse factorial lists"""
    t = (fact[n] * (ifact[r]*ifact[n-r]) % MOD)% MOD
    return t


def get_n(Sum):    
    """this function returns the maximum n for which Summation(n) <= Sum"""
    ans = (-1 + sqrt(1 + 8*Sum))//2
    return ans

def sieve(n):
    """ returns a list of prime numbers till n """
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r



def divs(n, start=1):
    """ returns a list of all divisors till n """
    divisors = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if n % i == 0:
            if n / i == i:
                divisors.append(i)
            else:
                divisors.extend([i, n // i])
    return divisors



def divn(n, primes):
    """ returns the number of divisors, two arguments n and the sieve till n """
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t



def lrfind(d, x, default=-1):
    """ Takes 2 arguments an iterable and an element. returns a tuple (firstoccurence,lastoccurence) -1 if not found """
    left = right = -1
    for i in range(len(d)):
        if d[i] == x:
            if left == -1: left = i
            right = i
    if left == -1:
        return default, default
    else:
        return left, right

def gcd(x, y): # math.gcd is slower
    """ returns greatest common divisor of x and y """
    while y:
        x, y = y, x % y
    return x

def ceil(n, k=1): return n // k + (n % k != 0) #returns math.ceil but protecting against floating inconsistencies
def input(): return sys.stdin.readline().strip()
def ii(): return int(input()) #inputs integer
def mi(): return map(int, input().split()) # inputting space seperated variables for example x,y,z
def li(): return list(map(int, input().split())) #inputting a space seperated list of integers
def lw(): return input().split() #inputting a space seperated list of strings
def lcm(a, b): return abs(a * b) // gcd(a, b) #returns LCM of two arguments
def prr(a, sep=' ', end='\n'): print(sep.join(map(str, a)), end=end) #For printing an iterable with seperator sep as optional second argument (default : " "), ending character (default: "\n") as optional third
def dd(): return defaultdict(int) #returns a dictionary with values defaulted to 0
def ddl(): return defaultdict(list) #returns a dictionary with values defaulted to []
def write(s): return sys.stdout.write(s)












###################################################################
def main():
    #CODE GOES HERE:
    n,a,b=mi()
    s=input()
    passed=0
    passedb=0
    for i in s:
        if i=="c":
            print("No")
        elif i=="b":
            if passedb<b and passed<a+b:
                print("Yes")
                passed+=1
                passedb+=1
            else:
                print("No")
        else:
            if passed<a+b:
                print("Yes")
                passed+=1
            else:
                print("No")


















































""" -------- Python 2 and 3 footer by Pajenegod and c1729 ---------"""
 
py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange
 
import os, sys
from io import IOBase, BytesIO
 
BUFSIZE = 8192
 
class FastIO(BytesIO):
    newlines = 0
 
    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None
 
    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
        return s
 
    def read(self):
        while self._fill(): pass
        return super(FastIO, self).read()
 
    def readline(self):
        while self.newlines == 0:
            s = self._fill();
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)
 
 
class IOWrapper(IOBase):
 
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode('ascii'))
            self.read = lambda: self.buffer.read().decode('ascii')
            self.readline = lambda: self.buffer.readline().decode('ascii')
 
 
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')
 
""" main function"""
 
if __name__ == '__main__':
    main()
    # threading.Thread(target=main).start()

Submission status: Accepted

Solution code:
def resolve():
    N, A, B = [int(i) for i in input().split()]
    S = input()
    ac = 0
    abc = 0
    for s in S:
        flg = False
        if s == "a":
            if ac < A + B:
                flg = True
                ac += 1
        elif s == "b":
            if ac < A + B and abc < B:
                flg = True
                ac += 1
                abc += 1
        else:
            pass

        if flg:
            print("Yes")
        else:
            print("No")


resolve()

Submission status: Accepted

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

for i in s:
  if i == "c":
    print("No")
  elif i == "a":
    if nai+gai < a+b:
      print("Yes")
      nai += 1
    else:
      print("No")
  else:
    if (nai+gai < a+b) and gai < b:
      print("Yes")
      gai += 1
    else:
      print("No")

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
S = list(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 < 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()
ab=a+b
now=0
nowb=0
for i in range(n):
    if s[i]=="a":
        if now<ab:
            print("Yes")
            now+=1
        else:
            print("No")
    elif s[i]=="b":
        nowb+=1
        if nowb<=b and now<ab:
            print("Yes")
            now+=1
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

x = A + B
cnt = 1
rank = 1
for i in range(N):
    y = s[i : i+1]
    if cnt <= x:
        if y == "a":
            print("Yes")
            cnt += 1
        elif y == "b" and rank <= B:
            print("Yes")
            cnt += 1
            rank += 1
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

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

cnta=0
cntb=0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2, log
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
from decimal import Decimal
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
from decimal import *

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

cnt = 0
cnt_for = 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 cnt_for < B:
		cnt += 1
		cnt_for += 1
		print("Yes")
	else:
		print("No")

Submission status: Accepted

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

Submission status: Accepted

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

FOR = 1
CNT = 0
for i,s in enumerate(list(S)):
    if s=="a" and CNT < A+B:
        print("Yes")
        CNT+=1
    elif s=="b" and CNT < A+B and FOR <=B:
        print("Yes")
        CNT+=1
        FOR+=1
    else:
        print("No")

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
ab=a+b
S=input()
allp=0
forp=0
for s in S:
  if s=='a':
    if allp<ab:
      allp+=1
      print('Yes')
    else:
      print('No')
  elif s=='b':
    if allp<ab and forp<b:
      allp+=1
      forp+=1
      print('Yes')
    else:
      print('No')
  else:
    print('No')

Submission status: Accepted

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

x = A + B
cnt = 0
bcnt = 0
for s in S:
    if cnt >= x:
        print("No")
        continue
    if s == "a":
        cnt += 1
        print("Yes")
    elif s == "b":
        if bcnt < B:
            cnt += 1
            bcnt += 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")