codeFlyer (bitFlyer Programming Contest)

Submission #10077202

Source codeソースコード

<?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

Task問題 B - 洋菓子店
User nameユーザ名 fendo181
Created time投稿日時
Language言語 PHP7 (7.0.15)
Status状態 WA
Score得点 0
Source lengthソースコード長 637 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
Sample - sample-01.txt,sample-02.txt,sample-03.txt,sample-04.txt
All 0 / 200 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

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
01.txt TLE
02.txt TLE
03.txt TLE
04.txt TLE
05.txt WA
06.txt TLE
07.txt WA
08.txt WA
sample-01.txt AC 9 ms 4604 KB
sample-02.txt WA
sample-03.txt WA
sample-04.txt WA