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())
a = 0
b = 0
for i in s:
    if i == "a":
        if a + b < A + B:
            a += 1
            print("Yes")
        else:
            print("No")
    elif i == "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=input().split(" ")
n=int(n)
a=int(a)
b=int(b)
lst=input()
cnt=0
cnt2=0
for i in range(n):
  if lst[i]=="a":
    if cnt<a+b:
      print("Yes")
      cnt+=1
    else:
      print("No")
  elif lst[i]=="b":
    if cnt<a+b and cnt2<b:
      print("Yes")
      cnt+=1
      cnt2+=1
    else:
      print("No")
  else:
    print("No")

Submission status: Accepted

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

total, kaigai = 0, 0

for i in range(N):
    if S[i] == 'c':
        print('No')

    elif S[i] == 'b':
        if total < A+B and kaigai < B:
            print('Yes')
            total += 1
            kaigai += 1
        else:
            print('No')

    elif S[i] == 'a':
        if total < A+B:
            print('Yes')
            total += 1
        else:
            print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def judge_passing_qualifying_domestic(i, line):
    if i < A+B:
        print('Yes')
        return i+1
    else:
        print('No')
        return i

def judge_passing_qualifying_foreign(i, rank_in_foreign, line, line_foreign):
    if (i < A+B)&(rank_in_foreign <= line_foreign):
        print('Yes')
        return i+1, rank_in_foreign+1
    else:
        print('No')
        return i, rank_in_foreign+1


if __name__ == "__main__":
    N, A, B = list(map(int, input().split()))
    S = input()
    num_of_pass = 0
    rank_in_foreign = 1
    for p in list(S):
        if p == 'a':
            num_of_pass = judge_passing_qualifying_domestic(num_of_pass, A+B)
        elif p =='b':
            num_of_pass, rank_in_foreign = judge_passing_qualifying_foreign(num_of_pass, rank_in_foreign, A+B, B)
        else:
            print('No')

Submission status: Accepted

Solution code:
N,A,B=map(int,input().split())
S=input()
total=0
foreign=0
ans=['' for i in range(len(S))]

for i in range(len(S)):
    if S[i]=='a':
        if total<A+B:
            total+=1
            ans[i]='Yes'
        else:
            ans[i]='No'
    elif S[i]=='b':
        if total<A+B and foreign<B:
            total+=1
            foreign+=1
            ans[i]='Yes'
        else:
            ans[i]='No'
    else:
        ans[i]='No'

for anss in ans:
    print(anss)

Submission status: Accepted

Solution code:
#3
N,A,B = map(int,input().split())
S = input()
cou = 0
coub = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():

    n,a,b = list(map(int, input().split()))
    s = input()
    yes_a = 0
    yes_b = 0
    
    for i in range(n):
        s_i = s[i]
        if (yes_a+yes_b) < (a+b):
            if s[i] == "a":
                print("Yes")
                yes_a += 1
            if s[i] == "b":
                if yes_b < b:
                    print("Yes")
                    yes_b += 1
                else:
                    print("No")
            if s[i] == "c":
                print("No")
        else:
            print("No")
        
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N,A,B = [int(i) for i in input().split()]
S = input()
ans = []*N
b = 0
a = 0
for i in S:
    if i == "a" and a+b < A+B:
        a += 1
        ans.append("Yes")
        continue
    elif i == "b" and a+b < A+B and b < B:
        b += 1
        ans.append("Yes")
        continue
    ans.append("No")
print("\n".join(ans))

Submission status: Accepted

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

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

mem = list(S)
now = 0
fore=1
for i in range(N):
    if(mem[i]=='a'):
        if(now<(A+B)):
            now+=1
            print('Yes')
        else:
            print('No')

    elif(mem[i]=='b'):
        if(now<(A+B)):
            if(fore<=B):
                fore+=1
                now+=1
                print('Yes')
            else:
                print('No')
        else:
            print('No')

    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, A, B = [int(a) for a in input().split()]
S = input()
ans = []
npas = 0
npas_b = 0

for i in range(N):
    if S[i] == 'c':
        ans.append('No')
    else:
        if S[i] == 'a':
            if npas < A+B:
                ans.append('Yes')
                npas += 1
            else:
                ans.append('No')
        elif S[i] == 'b':
            if npas < A+B and npas_b < B:
                ans.append('Yes')
                npas += 1
                npas_b += 1
            else:
                ans.append('No')
                npas_b += 1

for a in ans:
    print(a)

Submission status: Accepted

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

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

Submission status: Accepted

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

count_ab=0
count_b=0

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

Submission status: Accepted

Solution code:
def resolve():
    '''
    code here
    https://atcoder.jp/contests/code-festival-2016-qualb/tasks/codefestival_2016_qualB_b
    '''
    N, A, B = [int(item) for item in input().split()]
    S = input()
    d = 0
    c = 0
    for i in range(N):
        temp = S[i]
        if temp == 'a':
            if d < A+B:
                d += 1
                print('Yes')
            else:
                print('No')
        elif temp == 'b':
            if d < A+B and c < B:
                c +=1
                d += 1
                print('Yes')
            else:
                print('No')
        else:
            print('No')

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

C,D = 0,0
for i,c in enumerate(S):
    if c == 'a':
        if C < A+B:
            print("Yes")
            C += 1
        else:
            print("No")
    elif c == 'b':
        if C < A+B and D < 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 = list(input())

count_all, count_b = 0, 0
for s in S:
    ans = "No"
    if s == "a":
        if count_all < a + b:
            ans = "Yes"
            count_all += 1
    elif s == "b":
        if count_all < a + b and count_b < b:
            ans = "Yes"
            count_all += 1
            count_b += 1
    print(ans)

Submission status: Accepted

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

for i in range(len(S)):
  if S[i] == 'a' and all < A + B:
    print('Yes')
    all += 1
    continue
  if S[i] == 'b' and all < A + B and foreign < B:
    print('Yes')
    all += 1
    foreign += 1
    continue
  print('No')

Submission status: Accepted

Solution code:
S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
LS=lambda:list(map(str,input().split()))

n,a,b=L()
s=S()
passed=0
rankbyb=0
for i in range(n):
    if s[i]=='b':
        rankbyb+=1
        
    if s[i]=='a' and passed<a+b:
        print('Yes')
        passed+=1
    elif s[i]=='b' and passed<a+b and rankbyb<=b:
        print('Yes')
        passed+=1
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    n, a, b = map(int, input().split())
    ss = input()
    b_count = 0
    total = 0
    for i, s in enumerate(ss):
        i += 1
        if s == "a":
            if total < a+b:
                total += 1
                print("Yes")
                continue
        elif s == "b":
            b_count += 1
            if total < a+b and b_count <= b:
                total += 1
                print("Yes")
                continue
        print("No")
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

X=A+B
Y=B

T=[]
for s in S:
    if s=="a":
        if X>0:
            T.append(True)
            X-=1
        else:
            T.append(False)
    elif s=="b":
        if X>0 and Y>0:
            T.append(True)
            X-=1
            Y-=1
        else:
            T.append(False)
    else:
        T.append(False)

for t in T:
    if t:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

dom = 0
glo = 0

for s in S:
    if (s == 'a') and (dom + glo < a + b):
        print('Yes')
        dom += 1
    elif (s == 'b') and (dom + glo < a + b) and (glo < b):
        print('Yes')
        glo += 1
    else:
        print('No')

Submission status: Accepted

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

ps = A + B
a,b = 0,0
for i in range(N):
    if S[i] == "c" or a >= ps:
        print("No")
        continue
    if S[i] == "b":
        b += 1
        if b > B:
            print("No")
            continue
    a += 1
    print("Yes")

Submission status: Accepted

Solution code:
# ####################################################################
# import io
# import sys

# _INPUT = """\
# 12 5 2
# cabbabaacaba

# 10 2 3
# abccabaabb
# """
# sys.stdin = io.StringIO(_INPUT)
####################################################################
import sys
def p(*_a):
  return
  _s=" ".join(map(str,_a))
  #print(_s)
  sys.stderr.write(_s+"\n")
####################################################################
yn = lambda b: print('Yes') if b else print('No')
####################################################################

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

a = b = 0

for s in S:
  p("   ",A,B,A+B,"_",s, a,b, a+b)
  if s == 'a':
    if (a+b) < (A+B):
      yn(True)
      a += 1
    else:
      yn(False)
  elif s == 'b':
    if ((a+b) < (A+B)) and (b < B):
      yn(True)
      b += 1
    else:
      yn(False)
  elif s == 'c':
    yn(False)

Submission status: Accepted

Solution code:
# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a_cnt = 0
b_cnt = 0

for i in range(N):
    if S[i] == "a":
        if a_cnt + b_cnt < A + B:
            J += "Yes\n"
            a_cnt += 1
        else:
            J += "No\n"
    elif S[i] == "b":
        if a_cnt + b_cnt < A + B and b_cnt < B:
            J += "Yes\n"
            b_cnt += 1
        else:
            J += "No\n"
    else:
        J += "No\n"

print(J)

Submission status: Accepted

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

a_cnt = 0
b_cnt = 0

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

Submission status: Accepted

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

s = str(input())

count_a = 0
count_b = 0

for i in s:
  
  j = ""
  
  if count_a+count_b >= (a+b):
    j = "No"
  
  elif i == "a":
    count_a += 1
    j = "Yes"
    
  elif i=="b":
    j = "Yes"
    
    if count_b >= b:
      j = "No"
    
    else:
      count_b += 1
      
  else:
    j = "No"
    
  print(j)

Submission status: Accepted

Solution code:
#n = 人数,a = 日本,b = 海外
n,a,b = map(int,input().split())
#s = 順位
s = list(input())
#k = 結果格納
k = []
j = a + b
c = 0
d = 0

for i in range(n):
    if s[i] == 'a':
        if c < j:
            c += 1
            k.append('Yes')
        else:
            k.append('No')
    elif s[i] == 'b':
        if c < j:
            if d < b:
                c += 1
                d += 1
                k.append('Yes')
            else:
                k.append('No')
        else:
            k.append('No')
    else:
        k.append('No')

for i in range(n):
    print(k[i])

Submission status: Accepted

Solution code:
N,A,B=map(int,input().split())
S=input()
pass_a=1
pass_b=1
for x in S:
  if x=="a":
    if pass_a<=A+B:
      print("Yes")
      pass_a+=1
    else:
      print("No")
  elif x=="b":
    if pass_a<=A+B and pass_b<=B:
      print("Yes")
      pass_a+=1
      pass_b+=1
    else:
      print("No")
  else:
    print("No")

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
S = input()
a = 0
b = 0
ans = "No"
for v, k in enumerate(S, 1):
    if k == "a":
        if a+b < A+B:
            print("Yes")
            a += 1
        else:
            print("No")
    elif k == "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 = list(map(int,input().split()))
S = input()
kokunai = 0
kaigai = 0
cnt = 0
for s in S:
    if s == "a":
        if cnt < A + B:
           print("Yes")
           cnt += 1
        else:
            print("No")
    
    elif s == "b":
        kaigai += 1
        if cnt < A + B and kaigai <= B:
            print("Yes")
            cnt += 1
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

ab = 0
b = 0

for i in s:
    res = "No"
    
    if i == "a":
        if ab < A+B:
            ab += 1
            res = "Yes"
            
    if i == "b":
        if ab < A+B and b < B:
            ab += 1
            b += 1
            res = "Yes"
            
    print(res)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-06-25 13:44:41 +0900
# LastModified: 2020-06-25 13:54:38 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    n, a, b = map(int, input().split())
    s = input()
    win = 0
    foreign = 0
    for i in range(n):
        if s[i] == 'a' and win < a+b:
            win += 1
            print("Yes")

        elif s[i] == 'b' and win < a+b and foreign < b:
            win += 1
            foreign += 1
            print("Yes")
        else:
            print("No")
            


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
S = input()
internal = 0
external = 0
res = []
for s in S:
    if s == 'a':
        internal += 1
        res.append('Yes')
    elif s == 'b':
        if external == B:
            res.append('No')
            continue
        external += 1
        res.append('Yes')
    else:
        res.append('No')
    if internal + external == A + B:
        break
res += ['No' for _ in range(N - len(res))]
print(*res, sep='\n')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, a, b = [int(w) for w in input().split()]
s = input()

n_li = [False] * n
pass_num = 0
b_rank = 0

for i, c in enumerate(s):
    if c == "a":
        if pass_num < a + b:
            n_li[i] = True
            pass_num += 1
    elif c == "b":
        b_rank += 1
        if pass_num < a + b and b_rank <= b:
            n_li[i] = True
            pass_num += 1


for t in n_li:
    print("Yes" if t else "No")

Submission status: Accepted

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

passing_count = 0
rank = 1
for s in S:
    if s in ["a", "b"]:
        if passing_count < A + B:
            if s == "a":
                print("Yes")
                passing_count += 1
                continue
            else:
                if rank <= B:
                    print("Yes")
                    passing_count += 1
                    rank += 1
                    continue
    print("No")

Submission status: Accepted

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

cnt = 0
oversea = 1
for s in S:
    #print(s)
    if s == "a":
        if cnt < a+b:
            print("Yes")
            cnt += 1
        else:
            print("No")
    if s == "b":
        if cnt < a+b and oversea <= b:
            print("Yes")
            cnt += 1
            oversea += 1
        else:
            print("No")
    if s == "c":
        print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x = input()
s = input()

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

p = 0
wp = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
Input = list(map(int,input().split()))
S = input()

N = Input[0]
A = Input[1]
B = Input[2]
Pass = 0
B_Pass = 0
for iter in range(N):
    if S[iter] == 'a' and Pass < A+B:
        Pass += 1
        print("Yes")
    elif S[iter] == 'b' and Pass < A+B and B_Pass < B:
        Pass += 1
        B_Pass += 1
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def main(n,a,b,s):
    kokunai=0
    kaigai=0
    for c in s:
        if c=='a':
            if kokunai+kaigai<a+b:
                print('Yes')
                kokunai+=1
            else:
                print('No')
        elif c=='b':
            if kokunai+kaigai<a+b and kaigai<b:
                print('Yes')
                kaigai+=1
            else:
                print('No')
        else:
            print('No')

if __name__=='__main__':
    n,a,b,s=readinput()
    main(n,a,b,s)

Submission status: Accepted

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