Buggy python submission (verdict: Time Limit Exceeded):
n, a, b = list(map(int, input().split()))
s = input()

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

# # 海外の学生
# foregin_list = []
# for i, c in enumerate(s):
#     if c == "b":
#         foregin_list.append(i)


passes_num = 0
foregin_list = []
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:
        foregin_list.append(i)
        if passes_num < thredshould and foregin_list.index(i) + 1 <= b:
            passes_num += 1
            print("Yes")
        else:
            print("No")


Fixed submission:
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 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 foregin_rank <= b:
            passes_num += 1
            foregin_rank += 1
            print("Yes")
        else:
            print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n, a, b = list(map(int, input().split()))
s = input()

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

# # 海外の学生
# foregin_list = []
# for i, c in enumerate(s):
#     if c == "b":
#         foregin_list.append(i)


passes_num = 0
foregin_list = []
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:
        foregin_list.append(i)
        if passes_num < thredshould and foregin_list.index(i) + 1 <= b:
            passes_num += 1
            print("Yes")
        else:
            print("No")


Fixed submission:
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 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 foregin_rank <= b:
            passes_num += 1
            foregin_rank += 1
            print("Yes")
        else:
            print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n, a, b = list(map(int, input().split()))
s = input()

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

# 海外の学生
foregin_list = []
for i, c in enumerate(s):
    if c == "b":
        foregin_list.append(i)


passes_num = 0
for i, c in enumerate(s):
    if c == "c":
        print("No")
    elif c == "a":
        if passes_num < a + b:
            passes_num += 1
            print("Yes")
        else:
            print("No")
    else:
        if passes_num < a + b and foregin_list.index(i) + 1 <= b:
            passes_num += 1
            print("Yes")
        else:
            print("No")


Fixed submission:
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 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 foregin_rank <= b:
            passes_num += 1
            foregin_rank += 1
            print("Yes")
        else:
            print("No")