Submission #10077202


Source Code Expand

<?php
fscanf(STDIN,"%d %d %d",$short,$cheese,$buyPeopleNumber);
fscanf(STDIN,"%s",$str);
$action = str_split($str);
while(count($action) > 0 ) {
  $nextAction = array_shift($action);
  switch ($nextAction) {
      case 'S':
        $short--;   
        break;
      case 'C':
        $cheese--;   
        break; 
      case 'E':
        if( $short > $cheese ) {
            $short--;
        }elseif($cheese > $short) {
            $cheese--;
        }elseif($cheese == $short &&  $cheese >1 && $short > 1) {
            $short--;
        } 
        break; 
  }
}

echo $cheese;
echo PHP_EOL;
echo $short;

Submission Info

Submission Time
Task B - 洋菓子店
User fendo181
Language PHP7 (7.0.15)
Score 0
Code Size 637 Byte
Status WA
Exec Time 2104 ms
Memory 10744 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status
AC × 1
WA × 3
AC × 1
WA × 6
TLE × 5
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 TLE 2104 ms 10744 KB
02.txt TLE 2104 ms 6648 KB
03.txt TLE 2104 ms 8696 KB
04.txt TLE 2104 ms 8696 KB
05.txt WA 740 ms 6648 KB
06.txt TLE 2104 ms 10744 KB
07.txt WA 96 ms 4604 KB
08.txt WA 9 ms 4604 KB
sample-01.txt AC 9 ms 4604 KB
sample-02.txt WA 9 ms 4604 KB
sample-03.txt WA 9 ms 4604 KB
sample-04.txt WA 9 ms 4604 KB