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

for s in S:
    if s == 'a' and A+B > 0:
        if A != 0:
            A -= 1
        else:
            B -= 1
        print('Yes')
    elif s == 'b' and B > 0:
        B -= 1
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

count = 0
b_count = 0
for s in S:
    if s == "a":
        if count < A + B:
            print("Yes")
            count += 1
            continue

    elif s == "b":
        if count < A + B and b_count < B:
            print("Yes")
            count += 1
            b_count += 1
            continue

    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,a,b = map(int, input().split())
s = list(str(input()))
count_all = 0
count_a = 0
count_b = 0
for person in s:
    if person == "a":
        if count_all < a+b:
            print("Yes")
            count_all += 1
        else:
            print("No")
    elif person == "b":
        if count_all < a+b and count_b < b:
            print("Yes")
            count_all += 1
            count_b += 1
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

N,A,B = inpl()
S = input()
tmp = 1
tmpf = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

passed = 0
oversea = 0
for s in S:
    if s == "a" and passed < A + B:
        passed += 1
        print("Yes")
        continue

    if s == "b" and passed < A + B and oversea < B:
        passed += 1
        oversea += 1
        print("Yes")
        continue

    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,A,B = map(int, input().split(" "))
S = list(input())
MAX = A + B
nowall = 0
nowfor = 0

for i in range(len(S)):
    if nowall >= MAX:
        print("No")
    elif S[i] == "a":
        nowall += 1
        print("Yes")
    elif S[i] == "b":
        if nowfor < B:
            nowall += 1
            nowfor += 1
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, A, B = list(map(int, input().split()))
S = input()
ans = [False for i in range(N)]
a_sum, b_sum = 0, 0
for i, S_i in enumerate(S):
    if S_i == 'a' and a_sum+b_sum < A+B:
        a_sum += 1
        ans[i] = True
    elif S_i == 'b' and a_sum+b_sum < A+B and b_sum < B:
        b_sum += 1
        ans[i] = True

for ans_i in ans:
    if ans_i:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

# CODE FESTIVAL 2016 qual A
# Problem B

if __name__ == '__main__':
    n, a, b = list(map(int, input().split()))
    s = input()
    a_count = 0
    b_count = 0
    a_b_count = 0

    for si in s:
        if (si == 'a') and (a_b_count < a + b):
            a_count += 1
            print('Yes')
        elif (si == 'b') and (a_b_count < a + b) and (b_count < b):
            b_count += 1
            print('Yes')
        else:
            print('No')

        a_b_count = a_count + b_count

Submission status: Accepted

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

qualifying = ['No' for _ in range(N)]
qualifying_total = 0
rank_oversea = 1

for i,h in enumerate(S):
  if h == 'a':
    if qualifying_total < A+B:
      qualifying[i] = 'Yes'
      qualifying_total += 1
  elif h == 'b':
    if qualifying_total < A+B and rank_oversea <= B:
      qualifying[i] = 'Yes'
      qualifying_total += 1
      rank_oversea += 1
ans = '\n'.join(qualifying)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
S = input()
winner = ''
winner_f = ''
for i in S:
    if i == 'a':
        if len(winner)<A+B:
            print('Yes')
            winner += 'a'
        else:
            print('No')
    elif i == 'b':
        if len(winner)<A+B and len(winner_f)<B:
            print('Yes')
            winner += 'b'
            winner_f += 'b'
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

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

s = input()

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

Submission status: Accepted

Solution code:
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

n = int(arr_data[0][0])
a = int(arr_data[0][1])
b = int(arr_data[0][2])

s = arr_data[1][0]
cnt = 0
cntb = 0

for v in s:
    
    chkflg = True
    
    if v == "c":
        
        chkflg = False
        
    elif v == "a":
                
        if cnt < a + b:
            
            cnt += 1
            
        else:
        
            chkflg = False
        
        
    elif v == "b":
        
        if cnt < a + b and cntb < b:
            
            cnt += 1
            cntb += 1
            
        else:
        
            chkflg = False
        
    print("Yes" if chkflg else "No")

Submission status: Accepted

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

plist = [False for i in range(N)]
p = 0
kp = 0
for i in range(N):
    if p>=A+B: break
    else:
        if S[i]=="a":
            p+=1
            plist[i] = True
        elif S[i]=="b" and kp<B:
            p+=1
            kp+=1
            plist[i] = True
            
for i in range(N):
    if plist[i]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
import sys


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

Submission status: Accepted

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

    AB = A+B
    n_passed = 0
    n_b = 0
    for s in S:
        passed = False
        if s == "a":
            if n_passed < AB:
                n_passed += 1
                passed = True
        elif s == "b":
            if n_passed < AB and n_b + 1 <= B:
                n_passed += 1
                n_b += 1
                passed = True
        
        if passed:
            print("Yes")
        else:
            print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N, A, B = map(int, input().split())
S = input()
nc = 0
bc = 1
for i in range(N):
    ans = False
    if S[i] == 'a' and nc < A + B:
        ans = True
        nc += 1
    elif S[i] == 'b' and nc < A + B and bc <= B:
        ans = True
        nc += 1
        bc += 1
    print('Yes' if (ans) else 'No')

Submission status: Accepted

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

p = 0
g = 0
for i in s:
    if i == 'a':
        if p < a + b:
            print 'Yes'
            p += 1
        else:
            print 'No'
    elif i == 'b':
        g += 1
        if p < a + b and g <= b:
            print 'Yes'
            p += 1
        else:
            print 'No'
    elif i == 'c':
        print 'No'
    else:
        print 'No'

Submission status: Accepted

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

count_dome = 0
count_fore = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-



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

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

for s in S:
    if s == 'a':
        if A > 0:
            print('Yes')
            A -= 1
        elif B > 0:
            print('Yes')
            B -= 1
        else:
            print('No')
    elif s == 'b':
        if B > 0:
            print('Yes')
            B -= 1
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve():
    N, A, B = list(map(int, input().split(" ")))
    S = list(input())
    pass_students = 0
    pass_foreigners = 0

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


solve()

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
gosa = 1.0 / 10**10
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    N,A,B = LI()
    s = S()
    a = b = 0
    r = []
    for c in s:
        if c == 'a' and a+b < A+B:
            r.append('Yes')
            a += 1
        elif c == 'b' and a+b < A+B and b<B:
            r.append('Yes')
            b += 1
        else:
            r.append('No')
    return '\n'.join(r)


print(main())

Submission status: Accepted

Solution code:
line = input().split()
N = int(line[0])
A = int(line[1])
B = int(line[2])
S = input()

ab = 0
bb = 0
for c in S:
    b = False
    if c == 'a' and ab < A + B:
        b = True
        ab += 1
    elif c == 'b' and ab < A + B and bb < B:
        b = True
        ab += 1
        bb += 1
    print("Yes" if b else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

winner=0
ab_winner=0
return_list=[]

for i in range(N):
    if S[i]=='a':
        if winner<A+B:
            return_list.append('Yes')
            winner+=1
        else:
            return_list.append('No')
            
    elif S[i]=='b':
        if winner<A+B:
            if ab_winner<B:
                return_list.append('Yes')
                winner+=1
                ab_winner+=1
            else:
                return_list.append('No')
        else:
            return_list.append('No')
    else:
        return_list.append('No')

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

Submission status: Accepted

Solution code:
NAB = map(int, raw_input().split())
N = NAB[0]
A = NAB[1]
B = NAB[2]
S = raw_input()
passed_student = 0
foreign_student_rank = 0

for n in range(0, N):
    if(S[n] == 'a'):
        if(A+B > passed_student):
            print 'Yes'
            passed_student = passed_student + 1
        else:
            print 'No'
    elif(S[n] == 'b'):
        foreign_student_rank = foreign_student_rank + 1
        if(A+B > passed_student):
            if(foreign_student_rank <= B):
                print 'Yes'
                passed_student = passed_student + 1
            else:
                print 'No'
        else:
            print 'No'
    else:
        print 'No'

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import os
import sys
import numpy as np


def dump(x):
    print >> sys.stderr, "{0}".format(x)

l = map(int, raw_input().split())
S = raw_input()
AB = l[1]+l[2]
B = l[2]
N = l[0]

count_array = [0]*2
pass_list = [0]*N
for i, s in enumerate(S):
    if count_array[0] >= AB:
        break

    if s == "a":
        count_array[0] += 1
        pass_list[i] = 1
    elif s == "b" and count_array[1] < B:
        count_array[0] += 1
        count_array[1] += 1
        pass_list[i] = 1

for pass_ in pass_list:
    if pass_ == 1:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
import bisect
import sys
import math
import itertools
sys.setrecursionlimit(10000)

INF = float('inf')

# input macro
def i():
    return int(raw_input())
def ii():
    return map(int,raw_input().split(" "))
def s():
    return raw_input()
def ss():
    return raw_input().split(" ")
def slist():
    return list(raw_input())
#

def join(s):
    return ''.join(s)

#iterate macro
def piter(n,m):
    return itertools.permutations(n,m)
def citer(n,m):
    return itertools.combinations(n,m)

#modulo macro
def modc(a,b,m):
    c = 1
    for i in xrange(b):
        c = c * (a - i) % m
        c = c * modinv(i + 1,m) % m
    return c
 
def gcd(a, b):
    (x, lastx) = (0, 1)
    (y, lasty) = (1, 0)
    while b != 0:
        q = a // b
        (a, b) = (b, a % b)
        (x, lastx) = (lastx - q * x, x)
        (y, lasty) = (lasty - q * y, y)
    return (lastx, lasty, a)
 
def modinv(a, m):
    (inv, q, gcd_val) = gcd(a, m)
    return inv % m

#bisect macro
def index(a, x):
    #Locate the leftmost value exactly equal to x
    i = bisect_left(a, x)
    if i != len(a) and a[i] == x:
        return i
    return -1

#memoize macro
def memoize(f):
    cache = {}
    def helper(*args):
        if args not in cache:
            cache[(args)] = f(*args)
        return cache[args]
    return helper

@memoize
def nck(a,b,m):
    b = min([a-b,b])
    if (b>a or b<0 or a<0):
        return 0
    elif a == 0:
        return 1
    return (nck(a-1,b-1,m)+nck(a-1,b,m)) % m

nh=zip([1,0,-1,0],[0,1,0,-1])

###########

n,a,b=ii()
c=a+b
s=slist()
ans=['' for j in range(n)]
ps=0
fr=0
for j in range(n):
    if s[j]=='a':
        if ps<c:
            ps+=1
            print "Yes"
        else:
            print "No"
    elif s[j]=='b':
        if ps<c and fr<b:
            ps+=1
            fr+=1
            print "Yes"
        else:
            print "No"
    else:
        print "No"

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding:utf-8 -*-

from __future__ import division, print_function, absolute_import, unicode_literals

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

cb = 0
c = A + B
cnt = 0
for index, s in enumerate(S, 1):
    if s == 'c':
        print("No")
        continue
    if s == 'a':
        if cnt < c:
            print("Yes")
            cnt += 1
        else:
            print("No")
    elif s == 'b':
        cb += 1
        if cnt < c and cb <= B:
            print("Yes")
            cnt += 1
        else:
            print("No")

Submission status: Accepted

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

foreign = 1
now = 0
for i in range(N):
    s = S[i]
    if s == 'a':
        if now < A + B:
            flg = True
        else:
            flg = False
    elif s == 'b':
        if now < A + B and foreign <= B:
            flg = True
        else:
            flg = False
        foreign += 1
    else:
        flg = False
    if flg:
        print("Yes")
        now += 1
    else:
        print("No")

Submission status: Accepted

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

passed_a, passed_b = 0, 0
for par in par_list:
    if (passed_a+passed_b) < (a+b):
        if par == 'a':
            passed_a += 1
            print('Yes')
        elif par == 'b' and passed_b < b:
            passed_b += 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

Solution code:
init_input=map(int, raw_input().split())

mem=raw_input()
mem_list=list(mem)

man=init_input[0]
jap=init_input[1]
ove=init_input[2]

jas=0
ovs=0

for i in range(man):
    if mem[i]=="a" and jas+ovs<jap+ove:
        jas+=1
        print "Yes"
    elif mem[i]=="b" and jas+ovs<jap+ove and ovs<ove:
        ovs+=1
        print "Yes"
    else:
        print "No"

Submission status: Accepted

Solution code:
data = list(map(int,input().split()))
N = data[0]
A = data[1]
B = data[2]
S = input()

passing = 0 

foreigner = 0 

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

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

    else:
        print("No")