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 = list(input())

A_sum = 0
B_sum = 0

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

Submission status: Accepted

Solution code:
l = input().split()
s = input()
 
n = int(l[0])
a = int(l[1])
b = int(l[2])
 
count = 0
countt = 0
for i in s:
    if i == 'a':
        if count < a+b:
            count = count + 1
            print('Yes')
        else:
            print('No')
    if i == 'b':
        if (count < a+b) and (countt < b):
            count = count + 1
            countt = countt + 1
            print('Yes')
        else:
            print('No')
    if i == 'c':
        print('No')

Submission status: Accepted

Solution code:
# coding: utf-8
# Here your code /
N, A, B = map(int, input().split())
S = input()
through = 0
oversee_thr = 0
for i in range(N):
    if S[i] == "c":
        if i + 1 == N:
            print("No", end="")
        else:
            print("No")
    elif S[i] == "a":
        if through < A + B:
            if i + 1 == N:
                print("Yes", end="")
            else:
                print("Yes")
                through += 1
        else:
            if i + 1 == N:
                print("No", end="")
            else:
                print("No")
    elif S[i] == "b":
        if through < A + B and oversee_thr < B:
            if i + 1 == N:
                print("Yes", end="")
            else:
                print("Yes")
                through += 1
                oversee_thr += 1
        else:
            if i + 1 == N:
                print("No", end="")
            else:
                print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N, A, B = (map(int, input().split(' ')))
S = input()
Nc = 0
Ac = 0
Bc = 0

for s in S:
    if s is 'a':
        Ac += 1
        if Ac+Bc <= A+B:
            print('Yes')
        else:
            print('No')
            Ac -= 1

    elif s is 'b':
        Bc += 1
        if Ac+Bc <= A+B and Bc <= B:
            print('Yes')
        else:
            print('No')
            Bc -= 1
    else:
        print('No')

Submission status: Accepted

Solution code:
nums = list(map(int, input().split()))
s=input()
#print(nums[0], nums[1], nums[2])
#print(s)
N=nums[0]
A=nums[1]
B=nums[2]
cA=0
cB=0
for i in range(N):
	if(s[i:i+1] == "a"):
#		print(s[i:i+1])
		if((cA+cB)<(A+B)):
			print("Yes")
			cA+=1
		else:
			print("No")
	elif(s[i:i+1]=="b"):
#		print(s[i:i+1])
		if((cA+cB)<(A+B)):
			if(cB<B):
				print("Yes")
				cB+=1
			else:
				print("No")
		else:
			print("No")	
		
	elif(s[i:i+1]=="c"):
		print("No")

Submission status: Accepted

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

count = 0
abroad = 0
for i in range(len(s)):
    if s[i] == 'a' and (A+B) > count:
        count += 1
        print('Yes')
    elif s[i] == 'b':
        abroad += 1
        if (A+B)  > count and B >= abroad:
            count += 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
s = str(input())
i = 0
ab = a + b
pas, bn = 0, 0
while i < n:
    if (s[i] == 'a' and pas < ab):
        print('Yes')
        pas += 1
    elif (s[i] == 'b' and pas < ab and bn < b):
        print('Yes')
        pas += 1
        bn += 1
    else:
        print('No')
    i += 1

Submission status: Accepted

Solution code:
def string_trnase(N, A, B, s):
    passed = 0
    oversea = 0
    for i in range(0, len(s)):
        if passed == A + B:
            print('No')
        elif s[i] == 'c':
            print('No')
            continue
        elif s[i] == 'a':
            if passed < A+B:
                print('Yes')
                passed += 1
        elif s[i] == 'b':
            if passed < A+B and oversea < B:
                print('Yes')
                passed += 1
                oversea += 1
            else:
                print('No')
        else:
            print('No')



nums = input()
N = int(nums.split(' ')[0])
A = int(nums.split(' ')[1])
B = int(nums.split(' ')[2])
string_trnase(N, A, B, input())

Submission status: Accepted

Solution code:
#! python3


n,a,b = input().split(' ')
s = input()

n = int(n)
a = int(a)
b = int(b)

rF = 0
ok = 0

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

Submission status: Accepted

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

stdin = raw_input()
strs = stdin.split()
N = int(strs[0])
A = int(strs[1])
B = int(strs[2])
stdin2 = raw_input()

winners = 1
f_order = 1
for s in stdin2:
    if s == 'a':
        if winners <= A + B:
          print 'Yes'
          winners = winners + 1
        else:
          print 'No'
    elif s =='b':
        if winners <= A + B and f_order <= B:
          print 'Yes'
          winners = winners + 1
        else:
          print 'No'
        f_order = f_order + 1
    else:
          print 'No'

Submission status: Accepted

Solution code:
inputs = input().split()

N = int(inputs[0]) # number of participants
A = int(inputs[1])
B = int(inputs[2])

S = input()

# a = Japanese student
# b = overseas student
# c = other (not eligible)


num_passes = 0
num_jap_students = 0
num_overseas_students = 0
num_ineligible = 0

for rank in range(N):
    curr = S[rank]
    if curr == 'c':
        print('No')
        num_ineligible += 1
        continue
    if curr == 'a': 
        if num_passes < A + B: # Japanese student passes if ...
            print('Yes')
            num_passes += 1
        else:
            print('No')
        num_jap_students += 1
    elif curr == 'b':
        
        if num_passes < A + B and num_overseas_students + 1 <= B:
            print('Yes')
            num_passes += 1
        else:
            print('No')
        num_overseas_students += 1

Submission status: Accepted

Solution code:
# def makelist(n, m):
# 	return [[0 for i in range(m)] for j in range(n)]

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


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

yes = "Yes"
no = "No"

nai = 0
gai = 0
for c in s:
	if c == 'a':
		if nai + gai < A + B:
			print(yes)
			nai += 1
		else:
			print(no)
	elif c == 'b':
		if nai + gai < A + B and gai < B:
			print(yes)
			gai += 1
		else:
			print(no)
	else:
		print(no)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
N,A,B=map(int,input().split())
S=str(input())
ac=0
bc=0
for i in range(N):
    if S[i]=='c':
        print('No')
    elif S[i]=='a':

        if ac+bc <A+B:
            ac +=1
            print('Yes')
        else:
            print('No')
    else:

        if bc<B and ac+bc<A+B:
            print('Yes')
            bc += 1
        else:
            print('No')

Submission status: Accepted

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

num_passed = 0
num_passed_overseas = 0

for student in attrs:
    if student == 'a':
        if num_passed < a + b:
            print('Yes')
            num_passed += 1
        else:
            print('No')
    elif student == 'b':
        if num_passed < a + b and num_passed_overseas < b:
            print('Yes')
            num_passed += 1
            num_passed_overseas += 1
        else:
            print('No')
    elif student == 'c':
        print('No')

Submission status: Accepted

Solution code:
N, A, B = map(int, raw_input().split())
S = raw_input()
acc_b = 0
acc_t = 0
for x in range(N):
    app = S[x]
    under = (acc_t < (A + B))
    if app == "a" and under:
        print "Yes"
        acc_t += 1
    elif app == "b" and acc_b < B and under:
        print "Yes"
        acc_t += 1
        acc_b += 1
    else:
        print "No"

Submission status: Accepted

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

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

Submission status: Accepted

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

A, B = int(A), int(B)
count1 = 0
count2 = 1
for s in rank:
    if (s == 'a') and (count1 < A+B):
        print("Yes")
        count1 += 1
    elif (s == 'b') and (count1 < A+B) and (count2 < B+1):
        print("Yes")
        count1 += 1
        count2 += 1
    else:
        print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# !/usr/bin/env python
# vim: set fileencoding=utf-8 :

"""
#
# Author:   Noname
# URL:      https://github.com/pettan0818
# License:  MIT License
# Created:  2016-10-10
#

# Usage
#
"""

def read_value():
    first_line = input()
    status = first_line.split(" ")

    num_of_contestant = int(status[0])
    basis = int(status[1])
    oversea_limit = int(status[2])

    second_line = input()
    rank_str = second_line

    return [num_of_contestant, basis, oversea_limit, rank_str]


def check_japan(rank, basis, oversea_limit):
    if rank < basis + oversea_limit:
        return "Yes"
    else:
        return "No"

def check_overseas(rank, oversea_rank, basis, oversea_limit):
    if rank < basis + oversea_limit and oversea_rank <= oversea_limit:
        return "Yes"
    else:
        return "No"


if __name__ == "__main__":
    input_items = read_value()

    basis = input_items[1]
    oversea_limit = input_items[2]
    rank_str = input_items[3]

    oversea_rank = 0
    passed = 0

    for rank, type in enumerate(rank_str):
        if type == "a":
            if check_japan(passed, basis, oversea_limit) == "Yes":
                print("Yes")
                passed += 1
            else:
                print("No")

        if type == "b":
            oversea_rank += 1
            if check_overseas(passed, oversea_rank, basis, oversea_limit) == "Yes":
                print("Yes")
                passed += 1
            else:
                print("No")

        if type == "c":
            print("No")

Submission status: Accepted

Solution code:
N, A, B = map(int, raw_input().split())
S = raw_input()
pass_conf = []
abroad = []
for s in S:
    if s == 'c':
        print 'No'
        continue
    if len(pass_conf) < A+B:
        if s == 'a':
            pass_conf.append(s)
            print 'Yes'
        elif s == 'b':
            if len(abroad) < B:
                pass_conf.append(s)
                abroad.append(s)
                print 'Yes'
            else:
                print 'No'
        else:
            print 'No'
    else:
        print 'No'

Submission status: Accepted

Solution code:
data=map(int,raw_input().split())
l=raw_input()
rank=0
ran=0
for i in range(len(l)):
    if(l[i]=="a" and ran<data[1]+data[2]):
        print "Yes"
        ran+=1
    elif(l[i]=="b" and ran<data[1]+data[2] and rank<data[2]):
        print "Yes"
        rank+=1
        ran+=1
    else:
        print "No"

Submission status: Accepted

Solution code:
#coding=utf-8

_, a, b = map(lambda s:int(s), raw_input().split())
ss = raw_input()

addmission_a = 0
addmission_b = 0

for s in ss:
    if s == 'a':
        if addmission_a + addmission_b < a + b:
            print "Yes"
            addmission_a += 1
        else:
            print "No"

    if s == 'b':
        if addmission_a + addmission_b < a + b and addmission_b < b:
            print "Yes"
            addmission_b += 1
        else:
            print "No"

    if s == 'c':
        print "No"

Submission status: Accepted

Solution code:
N, a, b = map(int, raw_input().split())
S = raw_input()
count = 0
count_b = 1
max = a + b

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
input_line_1 = raw_input()
fields = input_line_1.split()
N = int(fields[0])
A = int(fields[1])
B = int(fields[2])
T = A + B
all = raw_input()
for every in all:
	if every == 'c':
		print 'No'
	elif every == 'a':
		if T > 0:
			T = T - 1
			print 'Yes'
		else:
			print 'No'
	else:
		if T > 0 and B > 0:
			T = T - 1
			B = B - 1
			print 'Yes'
		else:
			print 'No'

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, a, b = map(int, raw_input().split())
s = raw_input()
ac = 0
bc = 0
for v in s:
    if v == 'a' and ac + bc < a + b:
        ac += 1
        print "Yes"
    elif v == 'b' and ac + bc < a + b and bc < b:
        bc += 1
        print "Yes"
    else:
        print "No"

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys 
import sys 

N,A,B = map(int,sys.stdin.readline().split())
S = sys.stdin.readline().strip()
passCount = 0 
overseasRank = 0 
i = 0 
while i < len(S):
    c = S[i]
    if c == 'a':
        if passCount < A+B:
            print 'Yes'
            passCount += 1
        else:
            print 'No'
    if c == 'b':
        overseasRank += 1
        if passCount < A+B:
            if overseasRank <= B:                                                                                                                                                                                                     
                print 'Yes'
                passCount += 1
            else:
                print 'No'
        else:
            print 'No'
    if c == 'c':
        print 'No'

    i += 1

Submission status: Accepted

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

    flag = 0
    m = A+B
    counter = 0
    f_counter = 0
    for i in range(len(S)):
        if S[i] == "a" and (counter+1)<=m:
            counter += 1
            print("Yes")
        elif S[i] == "b" and (counter+1<=m and f_counter+1 <= B):
            counter+=1
            f_counter += 1
            print("Yes")
        else:
            print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Ap = 0
Bp = 0
n = 0

while True:
    if S[n]=='a':
        if (Ap+Bp) < (A+B):
            print('Yes')
            Ap = Ap + 1
        else:
            print('No')
    if S[n]=='b':
        if ((Ap+Bp) < (A+B)) and Bp < B:
            print('Yes')
            Bp = Bp + 1
        else:
            print('No')
    if S[n]=='c':
        print ('No')
    n = n + 1
    
    if n == N:
        break

Submission status: Accepted

Solution code:
I = [int(e) for e in raw_input().split(' ')]
N = I[0]
A = I[1]
B = I[2]
S = raw_input()

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

Submission status: Accepted

Solution code:
raw_condition = raw_input()
result_line = raw_input()

N = int(raw_condition.split(" ")[0])
A = int(raw_condition.split(" ")[1])
B = int(raw_condition.split(" ")[2])

current_num = 0
international_ranking = 0
for result in result_line:
    if result == 'a':
        if current_num < A+B:
            current_num += 1
            print "Yes"
        else:
            print "No"
    elif result == 'b':
        if current_num < A+B and international_ranking < B:
            current_num += 1
            international_ranking += 1
            print "Yes"
        else:
            print "No"
    else:
        print "No"

Submission status: Accepted

Solution code:
import sys

N, A, B = map(int, sys.stdin.readline().split())
S = sys.stdin.readline()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
arg1 = input().split()
arg2 = input()
N = arg1[0]
A = arg1[1]
B = arg1[2]
C = int(A) + int(B)
passed = 0
passed_f = 0
for i,s in enumerate(arg2):
    if s == 'a':
        if passed < C:
            passed += 1
            print('Yes')
            continue
    elif s == 'b':
        if passed < C and passed_f < int(B):
            passed += 1
            passed_f += 1
            print('Yes')
            continue
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

aa = 0
bb = 0
ans = []
for i in range(len(s)):
  if s[i] != "c":
    if s[i] == "a":
      if aa+bb < a+b:
        aa += 1
        ans.append("Yes")
      else:
        ans.append("No")

    if s[i] == "b":
      if aa+bb < a+b and bb < b:
        bb += 1
        ans.append("Yes")
      else:
        ans.append("No")
  else:
    ans.append("No")
for i in ans:
  print i

Submission status: Accepted

Solution code:
[N,A,B]=[int(x) for x in raw_input().split()]
L=raw_input()
Kok=0
Out=0
for c in L:
    if c=='a':
        if Kok+Out<A+B:
            print 'Yes'
            Kok+=1
        else:
            print 'No'
    elif c=='b':
        if Kok+Out<A+B and Out<B:
            print 'Yes'
            Out+=1
        else:
            print 'No'
    else:
        print 'No'

Submission status: Accepted

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

Submission status: Accepted

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

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

s = raw_input()

over = 0
cnt = 0
for i in xrange(N):
    if s[i] == 'c':
        print 'No'
    elif s[i] == 'a':
        if cnt < A + B:
            print 'Yes'
            cnt += 1
        else:
            print 'No'
    else:
        over += 1
        if cnt < A + B and over <= B:
            print 'Yes'
            cnt += 1
        else:
            print 'No'

Submission status: Accepted

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

in_pass = 0
out_pass = 0
pass_num = 0

for c in s:
    if c == 'a' and pass_num < a + b:
        in_pass = in_pass + 1
        pass_num = pass_num + 1
        print 'Yes'
    elif c == 'b' and pass_num < a + b and out_pass + 1 <= b:
        out_pass = out_pass + 1
        pass_num = pass_num + 1
        print 'Yes'
    else:
        print 'No'

Submission status: Accepted

Solution code:
nab = list(map(lambda word: int(word), input().split(' ')))
s = input()

count = 0
foreign = 0
for student in s:
    if student == 'a' and count < nab[1] + nab[2]:
        print('Yes')
        count += 1
    elif student == 'b' and count < nab[1] + nab[2] and foreign + 1 <= nab[2]:
        print('Yes')
        count += 1
        foreign += 1
    else:
        print('No')

Submission status: Accepted

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

# get a string
s = raw_input()

cnt = 0
cnt_o = 0

ls = []

for c in s:
    if c is 'a' and cnt < a + b:
        cnt += 1
        ls.append(True)
    elif c is 'b' and cnt < a + b and cnt_o < b:
        cnt += 1
        cnt_o += 1
        ls.append(True)
    else:
        ls.append(False)
    if cnt is a + b:
        break

ls = ls + map(lambda x: False, range(n - len(ls)))
            
# output
print '\n'.join(map(lambda x: 'Yes' if x else 'No', ls))

Submission status: Accepted

Solution code:
N,A,B=map(int ,raw_input().split())
s=raw_input()
ls=list(s)
cou=0
fnum=1
for i in ls:

    if i=="a" and cou<A+B:
        print "Yes"
        cou+=1
    elif i=="b" and cou<A+B and  fnum<=B:
        print "Yes"
        cou+=1
        fnum+=1
    else:
        print "No"

Submission status: Accepted

Solution code:
import math
from collections import Counter
N,A,B = [int(a) for a in raw_input().strip().split()]
S = raw_input().strip()

passed = 0
foreign = 1
result = []
y = 'Yes'
n = 'No'

for Si in S:
  if Si == 'a':
    if passed < A+B:
      result.append(y)
      passed += 1
    else:
      result.append(n)
  elif Si == 'b':
    if passed < A+B and foreign <= B:
      result.append(y)
      passed += 1
      foreign += 1
    else:
      result.append(n)
  else:
    result.append(n)

print "\n".join(result)

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:
N,A,B=map(int,raw_input().split())
S = raw_input()
for cha	in S:
    if cha == 'a' and (A+B) > 0:
	A = A-1
	print 'Yes'
        pass
    elif cha == 'b' and B > 0 and (A+B)>0:
        B = B-1
	print 'Yes'
        pass
    elif cha == 'c':
	print 'No'
        pass
    else:
	print 'No'
        pass

Submission status: Accepted

Solution code:
n,a,b = map(int, raw_input().split())
s = raw_input()
ab = a+b
A= 0
B = 0
p = []
for c in s:
    if c == "a":
        if A < ab:
            A+=1
            p.append("Yes")
        else:
            p.append("No")
    elif c == "b":
        if A < ab and B < b:
            A +=1
            B+=1
            p.append("Yes")
        else:
            p.append("No")
    else:
        p.append("No")

for pp in p:
    print pp

Submission status: Accepted

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

passed = 0
overseas = 0

for i, c in enumerate(s):
    if c == 'a':
        if passed < (a+b):
            passed += 1
            print 'Yes'
        else:
            print 'No'
    elif c == 'b':
        if passed < (a+b) and overseas < b:
            passed += 1
            overseas += 1
            print 'Yes'
        else:
            print 'No'
    else:
        print 'No'

Submission status: Accepted

Solution code:
n, a, b = [int(x) for x in input().split()]
cnt_global, cnt_foreign = 0, 0
for x in input():
    if x == 'a':
        if cnt_global < a + b:
            cnt_global += 1
            print('Yes')
        else:
            print('No')
    elif x == 'b':
        if cnt_global < a + b and cnt_foreign < b:
            cnt_global += 1
            cnt_foreign += 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

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

AB = A+B
for i in input():
    if AB > 0:
        if i == "a":
            AB -= 1
            print('Yes')
            continue
        elif i == 'b':
            if B > 0:
                B -= 1
                AB -= 1
                print('Yes')
                continue
    print('No')

Submission status: Accepted

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

for e in s:
    if e == "c":
        print "No"
    elif e == "b":
        if b > 0 and c > 0:
            print "Yes"
            b -= 1
            c -= 1
        else:
            print "No"
    else:
        if c > 0:
            print "Yes"
            c -= 1
        else:
            print "No"