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:
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


# a^n
def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod


# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a

# Union Find
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# 約数生成
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors


inf = 10 ** 18
mod = 10 ** 9 + 7

n,a,b = lr()
s = sr()
ret = a+b
reto = b
for c in s:
    if c == 'a' and ret > 0:
        print('Yes')
        ret-=1
    elif c == 'b' and ret > 0 and reto > 0:
        print('Yes')
        ret-=1
        reto-=1
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

border = a + b
i, j = 1, 1
for p in s:
    flag = False
    if p == "a":
        if i <= a + b:
            flag = True
            i += 1
    elif p == "b":
        if i <= a + b and j <= b:
            flag = True
            i += 1
            j += 1
    if flag:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

accepted = 0
B_checked = 0

for i in range(len(s)):
    if s[i] == "c":
        print("No")
    elif s[i] == "a":
        accepted += 1
        print("Yes")
    else:
        B_checked += 1
        if (B_checked <= B):
            accepted += 1
            print("Yes")
        else:
            print("No")

    if (accepted >= (A + B)):
        for i in range(len(s) - i - 1):
            print("No")

        break

Submission status: Accepted

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

clear = 0

ab = A + B
b = 0

for obj in s:
    if clear < ab:
        if obj == "a":
            print("Yes")
            clear += 1
        elif obj == "b" and b < B:
            print("Yes")
            clear += 1
            b += 1
        else:
            print("No")

    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Fore_rank = 1
passed = 0

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

Submission status: Accepted

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

# from numba import njit

# from collections import Counter
# from itertools import accumulate
# import numpy as np
# from heapq import heappop,heappush
# from bisect import bisect_left

# @njit
def solve(n,a,b,s):
  ans = [""]*n
  japaneseStudents = 0
  foreignStudents = 0
  for i in range(n):
    if s[i] == "a" and japaneseStudents + foreignStudents < a+b:
      ans[i] = "Yes"
      japaneseStudents += 1
    elif s[i] == "b" and japaneseStudents + foreignStudents < a+b and foreignStudents < b:
      ans[i] = "Yes"
      foreignStudents += 1
    else:
      ans[i] = "No"
  return ans



def main():
  N,A,B = map(int,input().split())
  s = input()
  ans = solve(N,A,B,s)
  for i in range(N):
    print(ans[i])
  return

if __name__ == '__main__':
  main()

Submission status: Accepted

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

countA = 0
countB = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

x = 0 # 予選の通過人数
b = 1 # 海外勢の予選の通過人数

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

Submission status: Accepted

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

winners = []
foreign_winners = [0 for _ in range(len(s))]
winner_count = 0

foreign_score = 1
for i, c in enumerate(s):
  if c == 'b':
    foreign_winners[i] = foreign_score
    foreign_score += 1

for i, c in enumerate(s):
  if c == 'a':
    if winner_count < a+b:
      winners.append("Yes")
      winner_count += 1
    else:
      winners.append("No")
  elif c == 'b':
    if winner_count < a+b and foreign_winners[i] <= b:
      winners.append("Yes")
      winner_count += 1
    else:
      winners.append("No")
  else:
    winners.append("No")

for l in winners:
  print(l)

Submission status: Accepted

Solution code:
import math


def resolve():
    import sys
    input = sys.stdin.readline
    row1 = [int(x) for x in input().rstrip().split(" ")]
    # row2 = [int(x) for x in input().rstrip().split(" ")]
    s = input().rstrip()

    n = row1[0]
    a = row1[1]
    b = row1[2]

    kokunai = 0
    kaigai = 0
    for char in s:
        if char == "a":
            if(kaigai + kokunai < a + b):
                print("Yes")
                kokunai += 1
                continue

        elif char == "b":
            if((kaigai + kokunai < a + b) and (kaigai < b)):
                print("Yes")
                kaigai += 1
                continue
        print("No")








if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

check = 0
b_check = 0


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

Submission status: Accepted

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

cnt = 0
oversea = 0

for each in s:
    if each == 'a' and cnt < a + b:
        print('Yes')
        cnt += 1
        continue
    if each == 'b' and cnt < a + b and oversea < b:
        print('Yes')
        cnt += 1
        oversea += 1
        continue
    else:
        print('No')

Submission status: Accepted

Solution code:
def solve():
    N, A, B = [int(x) for x in input().split()]
    S = input()
    a, b = 0, 0
    Ans = ['No'] * N
    for i in range(N):
        s = S[i]
        if s == 'c':
            continue
        if s == 'a':
            if a + b < A + B:
                Ans[i] = 'Yes'
                a += 1
        if s == 'b':
            if a + b < A + B and b < B:
                Ans[i] = 'Yes'
                b += 1
    for ans in Ans:
        print(ans)


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

result = []
cnt = 0
cnt_b = 0
limit = a + b

for student in s:
    if student == "c":
        result.append("No")
    elif (student == "a") & (cnt < limit):
        result.append("Yes")
        cnt += 1
    elif (student == "b") & (cnt < limit) & (cnt_b < b):
        result.append("Yes")
        cnt += 1
        cnt_b += 1
    else:
        result.append("No")
print("\n".join(result))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(map(int,input().split()))#array = list(map(int, input().strip().split()))
job = list(input())

AB = N[1] + N[2]
x = 0
y = 0

for i in range(N[0] ):
    if job[i] == "a":
        if x < AB:
            x += 1
            print("Yes")
        else:
            print("No")
    
    elif job[i] == "b":
        if x < AB and y < N[2]:
            x += 1
            y += 1
            print("Yes")
        else:
            print("No")
            
    elif job[i] == "c":
        print("No")

Submission status: Accepted

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

p = 0
q = 0

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

Submission status: Accepted

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

ac_count = 0
ac_b_count = 0
for s in S:
    if ac_count < A + B:
        if s == 'a':
            print('Yes')
            ac_count += 1

        elif s == 'b' and ac_b_count < B:
            print('Yes')
            ac_count += 1
            ac_b_count += 1

        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

p = 0
p_b = 0
for i, x in enumerate(S):
    if x == 'a':
        if p < A + B:
            p += 1
            print("Yes")
        else:
            print("No")
    elif x == 'b':
        p_b += 1
        if p < A + B and p_b <= B:
            p += 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n, a, b = map(int, input().split())
s = input()

cl = 0
clmax = a + b
wlrank = 0

for i in s:
    if i == "a":
        if cl < clmax:
            print("Yes")
            cl += 1
        else:
            print("No")

    elif i == "b":
        if cl < clmax:
            if wlrank < b:
                print("Yes")
                cl += 1
                wlrank += 1
            else:
                print("No")
        else:
            print("No") 
    else:
        print("No")

Submission status: Accepted

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

kaigai = 0
total = 0
for s in students:
    if s == "a":
        if total < A+B:
            print("Yes")
            total += 1
        else:
            print("No")
    elif s == "b":
        if total < A+B and kaigai < B:
            print("Yes")
            kaigai += 1
            total += 1
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, A, B = map(int,input().split())
S = input()
x = 0
y = 0
z = x + y

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

Submission status: Accepted

Solution code:
def main():
    import sys
    def input(): return sys.stdin.readline().rstrip()
    n, a, b = map(int, input().split())
    s = input()
    for ch in s:
        ans = 'Yes'
        if ch == 'c':
            ans = 'No'
        elif ch == 'a':
            if a > 0:
                a -=1
            elif b > 0:
                b -= 1
            else:
                ans = 'No'
        else:
            if b > 0:
                b -= 1
            else:
                ans = 'No'
        print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

passed_num = 0
limit = A + B
ranking_foreign = 1

results = []

for examinee in S:
    if passed_num < limit:
        if examinee == 'a':
            passed_num += 1
            results.append('Yes')
        elif examinee == 'b':
            if ranking_foreign <= B:
                passed_num += 1
                ranking_foreign += 1
                results.append('Yes')
            else:
                results.append('No')
        elif examinee == 'c':
            results.append('No')
    else:
        results.append('No')

for result in results:
    print(result)

Submission status: Accepted

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

for e in ans:
  print(e)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n, a, b = map(int, input().split())
s = list(input())

cnt_a = 0
cnt_b = 0

for p in s:
    if p == 'a':
        if (cnt_a+cnt_b) < (a+b):
            print('Yes')
            cnt_a += 1
        else:
            print('No')
    elif p == 'b':
        if (cnt_a+cnt_b) < (a+b) and cnt_b < b:
            print('Yes')
            cnt_b += 1
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
s=input()
passed=0
oversea=0
yep=False
cnt=0
for i in range(n):
    if s[i]=="c":
        print("No")
    elif s[i]=="a":
        if passed<(a+b):
            print("Yes")
            passed+=1
        else:
            print("No")
    else:
        if oversea<b and passed<(a+b):
            print("Yes")
            passed+=1
            oversea+=1
        else:
            print("No")
#     if passed>=(a+b):
#         yep=True
#         cnt=len(s)-(i+1)
#         break
# if yep:
#     for i in range(cnt):
#         print("No")

Submission status: Accepted

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

cnt = 0
cnt_abroad = 0

for s in S:
  if A + B <= cnt:
    print("No")
    continue
  if s == "c":
    print("No")
    continue
  if s == "a":
    cnt += 1
    print("Yes")
    continue
  if s == "b":
    if B <= cnt_abroad:
      print("No")
      continue
    cnt += 1
    cnt_abroad += 1
    print("Yes")
    continue

Submission status: Accepted

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

a_pass = 0
b_pass = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
S = input()
n_passed = 0
n_passed_abroad = 1
for i, s in enumerate(S):
  res = "No"
  if s == 'a':
    if n_passed < A+B:
      res = "Yes"
      n_passed += 1
  elif s == 'b':
    if (n_passed < A+B) and (n_passed_abroad <= B):
      res = "Yes"
      n_passed += 1
      n_passed_abroad += 1

  print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for v in s:
    if v == 'a' and c_a < a+b:
        c_a += 1
        print('Yes')
    elif v == 'b' and c_a < a+b and c_b < b:
        c_a += 1
        c_b += 1
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

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

S = input()

total = 0
abroad = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def main():
    N, A, B = map(int, input().split())
    S = input()
    kakutei = 0
    kaigai_rank = 1
    check = False
    for s in S:
        if kakutei < A+B:
            if s == 'a':
                kakutei += 1
                print('Yes')
            elif s == 'b':
                if kaigai_rank <= B:
                    kaigai_rank += 1
                    kakutei += 1
                    print('Yes')
                else:
                    check = True
                    print('No')
            elif s == 'c':
                print('No')
            # print('kakutei: ' + str(kakutei))
            # print('rank: ' + str(kaigai_rank))
        else:
            print('No')
            
if __name__ == '__main__':
    main()

# No
# Yes
# Yes
# Yes
# Yes
# No
# Yes
# Yes
# No
# Yes
# No
# No

Submission status: Accepted

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

pass_num = 0
pass_fo = 0

for i in S:
    if i == 'a':
        if (A + B)-1 >= pass_num:
            print('Yes')
            pass_num += 1
        else:
            print('No')
    elif i == 'b':
        if ((A+B-1) >= pass_num)and(pass_fo <= B-1):
            print('Yes')
            pass_num += 1
            pass_fo += 1
        else:
            print('No')
    else:# i == 'c'
        print('No')

Submission status: Accepted

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