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()
total_n = a + b
total_rank = 1
b_rank = 1
for i in range(n):
    if s[i] == "a":
        if total_rank <= total_n:
            print("Yes")
            total_rank += 1
        else:
            print("No")
    elif s[i] == "b":
        if total_rank <= total_n and b_rank <= b:
            print("Yes")
            total_rank += 1
            b_rank += 1
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ab = 0
b = 0
y = 'Yes'
n = 'No'

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

Submission status: Accepted

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

rankALL=1
rankb=1

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

Submission status: Accepted

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

a, b = 0, 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()

x = 1
y = 1
for i in range(len(S)):
    if S[i] == "a":
        if x <= a + b:
            print("Yes")
            x += 1
        else:
            print("No")
    elif S[i] == "b":
        if (x <= a + b) and (y <= b):
            print("Yes")
            x += 1
            y += 1
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

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

confirmed = 0
confirmedB = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# codefestival_2016_qualB_b.py
N,A,B = map(int,input().split())
S = input()
cnt = 0
bcnt = 0
for i,c in enumerate(S):
    if c =="a":
        if cnt < A+B:
            print("Yes")
            cnt +=1
        else:
            print("No")
    elif c=="b":
        if cnt < A+B and bcnt<B:
            print("Yes")
            cnt +=1
            bcnt +=1
        else:
            print("No")
    elif c=="c":
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

a = 0
b = 0

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

Submission status: Accepted

Solution code:
# Problem B -Qualification simulator

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

# initialization
rank_num = 0
rank_b_num = 0

# score roop
for s in S:
    if s=='a':
        if rank_num<A+B:
            print("Yes")
            rank_num += 1
        else:
            print("No")
    elif s=='c':
        print("No")
    elif s=='b':
        if rank_num<A+B and rank_b_num<B:
            print("Yes")
            rank_num += 1
            rank_b_num += 1
        else:
            print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = False

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

Submission status: Accepted

Solution code:
n,a,b = map(int,input().split())
s = list(input())
tuka = []
ab = []
for i in s:
    if len(tuka) < (a+b):
        if i=="a":
            tuka.append(i)
            print('Yes')
        elif i=="b":
            if len(ab)<b:
                ab.append(i)
                tuka.append(i)
                print('Yes')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

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

num = 0
num_b = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

jp = 0
os = 0
for s in S:
  ans = "No"
  if jp + os < A + B:
    if s == "a":
      jp += 1
      ans = "Yes"
    if s == "b" and os < B:
      os += 1
      ans = "Yes"
  print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

#cur_a = 0
cur_b = 0
cur = 0

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

Submission status: Accepted

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

for i in range(len(s)):
    tmp = s[i]
    if tmp == 'a':
        if count < a + b:
            print("Yes")
            count += 1
        else:
            print("No")
    elif tmp == 'b':
        if count < a + b and rank <= b:
            print("Yes")
            count += 1
            rank += 1
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

Solution code:
def solve():
    n,a,b = map(int,input().split())
    s = input()
    cnt_a=0
    cnt_b=0
    for i in s:
        if i=='a':
            if cnt_a<a+b:
                print('Yes')
                cnt_a+=1
            else:
                print('No')
        elif i=='b':
            if cnt_a<a+b and cnt_b<b:
                print('Yes')
                cnt_b+=1
                cnt_a+=1
            else:
                print('No')
        else:
            print('No')
if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import Counter

N, A, B = map(int, input().split())
S = input()
c = Counter(S)
#S = list(S.replace("c", ""))
if B > len(S):
    B = len(S)
if A + B > len(S):
    AB = len(S)
count = 0
countB = 0

for i in range(N):
    if count < A + B:
        if S[i]=="a":
            count += 1
            print("Yes")
        elif S[i] == "b" and countB < B:
            count += 1
            countB += 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_a = 0
cnt_b = 0
for i,moji in enumerate(S):
    if moji == "c":
        print("No")
    elif moji == "a":
        if cnt_a < A+B:
            print("Yes")
            cnt_a += 1
        else:
            print("No")
    else:
        if cnt_a < A+B and cnt_b < B:
            print("Yes")
            cnt_a += 1
            cnt_b += 1
        else:
            print("No")

Submission status: Accepted

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

for i in s:
    if i == 'a' :
        if cnt < a+b:
            cnt+=1
            print('Yes')
        elif cnt >= a+b:
            print('No')
    
    elif i == 'b':
        if cnt < a+b and cnt_b < b:
            cnt +=1
            cnt_b +=1
            print('Yes')
        elif cnt >= a+b or cnt_b >= b:
            print('No')
    
    elif i == 'c':
        print('No')

Submission status: Accepted

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

Count=0
b=0
for i in range(N):
    if Count<A+B:
        if S[i]!="c":
                if S[i]=="b":
                    if b<B:
                        print("Yes")
                        b+=1
                        Count+=1
                    else:
                        print("No")
                else:
                    print("Yes")
                    Count+=1
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    N, a, b = map(int, input().split())
    S = str(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 cnta + cntb < a + b and cntb < b:
                print('Yes')
                cntb+=1
            else:
                print('No')

        else:
            print('No')


resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,a,b = map(int,input().split())
s = list(input())
yosen = 0
gaikoku = 0
for i,si in enumerate(s):
    if si == 'a':
        if yosen < a+b:
            print('Yes')
            yosen += 1
        else:
            print('No')
    elif si == 'b':
        if yosen < a+b and gaikoku <b:
            print('Yes')
            yosen += 1
            gaikoku += 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
for i in s:
  if i == 'a' and a+b < A+B:
    print('Yes')
    a += 1
  elif i == 'b' and a+b < A+B and b  < B:
    print('Yes')
    b += 1
  else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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


count = 0
f = 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 f < b:
            print('Yes')
            count += 1
            f += 1
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

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

total_cnt = 0
b_cnt = 0
ans = ["No"]*n

for i in range(n):
    if total_cnt >= a+b:
        break
    if s[i] == "c":
        continue
    if s[i] == "a":
        total_cnt += 1
        ans[i] = "Yes"
    if s[i] == "b":
        b_cnt += 1
        if b_cnt <= b:
            total_cnt += 1
            ans[i] = "Yes"

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

Submission status: Accepted

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

qualified = 0
qualified_foreign = 0.
for s in S:
    if s == 'c':
        print('No')
    elif s == 'a':
        if qualified < A + B:
            print('Yes')
            qualified += 1
        else:
            print('No')
    else:
        if (qualified < A + B) & (qualified_foreign < B):
            print('Yes')
            qualified += 1
            qualified_foreign += 1
        else:
            print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
S = input()
for x in S:
    # print(x)
    if x == "a" and A + B > 0:
        if A > 0:
            A -= 1
            print("Yes")
        else:
            B -= 1
            print("Yes")
    elif x == "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 = input()

count_b = 0
count_total = 0
ans = ["No"] * N

for i in range(N):
    if count_total >= A+B:
        break

    if S[i] == "c":
        continue
    if S[i] == "a":
        count_total += 1
        ans[i] = "Yes"
    if S[i] == "b":
        count_b += 1
        if count_b <= B:
            count_total += 1
            ans[i] = "Yes"
    

for i in range(N):
    print(ans[i])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def myAnswer(A: int, B: int, S: list) -> None:
    counter = 0
    foreignStu = 1
    for i, s in enumerate(S):
        if(s == 'a' and counter < (A + B)): #国内の学生で、カウンタの値が(A+B)未満なら通過
            print("Yes")
            counter += 1#カウンタの値を更新
        elif(s == 'b' and counter < (A + B) and foreignStu <= B): #海外の学生で、カウンタの値が(A+B)未満かつ海外学生の順位がB以下なら通過
            print("Yes")
            counter += 1
            foreignStu += 1
        else:
            print("No")


def main():
    N, A, B = map(int, input().split())
    S = list(input())
    myAnswer(A, B, S)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,a,b = map(int,input().split())
s = input()
cnt = 0
ovs = 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":
        if cnt < a+b and ovs < b:
            print("Yes")
            cnt +=1
            ovs += 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

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