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: Wrong Answer

Solution code:
x = list(map(int, input().split()))
s = list(input())
y = len(s)
rank = 0
frank = 0

for i in  s:
    if i == "c":
        print("No")
        
    elif i == "b":
        if rank <= x[1] + x[2]:
            rank += 1
            if frank <= x[2]:
                frank += 1
                print("Yes")
            
            else:
                print("No")
            
        else:
            print("No")
            
    else:
            if rank <= x[1] + x[2]:
                rank += 1 
                print("Yes")
            
            else:
                print("No")

Submission status: Wrong Answer

Solution code:
x = list(map(int, input().split()))
s = list(input())
y = len(s)
rank = 0
frank = 0

for i in  s:
    if i == "c":
        print("NO")
        
    elif i == "b":
        if rank <= x[1] + x[2]:
            rank += 1
            if frank <= x[2]:
                frank += 1
                print("YES")
            
            else:
                print("NO")
            
        else:
            print("NO")
            
    else:
            if rank <= x[1] + x[2]:
                rank += 1 
                print("YES")
            
            else:
                print("NO")

Submission status: Wrong Answer

Solution code:
x = list(map(int, input().split()))
s = list(input())
y = len(s)
rank = 0
frank = 0

for i in  s:
    if i == "c":
        print("NO")
        
    elif i == "b":
        if rank <= x[1] + x[2] and frank <= x[2]:
            rank += 1
            frank += 1
            print("YES")
            
        else:
            print("NO")
            
    else:
            if rank <= x[1] + x[2]:
                rank += 1 
                print("YES")
            
            else:
                print("NO")

Submission status: Wrong Answer

Solution code:
x = list(map(int, input().split()))
s = list(input())
y = len(s)
rank = 0
frank = 0

for i in  s:
    if i == "c":
        print("NO")
        
    elif i == "b":
        if rank < x[1] + x[2] and frank < x[2]:
            rank += 1
            frank += 1
            print("YES")
            
        else:
            print("NO")
            
    else:
            if rank < x[1] + x[2]:
                rank += 1 
                print("YES")
            
            else:
                print("NO")

Submission status: Wrong Answer

Solution code:
x = list(map(int, input().split()))
s = list(input())
y = len(s)
rank = 0
frank = 0

for i in  s:
    if s == "c":
        print("NO")
        
    elif s == "b":
        if rank < x[1] + x[2] and frank < x[2]:
            rank += 1
            frank += 1
            print("YES")
            
        else:
            print("NO")
            
    else:
            if rank < x[1] + x[2]:
                rank += 1 
                print("YES")
            
            else:
                print("NO")

Submission status: Wrong Answer

Solution code:
x = list(map(int, input().split()))
s = list(input())
y = len(s)
rank = 0
frank = 0

for i in (0,y - 1):
    if s[i] == "c":
        print("NO")
        
    elif s[i] == "b":
        if rank < x[1] + x[2] and frank < x[2]:
            rank += 1
            frank += 1
            print("YES")
            
        else:
            print("NO")
            
    else:
            if rank < x[1] + x[2]:
                rank += 1 
                print("YES")
            
            else:
                print("NO")

Submission status: Wrong Answer

Solution code:
i = list(map(int,input().split()))
person = i[1] + i[2]
B = i[2]
rank = input()
passp = 0
bp = 0
for i,r in enumerate(rank):
	if r == "a" and passp < person:
		print("Yes")
		passp += 1
	elif r == "b":
		bp += 1
		if passp < person and bp <=B:
			print("Yes")
			passp += 1
	else:
		print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n,a,b = LI()
    s = input()
    su = sb = 0
    c = a+b
    for i in range(n):
        if su >= c:
            print("No")
            continue
        if s[i] == "a":
            su += 1
            print("Yes")
        elif s[i] == "b":
            if sb < b:
                su += 1
                sb += 1
                print("Yes")
            else:
                print("No")
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n,a,b = LI()
    s = input()
    su = sb = 0
    for i in range(n):
        if s[i] == "a":
            if su < a+b:
                su += 1
                print("Yes")
            else:
                print("No")
        else:
            if su < a+b and sb < b:
                su += 1
                sb += 1
                print("Yes")
            else:
                print("No")
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

tp=0
up=0

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

Submission status: Wrong Answer

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:
    print('Yes')
    a += 1
  elif s == 'b' and b < B:
    print('Yes')
    b += 1
  else:
    print('No')

Submission status: Wrong Answer

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

domestic = 0
abroad = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
s = input()
c = 0
bi = 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 bi <= b:
        print("Yes")
        bi += 1
        c += 1
    else:
        print("No")

Submission status: Wrong Answer

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")
            if rank_num>=A:
                rank_num += 1
                rank_b_num += 1
            else:
                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: Wrong Answer

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("Np")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
As = list(input().rstrip().split(" "))
N = int(As[0])
A = int(As[1])
B = int(As[2])
 
S  = input()
cnt = 1
 
for i in range(N):
    if S[i] == "c":
        print("No")
 
    elif S[i] == "a":
        if cnt < A+B:
            print("Yes")
            cnt +=1
        else:
            print("No")
    elif S[i] == "b":
        if cnt < B:
            print("Yes")
            cnt +=1
        else:
            print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
As = list(input().rstrip().split(" "))
N = int(As[0])
A = int(As[1])
B = int(As[2])
 
S  = input()
cnt = 1
 
for i in range(N):
    if S[i] == "c":
        print("No")
 
    elif S[i] == "a":
        if cnt <= A+B:
            print("Yes")
            cnt +=1
        else:
            print("No")
    elif S[i] == "b":
        if cnt <= B:
            print("Yes")
            cnt +=1
        else:
            print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
As = list(input().rstrip().split(" "))
N = int(As[0])
A = int(As[1])
B = int(As[2])
 
S  = input()
cnt = 0
 
for i in range(N):
    if S[i] == "c":
        print("No")
 
    elif S[i] == "a":
        if cnt <= A+B:
            print("Yes")
            cnt +=1
        else:
            print("No")
    elif S[i] == "b":
        if cnt <= B:
            print("Yes")
            cnt +=1
        else:
            print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
As = list(input().rstrip().split(" "))
N = int(As[0])
A = int(As[1])
B = int(As[2])
 
S  = input()
cnt = 0

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

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

Submission status: Wrong Answer

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" and b<B:
                print("Yes")
                Count+=1
                b+=1
            else:
                print("Yes")
                Count+=1
        else:
            print("No")
    else:
        print("No")

Submission status: Wrong Answer

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:
            ans[i] = "Yes"

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

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
s = input()
print(len(s))
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:
            ans[i] = "Yes"

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().split())
c=0
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: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
S = input()
a = 0
b = 0
for s in S:
    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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    b = 0
    N, A, B =LI()
    s = S()
    PASS = 0
    for i in range(N):
        if s[i] == "c":
            print("No")
            continue
        if PASS < A + B:
            if s[i] == "a":
                PASS += 1
                print("Yes")
            else:
                if b < B:
                    PASS += 1
                    b += 1
                    print("Yes")
                else:
                    print("No")
        else:
            print("No")
    print(PASS)

    return


#main
if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,a,b = map(int,input().split())
s = list(input())
A = 0 #国内の合格者
B = 0 #海外の合格者

for i in range(n):
    if s[i] == "c":
        print("No")
#        print("1")
    elif s[i] == "a" and (A + B) < a + b:
        print("Yes")
        A += 1
#        print("2")

    elif s[i] == "b" and (A + B) < a + b and B <= b:
        print("Yes")
        B += 1
#        print("3")

    else:
        print("No")
#        print("4")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in input():
        if i=="a":
                if allr<=a+b:
                        print("Yes")
                        allr += 1
                else: print("No")
        elif i=="b":
                if allr<a+b and abrr<=b:
                        print("Yes")
                        allr += 1
                else: print("No")
                abrr += 1
        else: print("No")

Submission status: Wrong Answer

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

for i in input():
        if i=="a":
                if allr<=a+b:
                        print("Yes")
                        allr += 1
                else: print("No")
        elif i=="b":
                if allr<a+b and abrr<=b:
                        print("Yes")
                        allr += 1
                        abrr += 1
                else: print("No")
        else: print("No")

Submission status: Wrong Answer

Solution code:
# - Qualification simulator
N, A,B = map(int, input().split())
S = input()
tmp = 0
tmp2 = 0

for i in range(N):
    if S[i] =="a":
        tmp += 1
    elif S[i] =="b":
        tmp2 += 1
    else:
        pass

    if S[i] =="a" and tmp <= A+B:
        print("Yes")
    elif S[i] =="b" and tmp <= A+B and tmp2 <= B:
        tmp += 1
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().split())
bs=1
x=[""]*n
s=input()
for k in range(n):
  if s[k]!="c":
    k<=a+b-1
    if s[k]=="a":
      x[k]="Yes"
    else:
      if bs<=b:
        bs+=1
        x[k]="Yes"
      else:
        x[k]="No"
  else:
    x[k]="No"
for k in x:
  print(k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def examA():
    S = SI(); N = len(S)
    T = "CODEFESTIVAL2016"
    ans = 0
    for i in range(N):
        if S[i]!=T[i]:
            ans +=1
    print(ans)
    return

def examB():
    N, A, B = LI()
    S = SI()
    d = defaultdict(int)
    for s in S:
        if s=="a":
            if d["a"]+d["b"]<A+B:
                print("YES")
                d[s] += 1
            else:
                print("NO")
        elif s=="b":
            if d["a"]+d["b"]<A+B and d["b"]<B:
                print("YES")
                d[s] += 1
            else:
                print("NO")
        else:
            print("NO")
    return

def examC():
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,ALPHABET, _ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 1e-9
alphabet = [chr(ord('a') + i) for i in range(26)]
ALPHABET = [chr(ord('A') + i) for i in range(26)]

if __name__ == '__main__':
    examB()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

C = A+B
P = [0]*N
for i in range(N):
  if S[i] == 'a' and C > 0:
    C -= 1
    P[i] = 1
  elif S[i] == 'b' and B > 0:
    C -= 1
    B -= 1
    P[i] = 1
for i in range(N):
  print('Yes' if P[i] else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

capacity = 0
f_capacity = 0

for c in s:
    if c == 'a':
        if capacity < a+b:
            capacity += 1
            print('YES')
        else:
            print('NO')
    elif c == 'b':
        if capacity < a+b and f_capacity < b:
            capacity += 1
            f_capacity += 1
            print('YES')
        else:
            print('NO')
    else:
        print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c = 0
d = 0

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




#%%

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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