結果

問題 No.346 チワワ数え上げ問題
ユーザー hu_nbkhu_nbk
提出日時 2016-02-29 02:54:00
言語 PHP
(8.3.4)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 4,720 ms
コンパイル使用メモリ 32,412 KB
実行使用メモリ 32,444 KB
最終ジャッジ日時 2023-10-24 19:05:40
合計ジャッジ時間 6,629 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
32,444 KB
testcase_01 AC 40 ms
32,444 KB
testcase_02 AC 39 ms
32,444 KB
testcase_03 AC 39 ms
32,444 KB
testcase_04 AC 39 ms
32,444 KB
testcase_05 AC 38 ms
32,444 KB
testcase_06 AC 38 ms
32,444 KB
testcase_07 AC 39 ms
32,444 KB
testcase_08 AC 39 ms
32,444 KB
testcase_09 AC 39 ms
32,444 KB
testcase_10 AC 44 ms
32,444 KB
testcase_11 AC 41 ms
32,444 KB
testcase_12 AC 43 ms
32,444 KB
testcase_13 AC 42 ms
32,444 KB
testcase_14 AC 41 ms
32,444 KB
testcase_15 AC 42 ms
32,444 KB
testcase_16 AC 43 ms
32,444 KB
testcase_17 AC 44 ms
32,444 KB
testcase_18 AC 43 ms
32,444 KB
testcase_19 AC 43 ms
32,444 KB
testcase_20 AC 49 ms
32,444 KB
testcase_21 AC 45 ms
32,444 KB
testcase_22 AC 45 ms
32,444 KB
testcase_23 AC 38 ms
32,444 KB
testcase_24 AC 38 ms
32,444 KB
testcase_25 AC 39 ms
32,444 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$sum=0;
$wcount =0;
$in = trim(fgets(STDIN));
for($i=0;$i<strlen($in);$i++){
    $current = strlen($in)-$i-1;
    if($in[$current]=="w"){$wcount++;}
    else if($in[$current]=="c"){
        $temp=1;
        for($j=$wcount;$j>$wcount-2;$j--){$temp*=$j;}
        $temp/=2;
        $sum+=$temp;
    }
}
print $sum;
0