Submission #1456343


Source Code Expand

n, a, b = gets.chomp.split(" ").map(&:to_i)
s = gets.chomp.split("")
rem1 = a + b
rem2 = b
s.each do |e|
  if e == "a" then
    if rem1 > 0 then
      puts "Yes"
      rem1 -= 1
    else
      puts "No"
    end
  elsif e == "b" then
    if rem1 > 0 && rem2 > 0 then
      puts "Yes"
      rem1 -= 1
      rem2 -= 1
    else 
      puts "No"
    end
  else
    puts "No"
  end
end

Submission Info

Submission Time
Task B - Qualification simulator
User wtnk0812
Language Ruby (2.3.3)
Score 200
Code Size 404 Byte
Status AC
Exec Time 115 ms
Memory 9852 KB

Compile Error

./Main.rb:1: warning: assigned but unused variable - n

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 111 ms 9852 KB
02.txt AC 113 ms 9852 KB
03.txt AC 115 ms 9852 KB
04.txt AC 114 ms 9852 KB
05.txt AC 98 ms 9596 KB
06.txt AC 111 ms 9852 KB
07.txt AC 113 ms 9852 KB
08.txt AC 113 ms 9852 KB
09.txt AC 108 ms 9852 KB
10.txt AC 114 ms 9852 KB
s1.txt AC 7 ms 1788 KB
s2.txt AC 7 ms 1788 KB
s3.txt AC 7 ms 1788 KB