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()
AB=A+B
j=1
num=0
for i in range(1,N+1):
    if S[i]=='b' and num<AB and j<=B:
        print('Yes')
        j+=1
        num+=1
    elif S[i]=='a' and num<AB:
        print('Yes')
        num+=1
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,a,b=map(int,input().split())
for c in input():
  f=1
  if c<"b"and a+b>0:f=0;a-=1
  elif c<"c"and a+b>0and b>0:f=0;b-=1
  print("YNeos"[f::2])

Submission status: Accepted

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

Submission status: Accepted

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

allcnt=0
b_cnt=0

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

Submission status: Accepted

Solution code:
import sys
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
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)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7

n, a, b = LI()
s = S()

# n人が参加するコンペに国内の学生か海外の学生かその他がいる。
# 国内または海外の学生のみが予選通過でき、上位の学生から以下の条件を満たすとき通過
# 国内の学生は通過確定した参加者がA+B人に満たなければ通過
# 海外の学生は通過確定した参加者がA+B人に満たず、海外の学生中での順位がB位以内ならば予選通過

# Sは参加者の情報を示す文字列。i番目の文字がaの時予選i位の参加者が国内の学生、bの時は海外の学生。
# cの時はその他。
# すべての参加者に対して予選通過に対しYes、Noを出力せよ

sl = list(s)
list_a = []
list_b = []
max_pass = a + b

for i in range(len(sl)):
    if sl[i] == "a":
        if len(list_a) + len(list_b) < max_pass:
            sl[i] = "Yes"
            list_a.append(i)
        else:
            sl[i] = "No"
    elif sl[i] == "b":
        if len(list_a) + len(list_b) < max_pass and len(list_b) < b:
            sl[i] = "Yes"
            list_b.append(i)
        else:
            sl[i] = "No"
    elif sl[i] == "c":
        sl[i] = "No"

for x in sl:
    print(x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
s = input()
jap_c = 0
ab_c = 0
for i in list(s):
    if i == 'a':
        if jap_c + ab_c < a+b:
            jap_c += 1
            print('Yes')
            continue
    if i == 'b':
        if jap_c + ab_c < a+b:
            if ab_c < b:
                ab_c += 1
                print('Yes')
                continue
    print('No')

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())
s = list(input())
line = a + b
rank = 1
bnum = 0
for student in s:
    if student == "a" or student== "b":
        if rank <= line:

            if student == "a":
                print("Yes")
                rank += 1
            else:
                bnum += 1
                if bnum <= b:
                    print("Yes")
                    rank += 1
                else:
                    print("No")
        else:
            print("No")
    else:
        # rank +=1
        print("No")

Submission status: Accepted

Solution code:
n, a, b = map(int, input().split())  
sList = input()
cnt = 0
cnt_b = 0
for i, s in enumerate(sList):
    if s == 'a':
        #国内の学生は、現在予選の通過が確定した参加者がA+B人に満たなければ、予選を通過する
        if cnt < a+b:
            cnt += 1
            print('Yes')
        else:
            print('No')
    elif s == 'b':
        #さらに海外の学生の中での順位がB位以内なら、予選を通過する
        if (cnt < a+b) & (cnt_b < b):
            cnt += 1
            cnt_b += 1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

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

cnt=0
fl=0

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

Submission status: Accepted

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

passed = 0
foreign = 0
for c in s:
    if c == "a":
        if passed < a + b:
            print("Yes")
            passed += 1
        else: print("No")
    elif c == "b":
        foreign += 1
        if passed < a + b and foreign <= b:
            print("Yes")
            passed += 1
        else: print("No")
    else:
        print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n ,a, b  =map(int, input().split())
S = list(input())
threshold = a + b
rank = 1
bnum = 1
for p in S:
    if p == "a" or p == "b":
        if rank <= threshold:
            if p == "b" and bnum <= b:
                print("Yes")
                bnum += 1
                rank += 1
            elif p == "b" and bnum > b:
                print("No")
                bnum += 1
            else:
                print("Yes")
                rank += 1
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

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

for s in S:
  if s == "c":
    print("No")
  elif s == "a":
    if A + B == 0:
   	  print("No")
    else:
      A -= 1
      print("Yes")
  elif s == "b":
    if A + B == 0 or B == 0:
      print("No")
    else:
      B -= 1
      print("Yes")

Submission status: Accepted

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

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


def solve(N: int, A: int, B: int, S: str):
    at = 0
    bt = 0
    for s in list(S):
        if s == "c":
            print(NO)
            continue
        if at + bt < A + B:
            if s == "a":
                print(YES)
                at += 1
            elif s == "b" and bt < B:
                print(YES)
                bt += 1
            else:
                print(NO)
        else:
            print(NO)

    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, A, B, S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def check_jp(passed, A, B):
    return passed < A + B


def check_foreign(passed, A, B, passed_b):
    return passed < A + B and passed_b < B


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

    passed = 0
    passed_b = 0
    for i, p in enumerate(S):
        if p == "a":
            if check_jp(passed, A, B):
                print("Yes")
                passed += 1
            else:
                print("No")
        elif p == "b":
            if check_foreign(passed, A, B, passed_b):
                print("Yes")
                passed += 1
                passed_b += 1
            else:
                print("No")
        else:
            print("No")

resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, A, B = map(int, input().split())
S = list(input())
ans = ""
cnt = 0
f = 0

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

Submission status: Accepted

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

D=[]
F = []
ans=[]
f = 0
for i in range(N):
    tmp = S[i]
    if tmp == "a":
        if (len(D)+len(F))<(A+B):
            D.append(tmp)
            ans.append("Yes")
        else:
            ans.append("No")
    elif tmp == "b":
        f += 1
        if (len(D)+len(F))<(A+B) and f<=B:
            F.append(tmp)
            ans.append("Yes")
        else:
            ans.append("No")
    else:
        ans.append("No")

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

Submission status: Accepted

Solution code:
import sys
a = [int(c) for c in input().split()]
N = a[0]
A = a[1]
B = a[2]
S = input()

cnt = 0
f = 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 f+1 <= B:
            print("Yes")
            cnt+=1
            f+=1
        else:
            print("No")
        pass
    elif S[i] == "c":
        print("No")

Submission status: Accepted

Solution code:
# coding: utf-8

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

    for c in S:
        if c == 'c':
            ans = 'No'
        elif c == 'a':
            if A + B > cnt:
                ans = 'Yes'
                cnt += 1
            else:
                ans = 'No'
        else:
            if A + B > cnt and B > cnt_f:
                ans = 'Yes'
                cnt += 1
                cnt_f += 1
            else:
                ans = 'No'
        print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    candidates=[]
    n,a,b = map(int,input().split())
    [candidates.append(s) for s in input().rstrip()]
    limit=a+b
    b_counter=1

    for idx in range(1,len(candidates)+1):
        if 'a' in candidates[idx-1] and limit > 0:
            limit-=1
            print("Yes")
        elif 'b' in candidates[idx-1] and limit > 0 and b_counter <= b:
            b_counter+=1
            limit-=1
            print("Yes")
        else:
            print("No")
    
if __name__=="__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

a_reviewed = 0
b_reviewed = 0

for x in s:
    if a_reviewed + b_reviewed < a + b:
        if x == 'a':
            print('Yes')
            a_reviewed += 1
        elif x == 'b' and b_reviewed < b:
            print('Yes')
            b_reviewed += 1
        else:
            print('No')
    else:
        print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

p=0
q=0

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

Submission status: Accepted

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

passed_count = 0
passed_count_foreigner = 0

for person in s:
    if passed_count < a + b and person == "a":
        print("Yes")
        passed_count += 1
    elif passed_count < a + b and person == "b" and passed_count_foreigner < b:
        print("Yes")
        passed_count += 1
        passed_count_foreigner += 1
    else:
        print("No")

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    for char in S:
        flag = False
        if char == "a":
            if cnt_a + cnt_b < A + B:
                cnt_a += 1
                flag = True
        elif char == "b":
            if cnt_a + cnt_b < A + B:
                if cnt_b < B:
                    cnt_b += 1
                    flag = True
        print("Yes" if flag else "No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

t1,t2 = 0,0
for ch in S:
  if ch == "c":
    print("No")
  elif ch == "a":
    if t1 >= A+B:
      print("No")
    else:
      t1 += 1
      print("Yes")
  else:
    if t1 >= A+B or t2 >= B:
      print("No")
    else:
      t1 += 1
      t2 += 1
      print("Yes")

Submission status: Accepted

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

count = 0
count_B = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

thr_dom = a+b
thr_nat = b
pass_num = 0
pass_nat = 0

for member in member_list:
    if member == 'a':
        if pass_num < thr_dom:
            print("Yes")
            pass_num += 1
        else:
            print("No")
    elif member == "b":
        if pass_num < thr_dom and pass_nat < thr_nat:
            print("Yes")
            pass_num += 1
            pass_nat += 1
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

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

passed = 0
limit = a+b
b_rank = 1

ans_list = []
for w in s:
    if w == 'a':
        if passed < limit:
            ans_list.append('Yes')
            passed += 1
        else:
            ans_list.append('No')
    elif w == 'b':
        if passed < limit and b_rank <= b:
            ans_list.append('Yes')
            passed += 1
        else:
            ans_list.append('No')
        b_rank += 1
    else:
        ans_list.append('No')

for i in ans_list:
    print(i)

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
a = input("").split(" ")
a = [int(b) for b in a]
N = a[0]
A = a[1]
B = a[2]
S = input("")
n = 0
nb = 1
for c in range(len(S)):
    if S[c] == "a":
        if n < (A + B):
            n += 1
            print("Yes")
        else:
            print("No")
    elif S[c] == "b":
        if n < (A + B) and nb <= B:
            n += 1
            nb += 1
            print("Yes")
        else:
            print("No")
    elif S[c] == "c":
        print("No")

Submission status: Accepted

Solution code:
n,a,b = map(int, input().split())
s = str(input())
a_count,b_count = 0,0
for i in range(n):
  if s[i] == 'c':
    print('No')
  elif s[i] == 'a':
    if a_count+b_count < a+b:
      print('Yes')
      a_count += 1
    else:
      print('No')
  elif s[i] == 'b':
    if a_count+b_count < a+b and b_count < b:
      print('Yes')
      b_count += 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())
S = input()
student_pass = A + B
abroad_student_pass = B
passed_students = 0
passed_students_abroad = 0


for status in S:
  if status == 'c':
    print('No')
  elif status == 'a':
    if passed_students < student_pass:
      print('Yes')
      passed_students += 1
    else:
      print('No')
  elif status == 'b':
    if passed_students < student_pass and passed_students_abroad < abroad_student_pass:
      print('Yes')
      passed_students += 1
      passed_students_abroad += 1
    else:
      print('No')

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n, a, b = i_list()
    ss = s_input()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin
from math import ceil, floor
n,a,b=[int(x) for x in stdin.readline().rstrip().split()]
s=list(stdin.readline().rstrip())
c=a+b
d=e=m=0
for i in range(n):
    if d<c and s[i]=="a":
        print("Yes")
        d+=1
    elif d<c and e<b and s[i]=="b":
        print("Yes")
        d+=1
        e+=1
    else:
        print("No")
    if d>=c:
        m=i+1
        break
if m != 0:
    for i in range(n-m):
        print("No")

Submission status: Accepted

Solution code:
from sys import stdin
from math import ceil, floor
n,a,b = [int(x) for x in stdin.readline().rstrip().split()]
s=list(stdin.readline().rstrip())
c=a+b
d=e=0
for i in range(n):
    if d<c and s[i]=="a":
        print("Yes")
        d+=1
    elif d<c and e<b and s[i]=="b":
        print("Yes")
        d+=1
        e+=1
    else:
        print("No")

Submission status: Accepted

Solution code:
from sys import stdin
from math import ceil, floor
n, a, b = [int(x) for x in stdin.readline().rstrip().split()]
s = list(stdin.readline().rstrip())
d = 0
e = 0
for i in range(n):
    if d < a + b and s[i] == "a":
        print("Yes")
        d += 1
    elif d < a + b and e < b and s[i] == "b":
        print("Yes")
        d += 1
        e += 1
    else:
        print("No")

Submission status: Accepted

Solution code:
from sys import stdin
from math import ceil, floor
n, a, b = [int(x) for x in stdin.readline().rstrip().split()]
s = list(stdin.readline().rstrip())
c = a + b
d = 0
e = 0
for i in range(n):
    if d < c and s[i] == "a":
        print("Yes")
        d += 1
    elif d < c and e < b and s[i] == "b":
        print("Yes")
        d += 1
        e += 1
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = list(map(int, input().split()))
n = x[0]
a = x[1]
b = x[2]
s = input()


count_domestic = 0
count_oversea = 0
judge_list = []
yes = 'Yes'
no = 'No'

for i in range(n):
    candidate = s[i]
    if candidate == 'a':
        if count_domestic + count_oversea < a + b:
            judge_list.append(yes)
            count_domestic += 1
        else:
            judge_list.append(no)
    elif candidate == 'b':
        if count_domestic + count_oversea < a + b and count_oversea < b:
            judge_list.append(yes)
            count_oversea += 1
        else:
            judge_list.append(no)
    else:
        judge_list.append(no)

for j in range(len(judge_list)):
    print(judge_list[j])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""Boot-camp-for-Beginners_Easy003_B_Qualification-simulator_19-August-2020.py"""
N, A, B = map(int, input().split())
S = str(input())

RANK_a = 0
RANK_b = 0

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

        if RANK_a+RANK_b < A+B:
            if RANK_b < B:
                RANK_b += 1
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        
        print("No")