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 = list(input())
for i in s:
  if i == "a" and (a + b) != 0:
    a -= 1
    print("Yes")
  elif i == "b" and (a + b) != 0 and b != 0:
    b -=1
    print("Yes")
  else:
    print("No")

Submission status: Accepted

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

limit = A+B
cnt = 0

for s in S:
    if s=="c":
        print("No")
    elif (s=="a") & (cnt<limit):
        print("Yes")
        cnt += 1
    elif (s=="b") & (cnt<limit) & (B>0):
        print("Yes")
        cnt += 1
        B -= 1
    else:
        print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
import re
import math
from collections import defaultdict
import itertools
from copy import deepcopy
import random
from heapq import heappop,heappush
import time
import os
import queue
import sys
import datetime
from functools import lru_cache
#@lru_cache(maxsize=None)
readline=sys.stdin.readline
sys.setrecursionlimit(2000000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def is_power(a,b):#aはbの累乗数か
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def get_facs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=""):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def floor_(n,x=1):
    return x*(n//x)
def ceil_(n,x=1):
    return x*((n+x-1)//x)
def hani(x,min_,max_):
    ret=x
    if x<min_:ret=min_
    if x>max_:ret=max_
    return ret
def seifu(x):
    return x//abs(x)
###################################################
def main():
    N,A,B=map(int,input().split())
    S=input()
    cnt=0
    bcnt=0
    ans=[]
    for c in S:
        if c=="c":
            ans.append("No")
            continue

        if c=="a" and cnt<A+B:
            ans.append("Yes")
        elif c=="b" and bcnt<B and cnt<A+B:
            ans.append("Yes")
        else:
            ans.append("No")
            continue
        cnt+=1
        if c=="b":bcnt+=1
    for a in ans:
        print(a)


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,a,b = map(int,input().split())
s = list(input())
cnt = 0
fcnt = 0
ans = []
for i in s:
  if i=="a":
    cnt +=1
    if cnt <=(a+b):
      ans.append("Yes")
    else:
      cnt -=1
      ans.append("No")
  if i=="b":
    cnt +=1
    fcnt +=1
    if cnt<=(a+b) and fcnt <=b:
      ans.append("Yes")
    else:
      cnt -=1
      fcnt -=1
      ans.append("No")
  if i=="c":
    ans.append("No")

for k in ans:
  print(k)

Submission status: Accepted

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

n_all = 0
n_for = 0
for s1 in s:
    if s1 == "a":
        if n_all < a + b:
            print("Yes")
            n_all += 1
        else:
            print("No")
    elif s1 == "b":
        if n_all < a + b and n_for < b:
            print("Yes")
            n_all += 1
            n_for += 1
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

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

n = 0
b = 0

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

Submission status: Accepted

Solution code:
"""
    参加: N 人
    

    input:
        - S: S[i] == 'a' -> 国内, b -> 海外, c -> Neither
    output: 予選通過/No Yes/No
"""

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

passed_cnt = 0
overseas_cnt = 0
for c in S:
    if c == 'a': # 国内学生
        if passed_cnt < A + B:
            print('Yes')
            passed_cnt += 1
        else:
            print('No')
    elif c == 'b': # 海外学生
        if passed_cnt < A + B and overseas_cnt < B:
            print('Yes')
            passed_cnt += 1
        else:
            print('No')
        overseas_cnt += 1
    else: # 学生でない
        print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
S = input()
passed = 0
passed_foreign = 0
ans = [False for _ in range(N)]

for i, human in enumerate(S):
    if human == 'a' and passed < A+B:
        passed += 1
        ans[i] = True
    if human == 'b' and passed < A+B and passed_foreign < B:
        passed += 1
        passed_foreign += 1
        ans[i] = True

for a in ans:
    print('Yes' if a else 'No')

Submission status: Accepted

Solution code:
#print#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code

#なお、任意の整数 M に対して M の −2 進数表現が一意に定まることが証明できます。
#2桁ごとに見るとよかった（もう実験したよ）
def resolve():
    N,A,B=pin()
    S=input()
    a=0
    b=0
    for s in S:
        #print(s)
        if s=="c":
            print("No")
            continue
        elif s=="a":
            a+=1
        else:
            
            if b>=B:
                print("No")
                continue
            b+=1
        #print(s,a+b)
        if (a+b)<=(A+B):
            print("Yes")
        else:print("No")
    

#%%submit!
resolve()

Submission status: Accepted

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

for i in s:
    if i == 'a':
        if domestic + abroad <= a + b - 1:
            print('Yes')
            domestic += 1
        else:
            print('No')
    elif i == 'b':
        if domestic + abroad <= a + b - 1 and abroad <= b - 1:
            print('Yes')
            abroad += 1
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

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

Submission status: Accepted

Solution code:
import sys


def main():
    n, a, b = map(int, sys.stdin.readline().split())
    s = sys.stdin.readline().rstrip()

    ans = ["No"] * n
    success = 0
    foreigner = 0

    for i in range(n):
        if s[i] == "a":
            ans[i] = "Yes"
            success += 1
        elif s[i] == "b" and foreigner < b:
            ans[i] = "Yes"
            success += 1
            foreigner += 1
        if success == a + b:
            break

    print("\n".join(ans))
    return


if __name__ == "__main__":
    main()

Submission status: Accepted

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

ans = ["No"] * n
success = 0
foreigner = 0

for i in range(n):
    if s[i] == "a":
        ans[i] = "Yes"
        success += 1
    elif s[i] == "b" and foreigner < b:
        ans[i] = "Yes"
        success += 1
        foreigner += 1
    if success == a + b:
        break

print("\n".join(ans))

Submission status: Accepted

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

ans = ["No"] * n
success = 0
foreigner = 0

for i in range(n):
    if s[i] == "a":
        ans[i] = "Yes"
        success += 1
    elif s[i] == "b" and foreigner < b:
        ans[i] = "Yes"
        success += 1
        foreigner += 1
    if success == a + b:
        break

for i in ans:
    print(i)

Submission status: Accepted

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

success = 0
foreigner = 0
count = 0

for i in s:
    if i == "a":
        print("Yes")
        success += 1
    elif i == "b" and foreigner < b:
        print("Yes")
        success += 1
        foreigner += 1
    else:
        print("No")
    count += 1
    if success == a + b:
        break

for _ in range(n - count):
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

sum = a + b
passingD = 0  # 国内
passingF = 0  # 海外
flag = 'No'

for i, student in enumerate(s, 1):
    if student == 'a' and (passingD + passingF) < sum:
        passingD = passingD + 1
        flag = 'Yes'
    elif student == 'b' and (passingD + passingF) < sum and passingF < b:
        passingF = passingF + 1
        flag = 'Yes'
    else:
        flag = 'No'

    print(flag)

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
s=input()
ans=list('No'for _ in range(n))
c=a+b
countY=0
countb=0
for i in range(n):
    if countY<c:
        if s[i]=='a':
            ans[i]='Yes'
            countY+=1
        if s[i]=='b' and countb<b:
            ans[i]='Yes'
            countY+=1
            countb+=1
            
print(*ans,sep='\n')

Submission status: Accepted

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

d = 0
o = 0
p = 0

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

Submission status: Accepted

Solution code:
# CODE FESTIVAL 2016 B
N,A,B = list(map(int, input().split()))
cnt = 0
b_cnt = 0

S = input()
for s in S:
    if s == 'c':
        print('No')
    elif cnt >= A+B:
        print('No')
    elif s == 'b' and b_cnt >= B:
        print('No')
    else:
        cnt += 1
        if s == 'b':
            b_cnt += 1
        print('Yes')

Submission status: Accepted

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

PassNo = 0
Limit = A + B
StuJpn = 0
StuInt = 0

for i in S:
  if PassNo < Limit:
    if i == 'a':
      StuJpn += 1
      print("Yes")
    elif i == 'b':
      if StuInt < B:
        StuInt += 1
        print("Yes")
      else:
        print("No")
    else:
      print("No")
  else:
    print("No")
  PassNo = StuJpn + StuInt

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

def main():
    a = 'a'
    b = 'b'
    c = 'c'
    y = 'Yes'
    n = 'No'
    ac = 0
    bc = 0
    N, A, B = map(int, input().split())
    s = input()
    for i in range(N):
        if s[i] == a:
            if ac < A + B:
                print(y)
                ac += 1
            else:
                print(n)
        elif s[i] == b:
            if ac < A + B and bc+1 <= B:
                print(y)
                ac += 1
                bc += 1
            else:
                print(n)
        else:
            print(n)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

countA = 0
countB = 0

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

Submission status: Accepted

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

# a: 国内の学生
# b: 海外の学生
# c: その他
# i番idxはi位


passes_num = 0  # 通過した人の数
foregin_rank = 1  # 海外の学生の中での順位
thredshould = a + b
for c in s:
    if c == "c":
        print("No")
    elif c == "a":
        if passes_num < thredshould:
            passes_num += 1
            print("Yes")
        else:
            print("No")
    else:
        if passes_num < thredshould and foregin_rank <= b:
            passes_num += 1
            foregin_rank += 1
            print("Yes")
        else:
            print("No")

Submission status: Accepted

Solution code:
N,A,B = map(int,input().split())
student = input()
passp = 0
passb = 0
ab = (A+B)
for s in student:
	if s == "a":
		if passp < ab:
			passp += 1
			print("Yes")
		else:
			print("No")
	elif s == "b":
		if passp < ab and passb < B:
			passp += 1
			passb += 1
			print("Yes")
		else:
			print("No")
	else:
		print("No")

Submission status: Accepted

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

s = list(input())

t = 0

kt = 0

j = 1

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

Submission status: Accepted

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

accept = 0
accept_ab = 0
for i in s:
    if i == "a":
        if accept<a+b:
            accept+=1
            print("Yes")
        else:
            print("No")
    if i == "b":
        if accept<a+b and accept_ab <b:
            accept+=1
            accept_ab+=1
            print("Yes")
        else:
            print("No")
    if i =="c":
        print("No")

Submission status: Accepted

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

sum_AB = a + b
sum_total = 0
sum_B = 0

for s in s_list:
    if s == 'c':
        print('No')
        continue
    if s == 'a':
        if sum_total < sum_AB:
            print("Yes")
            sum_total += 1
        else:
            print('No')
    elif s == 'b':
        if sum_total < sum_AB and sum_B < b:
            print('Yes')
            sum_total += 1
            sum_B += 1
        else:
            print('No')

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split()) 
s = [i for i in input()]
count = 0
sb = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

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

str = input()

res = a + b
b_num = 1

for i in range(len(str)):
    if(str[i] == 'a'):
        if(res > 0):
            print('Yes')
            res -= 1
        else:
            print('No')
    elif(str[i] == 'b'):
        if(res > 0) and (b_num <= b):
            print('Yes')
            res -= 1
            b_num += 1
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

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

    total, _b, = 0, 0
    for t in s:
        if t == 'a':
            if total < (a + b):
                print('Yes')
                total += 1
            else:
                print('No')

        elif t == 'b':
            if total < (a + b) and _b < b:
                print('Yes')
                _b += 1
                total += 1
            else:
                print('No')
        else:
            print('No')

resolve()

Submission status: Accepted

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

a_cnt = b_cnt = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

goal =0
Bgoal =0

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

Submission status: Accepted

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


countA = 0
countB = 0
for i in s:
  if i == 'a' and countA + countB < a + b:
    print("Yes")
    countA += 1
  elif i == 'b' and countA + countB < a + b and countB < b:
    print("Yes")
    countB += 1
  else:
    print("No")

Submission status: Accepted

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

def solve(S):
    ans = []
    students = 0
    foreigners = 0
    for i in range(N):
        if S[i]=='a' and students<A+B:
            ans.append('Yes')
            students += 1
        elif S[i]=='b' and foreigners<B and students<A+B:
            ans.append('Yes')
            students += 1
            foreigners += 1
        else:
            ans.append('No')
    return ans
print(*solve(S),sep='\n')

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
s = input()
 
for i in s:
    if (i == "a" and a + b > 0):
        print("Yes")
        a -= 1
    elif (i == "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 = [0] + list(input())

num_pass = 0
num_pass_foreign = 0

for i in range(1, n + 1):
	if s[i] == 'c':
		print('No')
	elif s[i] == 'a':
		if num_pass < a + b:
			print('Yes')
			num_pass += 1
		else:
			print('No')
	elif s[i] == 'b':
		if num_pass < a + b and num_pass_foreign < b:
			print('Yes')
			num_pass += 1
			num_pass_foreign += 1
		else:
			print('No')

Submission status: Accepted

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

for i in s:
    if (i == "a" and A + B > 0):
        print("Yes")
        A -= 1
    elif (i == "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() #sys.stdin.readlineは最後が改行

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

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
s = input()
a_cnt = b_cnt = 0
p = True
for si in s:
    if si == "c":
        print("No")
    elif si == "a":
        if p:
            print("Yes")
            a_cnt += 1
        else:
            print("No")
    else:
        if p and b_cnt < b:
            print("Yes")
            b_cnt += 1
        else:
            print("No")
    if p and a_cnt + b_cnt == a + b:
        p = False

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
  N, A, B = [int(i) for i in input().split()]
  S = input()
  
  passed_a = 0
  passed_b = 0
  result = [False]*N
  
  for i in range(N):
    if S[i] == "a":
      if passed_a + passed_b < A + B:
        passed_a += 1
        result[i] = True
    
    elif S[i] == "b":
      if passed_a + passed_b < A + B and passed_b < B:
        passed_b += 1
        result[i] = True

  ans = ["Yes" if i else "No" for i in result]
  print("\n".join(ans))

resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

passed = 0
foreigners = 0
for s in S:
  if s == "a" and passed < a+b:
    print("Yes")
    passed += 1
  elif s == "b":
    foreigners += 1
    if passed < a+b and foreigners <= b:
      print("Yes")
      passed += 1
    else:
      print("No")
  else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# B
n, a, b = map(int, input().split())
s = input()
count = 0
bcount = 0
for i in s:
    # print(i)
    if i == "a":
        if a + b > count:
            print('Yes')
            count += 1
        else:
            print('No')
    if i == 'b':
        if a + b > count and b > bcount:
            print('Yes')
            count += 1
            bcount += 1
        else:
            print('No')
    if i == "c":
        print('No')
    # print(count,bcount)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
N, A, B = map(int, input().split())
S = input()
num = 0
fo = 0
for i in range(N):
    if num >= A + B or S[i] == 'c':
        print('No')
    elif S[i] == 'a':
        print('Yes')
        num += 1
    elif S[i] == 'b':
        fo += 1
        if fo <= B:
            print('Yes')
            num += 1
        else:
            print('No')

Submission status: Accepted

Solution code:
N,A,B = map(int,input().split())
players = list(input())
tuuka = 0
kaigai = 0
for i in players:
    if i == "c":
        print("No")
        continue
    if i == "b" or i == "a":
        if tuuka < A + B:
            if i == "a":
                print("Yes")
                tuuka += 1
                continue
            if i == "b" and kaigai < B:
                print("Yes")
                tuuka += 1
                kaigai += 1
            else:
                print("No")
        else:
            print("No")

Submission status: Accepted

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

ab=0
f=0

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