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

passn = 0
passab = 0

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

Submission status: Accepted

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

Submission status: Accepted

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


def mi():
    return map(int, input().split())


def ii():
    return int(input())


N, A, B = mi()

S = input()
oversea = 0
passes = 0

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

Submission status: Accepted

Solution code:
n,a,b = [int(x) for x in input().split()]
s = input()
count = 0
b_count = 0
for st in s:
    if (st == 'a') & (count < (a+b)):
        count += 1
        print('Yes')
    elif (st == 'b') & (count < (a+b)) &(b_count < b):
        count += 1
        b_count += 1
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

pass_user_num = 0
f_pass_user_num = 0

for index, user in enumerate(S):
    if user == 'a' and pass_user_num < (A+B):
        print('Yes')
        pass_user_num += 1
    elif user == 'b' and pass_user_num < (A+B) and f_pass_user_num < B:
        print('Yes')
        pass_user_num += 1
        f_pass_user_num += 1
    else:
        print('No')

Submission status: Accepted

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

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N, A, B = map(int, readline().split())
S = readline().decode().rstrip()

cnt_A = 0
cnt_B = 0

for c in S:
    if c == 'c':
        print("No")

    elif c == 'a':
        if cnt_A + cnt_B < A + B:
            print("Yes")
            cnt_A += 1
        else:
            print("No")
    else:
        if (cnt_A + cnt_B < A + B) and (cnt_B + 1 <= B):
            print("Yes")
            cnt_B += 1

        else:
            print("No")

Submission status: Accepted

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

count = 0
abroadCount = 0

for c in S:
    result = False
    if c == "a":
        if count<A+B:
            result = True
            count+=1
    if c=="b":
        if count<A+B and abroadCount < B:
            result = True
            count+=1
            abroadCount +=1
    if result: print('Yes')
    else: print('No')

Submission status: Accepted

Solution code:
def resolve():
    N, A, B = map(int, input().split())
    S = input()
    Atmp = 0
    Btmp = 0
    ans = []
    my_append = ans.append
    for i in S:
        if i == 'a':
            if Atmp + Btmp < A+B:
                Atmp += 1
                my_append('Yes')
            else:
                my_append('No')
        elif i == 'b':
            if Btmp < B and Atmp + Btmp < A+B:
                Btmp += 1
                my_append('Yes')
            else:
                my_append('No')
        else:
            my_append('No')
    print("\n".join(ans))
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

cnt_a = 0
cnt_b = 0

for i in range(n):
    if s[i] == "a":
        if cnt_a + cnt_b < a + b:
            cnt_a += 1
            print("Yes")
        else:
            print("No")
    elif s[i] == "b":
        if cnt_a + cnt_b < a + b and cnt_b < b:
            cnt_b += 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
cb = 0
for s in S:
    if s == 'a':
        if c < A+B:
            print('Yes')
            c += 1
        else:
            print('No')
    if s == 'b':
        if c < A+B and cb < B:
            print('Yes')
            c += 1
            cb += 1
        else:
            print('No')
    if s == 'c':
        print('No')

Submission status: Accepted

Solution code:
n, a, b=map(int, input().split())
S=list(input())
tuuka=a+b
gaijin=b
for s in S:
  if s=="c":
    print("No")
  elif s=="a":
    if tuuka>0:
      tuuka-=1
      print("Yes")
    else:
      print("No")
  elif s=="b":
    if tuuka>0 and gaijin>0:
      gaijin-=1
      tuuka-=1
      print("Yes")
    else:
      print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

passed = 0
outer = 0

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

Submission status: Accepted

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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, A: int, B: int, S: str):
    ans = []
    passed = 0
    passed_b = calc_passed_b(S)
    for i, s in enumerate(S):
        if s == "a" and passed < A + B:
            # 国内学生の通過
            passed += 1
            ans.append("Yes")
            continue
        if s == "b" and passed < A + B:
            # 海外学生の通過
            if passed_b[i] <= B:
                passed += 1
                ans.append("Yes")
                continue

        ans.append("No")

    for a in ans:
        print(a)
    return


def calc_passed_b(S: str) -> "List[int]":
    pass_b = []
    passed = 0
    for s in S:
        if s == "b":
            passed += 1
        pass_b.append(passed)
    return pass_b


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, A, B, S)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
il = [int(k) for k in input().split()]
S = input()
N = il[0]
A = il[1]
B = il[2]

S = "z"+S

passed = 0
passed_oversea = 0

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

Submission status: Accepted

Solution code:
(n,an,bn) = list(map(int,input().split()))
s = list(input())
count = 1
foreign = 1
for i in s:

  if i=='a' and an+bn >= count:
    print('Yes')
    count += 1
  elif i=='b' and an+bn >= count and bn >= foreign:
    print('Yes')
    count += 1
    foreign += 1
  else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(len(s)):
    if s[i] == "a":
        if p < a+b:
            print("Yes")
            p += 1
            continue

    elif s[i] == "b":
        if p < a+b and o <= b:
            print("Yes")
            p += 1
            o += 1
            continue

    print("No")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

_pass = 0
_pass_foreign = 0
for i, v in enumerate(s):
    if _pass == a + b:
        print('No')
        continue
    if v == 'c':
        print('No')
    if v == 'a':
        print('Yes')
        _pass += 1
    if v == 'b':
        if _pass_foreign < b:
            print('Yes')
            _pass += 1
            _pass_foreign += 1
        else:
            print('No')

Submission status: Accepted

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

clears = 0
clears_foreigner = 0

for s in S:
    if s == "a" and clears < A + B:
        print("Yes")
        clears += 1
    elif s == "b" and clears < A + B and clears_foreigner < B:
        print("Yes")
        clears += 1
        clears_foreigner += 1
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def insr():
    s = input()
    return(list(s[:len(s)]))


def invr():
    return(map(int, input().split()))


n, a, b = invr()
S = insr()
os = 0
jp = 0
for s in S:
    if s == "a":
        if jp+os < a+b:
            jp += 1
            print("Yes")
        else:
            print("No")
    elif s == "b":
        if os+1 <= b and os+jp < a+b:
            os += 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

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

all = 0
b = 0

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

Submission status: Accepted

Solution code:
longs, x, y = map(int, input().split())
s_lst = [v for v in input()]

cnt = 0
b_cnt = 0
for i, s in enumerate(s_lst):
    if s == 'a' and cnt < x + y:
        s_lst[i] = 'Yes'
        cnt += 1

    elif s == 'b':
        b_cnt += 1
        if cnt < x + y and b_cnt <= y:
            s_lst[i] = 'Yes'
            cnt += 1
        else:
            s_lst[i] = 'No'
    else:
        s_lst[i] = 'No'
for v in s_lst:
    print(v)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

N, A, B = LI()
s = S()
kokunai = 0
kaigai = 0
for i in range(N):
    if s[i] == "a":
        if kokunai + kaigai < A + B:
            kokunai += 1
            print("Yes")
        else:
            print("No")
    elif s[i] == "b":
        if kokunai + kaigai < A + B and kaigai < B:
            kaigai += 1
            print("Yes")
        else:
            print("No")
    elif s[i] == "c":
        print("No")

Submission status: Accepted

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

cnt_all = 0
cnt_for = 0
ans = []
for i in range(n):
    c = "No"
    if s[i] == "a" and cnt_all < a + b:
        cnt_all += 1
        c = "Yes"
    if s[i] == "b" and cnt_all < a + b and cnt_for+1 <= b:
        cnt_for += 1
        cnt_all += 1
        c = "Yes"
    ans.append(c)
print("\n".join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

f_rank = 0
d_pass, f_pass = 0, 0
for s in S:
    if s == "b":
        f_rank += 1

    if s == "a" and d_pass + f_pass < A + B:
        print("Yes")
        d_pass += 1
    elif s == "b" and d_pass + f_pass < A + B and f_rank <= B:
        print("Yes")
        f_pass += 1
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - Qualification simulator
n, a, b = map(int, input().split())
passed_count = 0
oversea_rank= 0

for s in input():
	if s == 'a':
		if passed_count < a + b:
			print('Yes')
			passed_count += 1
		else:
			print('No')
	elif s == 'b':
		oversea_rank += 1
		
		if passed_count < a + b and oversea_rank <= b:
			print('Yes')
			passed_count += 1
		else:
			print('No')
	else:
		print('No')

Submission status: Accepted

Solution code:
def resolve():
    li = list(map(int,input().split()))
    N = int(li[0])
    A = int(li[1])
    anum = 0
    B = int(li[2])
    bnum = 0
    string = list(input())

    for i in range(N):
        if anum + bnum < A+B :
            if string[i] == "a":
                anum = anum + 1
                print("Yes")
            elif string[i] == "b" and bnum < B  :
                bnum = bnum + 1
                print("Yes")
            else:
                print("No")
        else:
            print("No") 
resolve()

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
from collections import defaultdict
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt_s = 0
cnt_b = 0

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

Submission status: Accepted

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

cntA = 0
cntB = 0

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

Submission status: Accepted

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

passed = 1
passed_foreigners = 1
for c in S:
    if passed > A + B or c == 'c':
        print('No')
    elif c == 'a':
        print('Yes')
        passed += 1
    else:
        if passed_foreigners <= B:
            print('Yes')
            passed += 1
            passed_foreigners += 1
        else:
            print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

x = input()
y = list(x)
count_a = 0
count_b = 0

for i in range(0, N):
    if (y[i] == "a"):
        if(count_a + count_b < (A + B)):
            print("Yes")
            count_a += 1
        else:
            print("No")
    
    elif(y[i] == "b"):
        if(count_a + count_b < (A + B) and count_b < B):
            print("Yes")
            count_b += 1
        else:
            print("No")
    
    elif(y[i] == "c"):
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,A,B=map(int,input().split())
S=input()
t_count=0
b_count=0
flag=None

for i in S:
  if i=="c":
    print("No")
  else:
    if i=="a":
      t_count+=1
      if t_count<=A+B:
        print("Yes")
      else:
        print("No")
    else:
      b_count+=1
      if b_count<=B:
        t_count+=1
        if t_count<=A+B:
          print("Yes")
        else:
          print("No")
      else:
        print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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 :
            count_a += 1
            print('Yes')

        else :
            print('No')
        
    if s[i] == 'b' :
        if count_a + count_b < a+b and count_b < b :
            count_b += 1
            print('Yes')

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

Submission status: Accepted

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

oversea = 0
c = [False for i in range(n)]
cnt = 0
for i in range(n):
	if s[i] == "a":
		if cnt < a+b:
			c[i] = True
			cnt += 1
	if s[i] == "b":
		if cnt < a+b and oversea < b:
			c[i] = True
			oversea += 1
			cnt += 1
for i in c:
	if i:
		print ("Yes")
	else:
		print ("No")

Submission status: Accepted

Solution code:
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:
            count_a += 1
            print('Yes')
        else:
            print('No')
            
    elif s[i] == 'b':
        if count_a + count_b < a + b and count_b < b:
            count_b += 1
            print('Yes')
        else:
            print('No')
    
    else:
        print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

#予選通過リスト
OK=0
b_OK=0

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
fcnt = 0
for i in range(N):
    s = S[i]
    if s == "c":
        print("No")
        continue
    if cnt < A + B:
        if s == "a":
            cnt += 1
            print("Yes")
        elif s == "b":
            fcnt += 1
            if fcnt <= B:
                cnt += 1
                print("Yes")
            else:
                print("No")
    else:
        print("No")