Submission #1456342


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 0
Code Size 404 Byte
Status WA
Exec Time 116 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 0 / 200
Status
WA × 3
WA × 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 WA 111 ms 9724 KB
02.txt WA 113 ms 9852 KB
03.txt WA 114 ms 9852 KB
04.txt WA 114 ms 9852 KB
05.txt WA 98 ms 9596 KB
06.txt WA 110 ms 9852 KB
07.txt WA 113 ms 9852 KB
08.txt WA 113 ms 9852 KB
09.txt WA 108 ms 9852 KB
10.txt WA 116 ms 9852 KB
s1.txt WA 7 ms 1788 KB
s2.txt WA 7 ms 1788 KB
s3.txt WA 7 ms 1788 KB