結果

問題 No.712 赤旗
ユーザー dyechidyechi
提出日時 2019-03-28 16:40:43
言語 PHP
(8.3.4)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 31,884 KB
実行使用メモリ 32,272 KB
最終ジャッジ日時 2024-04-21 07:18:20
合計ジャッジ時間 1,163 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
32,272 KB
testcase_01 AC 42 ms
32,020 KB
testcase_02 AC 41 ms
32,020 KB
testcase_03 AC 42 ms
32,020 KB
testcase_04 AC 41 ms
32,148 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
while ($line = fgets(STDIN)) {
	$s[] = trim($line);
}
foreach ($s as $key => $value) {
	$array[] = explode(" ", $value);
}
$lines = array_splice($array, 0, 1);

$W_counter = 0;
for ($i=0; $i<$lines[0][0]; $i++) {
    if (strpos($array[$i][0], "W") !== false) {
        $W_counter += substr_count($array[$i][0], "W");
    }
}
echo $W_counter.PHP_EOL;
?>
0