Submission #3564581


Source Code Expand

N, A, B = gets.split.map(&:to_i)
S = gets.chomp

sum = 0
b = 1

N.times do |i|
    if S[i] == 'a'
        if sum < A+B
            puts "Yes"
            sum += 1
        else
            puts "No"
        end
    elsif S[i] == 'b'
        if sum < A+B && b <= B
            puts "Yes"
            sum += 1
            b += 1
        else
            puts "No"
        end
    else
        puts "No"
    end
end

Submission Info

Submission Time
Task B - Qualification simulator
User betrue12
Language Ruby (2.3.3)
Score 200
Code Size 436 Byte
Status AC
Exec Time 89 ms
Memory 2428 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 13
Set Name Test Cases
Sample s1.txt, s2.txt, s3.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
01.txt AC 78 ms 2300 KB
02.txt AC 80 ms 2300 KB
03.txt AC 82 ms 2300 KB
04.txt AC 81 ms 2300 KB
05.txt AC 69 ms 2172 KB
06.txt AC 78 ms 2300 KB
07.txt AC 78 ms 2428 KB
08.txt AC 79 ms 2300 KB
09.txt AC 67 ms 2300 KB
10.txt AC 89 ms 2300 KB
s1.txt AC 7 ms 1788 KB
s2.txt AC 7 ms 1788 KB
s3.txt AC 7 ms 1788 KB