Submission #10075916


Source Code Expand

a, b, n = gets.chomp.split(" ").map(&:to_i)

X = gets.chomp.split("")

X.reverse.each { |x|
  if x == "S" then
    if a > 0 then
      a -= 1
    end
  elsif x == "C" then
    if b > 0 then
      b -= 1
    end
  elsif x == "E" then
    if a > b then
      a -= 1
    elsif b > a then
      b -= 1
    else
      a -= 1
    end
  end
}

puts a
puts b

Submission Info

Submission Time
Task B - 洋菓子店
User rotelstift
Language Ruby (2.3.3)
Score 0
Code Size 375 Byte
Status WA
Exec Time 73 ms
Memory 10108 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
AC × 1
WA × 3
AC × 5
WA × 7
Set Name Test Cases
Sample sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt
Case Name Status Exec Time Memory
01.txt AC 63 ms 9340 KB
02.txt AC 43 ms 6012 KB
03.txt WA 50 ms 6524 KB
04.txt WA 50 ms 6524 KB
05.txt WA 24 ms 3964 KB
06.txt WA 73 ms 10108 KB
07.txt AC 14 ms 2556 KB
08.txt AC 7 ms 1788 KB
sample-01.txt AC 7 ms 1788 KB
sample-02.txt WA 7 ms 1788 KB
sample-03.txt WA 7 ms 1788 KB
sample-04.txt WA 7 ms 1788 KB