codeFlyer (bitFlyer Programming Contest)

Submission #10076774

Source codeソースコード

<?php


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

//ケーキの数
$short = $a;
$cheese = $b;
$buyPeopleNumber= $c;
// 行動
$action = str_split($str);

for($i = 0; $i < $buyPeopleNumber; $i++) {
    $nextAction = array_shift($action);
    if($nextAction == 'S') {
        $short--;       
    }elseif($nextAction == 'C') {
        $cheese--;
    }elseif($nextAction == 'E' ) {
        if( $short > $cheese ) {
            $short--;
        }elseif($cheese > $short) {
            $cheese--;
        }elseif($cheese == $short) {
            $short--;
        } 
    }
}

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ソースコード長 665 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