Submission #10078646


Source Code Expand

<?php
fscanf(STDIN,"%d %d %d",$a,$b,$c);
fscanf(STDIN,"%s",$str);

for($i = 0; $i < strlen($str); $i++) {
  switch ($str[$i]) {
      case 'S':
        if($a > 0) {
            $a--;   
        }
        break;
      case 'C':
        if($b > 0) {
            $b--; 
        }
        break; 
      case 'E':
        if( $a > $b && $a > 1 ) {
            $a--;
        }elseif($b > $a && $b > 1) {
            $b--;
        }elseif($b == $a &&  $b >1 && $a > 1) {
            $a--;
        } 
        break; 
    }
}
echo $a;
echo PHP_EOL;
echo $b;

Submission Info

Submission Time
Task B - 洋菓子店
User fendo181
Language PHP7 (7.0.15)
Score 200
Code Size 581 Byte
Status AC
Exec Time 20 ms
Memory 4856 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 12
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 20 ms 4856 KB
02.txt AC 15 ms 4604 KB
03.txt AC 17 ms 4604 KB
04.txt AC 17 ms 4604 KB
05.txt AC 12 ms 4604 KB
06.txt AC 20 ms 4604 KB
07.txt AC 10 ms 4604 KB
08.txt AC 9 ms 4604 KB
sample-01.txt AC 9 ms 4604 KB
sample-02.txt AC 9 ms 4604 KB
sample-03.txt AC 9 ms 4604 KB
sample-04.txt AC 9 ms 4604 KB