Problem:


Score : 200 points

Problem Statement

There are N participants in the CODE FESTIVAL 2016 Qualification contests. The participants are either students in Japan, students from overseas, or neither of these.

Only Japanese students or overseas students can pass the Qualification contests. The students pass when they satisfy the conditions listed below, from the top rank down. Participants who are not students cannot pass the Qualification contests.

A Japanese student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B.

An overseas student passes the Qualification contests if the number of the participants who have already definitively passed is currently fewer than A+B and the student ranks B-th or above among all overseas students.

A string S is assigned indicating attributes of all participants. If the i-th character of string S is a, this means the participant ranked i-th in the Qualification contests is a Japanese student; b means the participant ranked i-th is an overseas student; and c means the participant ranked i-th is neither of these.

Write a program that outputs for all the participants in descending rank either Yes if they passed the Qualification contests or No if they did not pass.

Constraints

1≦N,A,B≦100000

A+B≦N

S is N characters long.

S consists only of the letters a, b and c.

Input

Inputs are provided from Standard Input in the following form.

N A B
S

Output

Output N lines. On the i-th line, output Yes if the i-th participant passed the Qualification contests or No if that participant did not pass.

Sample Input 1

10 2 3
abccabaabb

Sample Output 1

Yes
Yes
No
No
Yes
Yes
Yes
No
No
No

The first, second, fifth, sixth, and seventh participants pass the Qualification contests.

Sample Input 2

12 5 2
cabbabaacaba

Sample Output 2

No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No

The sixth participant is third among overseas students and thus does not pass the Qualification contests.

Sample Input 3

5 2 2
ccccc

Sample Output 3

No
No
No
No
No



Sample input:
10 2 3
abccabaabb


Sample output:
Yes
Yes
No
No
Yes
Yes
Yes
No
No
No

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import re
import math
from collections import defaultdict
import itertools
from copy import deepcopy
import random
from heapq import heappop,heappush
import time
import os
import queue
import sys
import datetime
from functools import lru_cache
#@lru_cache(maxsize=None)
readline=sys.stdin.readline
sys.setrecursionlimit(2000000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def is_power(a,b):#aはbの累乗数か
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def get_facs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=""):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def floor_(n,x=1):
    return x*(n//x)
def ceil_(n,x=1):
    return x*((n+x-1)//x)
def hani(x,min_,max_):
    ret=x
    if x<min_:ret=min_
    if x>max_:ret=max_
    return ret
def seifu(x):
    return x//abs(x)
###################################################
def main():
    N,A,B=map(int,input().split())
    S=input()
    cnt=0
    bcnt=0
    ans=[]
    for c in S:
        if c=="c":
            ans.append("No")
            continue
        cnt+=1
        if c=="b":bcnt+=1
        if c=="a" and cnt<=A+B:
            ans.append("Yes")
        elif c=="b" and bcnt<=B and cnt<=A+B:
            ans.append("Yes")
        else:
            ans.append("No")
    for a in ans:
        print(a)


main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

success = 0
foreigner = 0
count = 0

for i in s:
    if i == "a" and success <= a + b:
        print("Yes")
        success += 1
    elif i == "b" and success <= a + b and foreigner <= b:
        print("Yes")
        success += 1
        foreigner += 1
    else:
        print("No")
    count += 1
    if success == a + b:
        break

for _ in range(n - count):
    print("No")

Submission status: Wrong Answer

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

# a: 国内の学生
# b: 海外の学生
# c: その他
# i番idxはi位


passes_num = 0  # 通過した人の数
foregin_rank = 0  # 海外の学生の中での順位
thredshould = a + b
for c in s:
    if c == "c":
        print("No")
    elif c == "a":
        if passes_num <= thredshould:
            passes_num += 1
            print("Yes")
        else:
            print("No")
    else:
        if passes_num <= thredshould and passes_num <= b:
            passes_num += 1
            foregin_rank += 1
            print("Yes")
        else:
            print("No")

Submission status: Wrong Answer

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

# a: 国内の学生
# b: 海外の学生
# c: その他
# i番idxはi位


passes_num = 0  # 通過した人の数
foregin_rank = 1  # 海外の学生の中での順位
thredshould = a + b
for i, c in enumerate(s):
    if c == "c":
        print("No")
    elif c == "a":
        if passes_num < thredshould:
            passes_num += 1
            print("Yes")
        else:
            print("No")
    else:
        if passes_num < thredshould and passes_num <= b:
            passes_num += 1
            foregin_rank += 1
            print("Yes")
        else:
            print("No")

Submission status: Wrong Answer

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

# a: 国内の学生
# b: 海外の学生
# c: その他
# i番idxはi位


passes_num = 0  # 通過した人の数
foregin_rank = 1  # 海外の学生の中での順位
thredshould = a + b
for i, c in enumerate(s):
    if c == "c":
        print("No")
    elif c == "a":
        if passes_num <= thredshould:
            passes_num += 1
            print("Yes")
        else:
            print("No")
    else:
        if passes_num <= thredshould and passes_num <= b:
            passes_num += 1
            foregin_rank += 1
            print("Yes")
        else:
            print("No")

Submission status: Wrong Answer

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

# a: 国内の学生
# b: 海外の学生
# c: その他
# i番idxはi位


passes_num = 0  # 通過した人の数
foregin_rank = 0  # 海外の学生の中での順位
thredshould = a + b
for i, c in enumerate(s):
    if c == "c":
        print("No")
    elif c == "a":
        if passes_num < thredshould:
            passes_num += 1
            print("Yes")
        else:
            print("No")
    else:
        if passes_num < thredshould and passes_num <= b:
            passes_num += 1
            foregin_rank += 1
            print("Yes")
        else:
            print("No")

Submission status: Wrong Answer

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

# a: 国内の学生
# b: 海外の学生
# c: その他
# i番idxはi位


passes_num = 0  # 通過した人の数
foregin_rank = 1  # 海外の学生の中での順位
thredshould = a + b
for i, c in enumerate(s):
    if c == "c":
        print("No")
    elif c == "a":
        if passes_num < thredshould:
            passes_num += 1
            print("Yes")
        else:
            print("No")
    else:
        if passes_num < thredshould and passes_num <= b:
            passes_num += 1
            print("Yes")
        else:
            print("No")

Submission status: Wrong Answer

Solution code:

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

ans = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,A,B = map(int,input().split())
student = input()
passp = 0
passb = 0
for s in student:
	if s == "a" and passp < (A+B):
		passp += 1
		print("YES")
	elif s == "b" and passp < (A+B) and passb < B:
		passp += 1
		passb += 1
		print("YES")
	else:
		print("NO")

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split()) 
s = [i for i in input()]
count = 0
sb = 0

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

Submission status: Wrong Answer

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

c1 = 0
c2 = 0


for i in range(len(s)):
    if s[i] == 'a':
        if c1 < a+b:    
            print('Yes')
            c1 += 1
        else:
            print('No')
    elif s[i] == 'b':
        if c2 < a+b and c2 <= b:
            print('Yes')
            c1 += 1
            c2 += 2
        else:
            print('No')
    else:
        print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import re
N,A,B = map(int,input().split())
S = input()
motoplayers = []
cnt = 0
for i in S:
    motoplayers.append(i + str(cnt))
    cnt+=1
players = [i for i in motoplayers if not "c" in i]

kaigai = [i for i in players if "b" in i]
del kaigai[B:]
del players[A+B:]

for i in range(N):
    if motoplayers[i] in players:
        if motoplayers[i] == r"b＋\w":
            if motoplayers[i] in kaigai:
                print("Yes")
                continue
            else:
                print("No")
                continue
        else:
            print("Yes")
            continue
    else:
        print("No")
        continue

Submission status: Wrong Answer

Solution code:
import re
N,A,B = map(int,input().split())
S = input()
motoplayers = []
cnt = 0
for i in S:
    motoplayers.append(i + str(cnt))
    cnt+=1
players = [i for i in motoplayers if not "c" in i]
print(players)
kaigai = [i for i in players if "b" in i]
del kaigai[B:]
del players[A+B:]
print(players)
for i in range(N):
    if motoplayers[i] in players:
        if motoplayers[i] == r"b＋\w":
            if motoplayers[i] in kaigai:
                print("Yes")
                continue
            else:
                print("No")
                continue
        else:
            print("Yes")
            continue
    else:
        print("No")
        continue

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

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

A,B,C= 0,0,0
X = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count, rank = 0, 0
for s in S:
    if s == 'b':
        rank += 1

    if (s == 'a') and (count < A + B):
        count += 1
        print('yes')
    elif (s == 'b') and (count < A + B) and (rank <= B):
        count += 1
        print('yes')
    else:
        print('No')

Submission status: Wrong Answer

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

if a+b <= count_a:
  count_a = a+b
  count_b = 0
else:
  count_b = min(a+b-count_a, b)

for c in s:
  if c=='c':
    print('No')
  elif c=='a':
    print('Yes' if count_a>0 else 'No')
    count_a -= 1
  else:
    print('Yes' if count_b>0 else 'No')
    count_b -= 1

Submission status: Wrong Answer

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

if a+b <= count_a:
  count_a = a+b
  count_b = 0
else:
  count_b = min(a+b-count_a, b)

for c in s:
  if c=='c':
    print('No')
  elif c=='a':
    print('Yes' if count_a>=0 else 'No')
    count_a -= 1
  else:
    print('Yes' if count_b>=0 else 'No')
    count_b -= 1

Submission status: Wrong Answer

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

if a+b <= count_a:
  count_a = a+b
  count_b = 0
else:
  count_b = min(a+b-count_a, b)

for c in s:
  if c=='c':
    print('No')
  elif c=='a':
    print('Yes' if count_a>0 else 'No')
    count_a -= 1
  else:
    print('Yes' if count_b>0 else 'No')
    count_b -= 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.buffer.readline
n,a,b=map(int,input().split())
S=input()[:-1]
print(n,a,b,S)
for i in range(n):
    A=S[:i].count(97)
    B=S[:i].count(98)
    if S[i]==97 and A+B<=a+b:
        print("Yes")
        continue
    if S[i]==98 and A+B<a+b and B<b:
        print("Yes")
        continue
    else:print("No")

Submission status: Wrong Answer

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

a_counter = 0
b_counter = 0

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

Submission status: Wrong Answer

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

a_counter = 0
b_counter = 0

while S != "":
  s = S[0]
  if s == "a" and a_counter + b_counter <=A+B:
    a_counter += 1
    print("Yes")
  elif s == "b" and b_counter <= B and a_counter + b_counter <=A+B:
    b_counter += 1
    print("Yes")
  else:
    print("No")
  
  S = S[1:]

Submission status: Wrong Answer

Solution code:
n,A,B = map(int,input().split())
s = list(str(input()))
p =[]
for i in range(0,n):
  if s[i] =="c":
    print("No")
  elif s[i]=="a" or s[i]=="b":
    if A+B>len(p):
      if s[i] =="a":
        p.append(s[i])
        print("Yes")
      elif s[i]=="b":
        if p.count("b")<B:
          p.append(s[i])
        print("Yes")    
    else:
      print("No")

Submission status: Wrong Answer

Solution code:
def main():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N, A, B = input_number_list()
    S = input()
    total = 0
    total_f = 0
    for c in S:
        isNg = False
        if c == 'a' and total < A + B:
            total += 1
        elif c == 'b' and total < A + B and total_f < B:
            total += 1
            total_f += 1
        else:
            isNg = True
        print('YNeos'[isNg::2])


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

for i in range(len(s)):
  if (s[i] == 'a' and t < a+b):
    print('Yes')
    t += 1
  if (s[i] == 'b' and t < a+b and f < b):
    print('Yes')
    t += 1
    f += 1
  else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,A,B=map(int,input().split())
s=list(input())
cnt=0
cnt_b=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 cnt_b<=B:
			print('Yes')
	else:
		print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
l=list(map(int,input().split()))
participant=list(input())
passnum=l[1]+l[2]
b=0
for i in range(l[0]):
    if participant[i]=='a' and passnum>0:
        participant[i]='Yes'
        passnum-=1
    elif passnum==0:
        break
if passnum>0:
    for i in range(l[0]):
        if participant[i]=='b' and passnum>0 and b<l[2]:
            participant[i]='Yes'
            passnum-=1
            b+=1
        elif b==l[2]:
            break
        elif passnum==0:
            break
for i in range(l[0]):
    if participant[i]!='Yes':
        participant[i]='No'
for i in range(l[0]):
    print(participant[i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,A,B=map(int,input().split())
S=str(input())
M=A+B
K=0
Foreign=0
for j in S:
  if j=="c":
    print("No")
  else:
    K+=1
    if j=="a":
      if K<=M:
        print("Yes")
      else:
        print("No")
    else:
      Foreign+=1
      if Foreign<=B and K<=M:
        print("Yes")
      else:
        print("No")

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys

input = sys.stdin.readline

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

S = input()

nai = 0
gai = 0


goukaku = 0

for i in range(len(S)):
    if S[i] != 'c':
        goukaku+=1

for i in range(len(S)):
    if S[i] == 'a':
        nai+=1
        if (i+1) < goukaku:
            print("Yes")
        else:
            print("No")

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

    elif S[i] == 'c':
        print("No")

Submission status: Wrong Answer

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

pass_human = 0
overseas = 0

for i in S:
    if i == "a":
        if pass_human < A+B:
            print("YES")
            pass_human += 1
        else:
            print("NO")
    elif i == "b":
        if pass_human < A+B and overseas < B:
            print("YES")
            pass_human += 1
            overseas += 1
        else:
            print("NO")
    else:
        print("NO")

Submission status: Wrong Answer

Solution code:
n,a,b = map(int,raw_input().split())
s = raw_input()
apb = 0
over = 0
for i in s:
    if i =='a':
        if apb >= a+b:
            print  'No'
        else:
            print 'Yes'
            apb+=1
    elif i == 'b':
        if (apb >= a + b) or over > b :
            print  'No'


        else:
            print 'Yes'
            apb+=1
            over += 1
    else:
        print 'No'

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

C = A + B
ans = []
df = 0
f = 0

for i in range(N):
  s = S[i]
  if s == 'c':
    ans.append('No')
    continue
  elif s == 'a':
    df += 1
    if df <= C:
      ans.append('Yes')
    else:
      ans.append('No')
  elif s == 'b':
    df += 1
    f += 1
    if df <= C and f <= B:
      ans.append('Yes')
    else:
      ans.append('No')
      
print('\n'.join(ans))

Submission status: Wrong Answer

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

C = A + B
ans = []
df = 0
f = 0

for i in range(N):
  s = S[i]
  if s == 'c':
    ans.append('No')
    continue
  elif s == 'a':
    df += 1
    if df < C:
      ans.append('Yes')
    else:
      ans.append('No')
  elif s == 'b':
    df += 1
    f += 1
    if df < C and f <= B:
      ans.append('Yes')
    else:
      ans.append('No')
      
print('\n'.join(ans))

Submission status: Wrong Answer

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

ans = []
df = 0
f = 0

for i in range(N):
  s = S[i]
  if s == 'c':
    ans.append('No')
    continue
  elif s == 'a':
    df += 1
    if df < A:
      ans.append('Yes')
    else:
      ans.append('No')
  elif s == 'b':
    df += 1
    f += 1
    if df < A and f <= B:
      ans.append('Yes')
    else:
      ans.append('No')
      
print('\n'.join(ans))

Submission status: Wrong Answer

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

ans = []
df = 0
f = 0

for i in range(N):
  s = S[i]
  if s == 'c':
    ans.append('No')
    continue
  elif s == 'a':
    df += 1
    if df <= A:
      ans.append('Yes')
    else:
      ans.append('No')
  elif s == 'b':
    df += 1
    f += 1
    if df <= A and f <= B:
      ans.append('Yes')
    else:
      ans.append('No')
      
print('\n'.join(ans))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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