結果

問題 No.516 赤と青の風船
ユーザー dyechidyechi
提出日時 2019-04-06 15:10:36
言語 PHP
(8.3.4)
結果
AC  
実行時間 8 ms / 2,000 ms
コード長 328 bytes
コンパイル時間 204 ms
コンパイル使用メモリ 12,116 KB
実行使用メモリ 12,316 KB
最終ジャッジ日時 2023-09-06 04:20:49
合計ジャッジ時間 1,010 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
12,288 KB
testcase_01 AC 7 ms
12,200 KB
testcase_02 AC 7 ms
12,276 KB
testcase_03 AC 7 ms
12,268 KB
testcase_04 AC 7 ms
12,316 KB
testcase_05 AC 7 ms
12,264 KB
testcase_06 AC 8 ms
12,244 KB
testcase_07 AC 7 ms
12,216 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
while ($line = fgets(STDIN)) {
	$s[] = trim($line);
}

$RED_counter = 0;
$BLUE_counter = 0;
foreach ($s as $key => $value) {
    if ($value === "RED") {
        $RED_counter++;
    } else {
        $BLUE_counter++;
    }
}

if ($RED_counter > $BLUE_counter) {
    echo "RED".PHP_EOL;
} else {
    echo "BLUE".PHP_EOL;
}
?>
0