Submission #10075476
Source Code Expand
a, b, c = gets.strip.split.map(&:to_i) x = gets.strip x.chars.each do |i| case i when 'S' a = [a - 1, 0].max when 'C' b = [b - 1, 0].max else if a > b a = [a - 1, 0].max elsif a < b b = [b - 1, 0].max elsif a >= 1 && a == b a -= 1 end end end puts a puts b
Submission Info
Submission Time | |
---|---|
Task | B - 洋菓子店 |
User | akht |
Language | Ruby (2.3.3) |
Score | 200 |
Code Size | 333 Byte |
Status | AC |
Exec Time | 60 ms |
Memory | 9340 KB |
Compile Error
./Main.rb:1: warning: assigned but unused variable - c
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
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 | 52 ms | 8828 KB |
02.txt | AC | 36 ms | 5628 KB |
03.txt | AC | 41 ms | 6012 KB |
04.txt | AC | 41 ms | 6012 KB |
05.txt | AC | 21 ms | 3708 KB |
06.txt | AC | 60 ms | 9340 KB |
07.txt | AC | 13 ms | 2556 KB |
08.txt | AC | 7 ms | 1788 KB |
sample-01.txt | AC | 7 ms | 1788 KB |
sample-02.txt | AC | 11 ms | 1788 KB |
sample-03.txt | AC | 7 ms | 1788 KB |
sample-04.txt | AC | 7 ms | 1788 KB |