結果

問題 No.349 干支の置き物
ユーザー papinianuspapinianus
提出日時 2016-07-27 17:20:11
言語 PHP
(8.3.4)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 292 bytes
コンパイル時間 1,290 ms
コンパイル使用メモリ 30,752 KB
実行使用メモリ 31,336 KB
最終ジャッジ日時 2024-04-28 14:53:31
合計ジャッジ時間 3,239 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
31,112 KB
testcase_01 AC 33 ms
31,084 KB
testcase_02 AC 33 ms
31,232 KB
testcase_03 AC 34 ms
31,332 KB
testcase_04 AC 33 ms
31,124 KB
testcase_05 AC 34 ms
31,192 KB
testcase_06 AC 33 ms
31,128 KB
testcase_07 AC 32 ms
31,248 KB
testcase_08 AC 35 ms
31,000 KB
testcase_09 AC 33 ms
31,004 KB
testcase_10 AC 32 ms
30,684 KB
testcase_11 AC 34 ms
31,124 KB
testcase_12 AC 33 ms
30,908 KB
testcase_13 AC 34 ms
31,028 KB
testcase_14 AC 35 ms
31,056 KB
testcase_15 AC 33 ms
31,336 KB
testcase_16 AC 34 ms
31,084 KB
testcase_17 AC 33 ms
30,880 KB
testcase_18 AC 35 ms
30,920 KB
testcase_19 AC 37 ms
31,124 KB
testcase_20 AC 36 ms
30,900 KB
testcase_21 AC 35 ms
31,084 KB
testcase_22 AC 35 ms
31,124 KB
testcase_23 AC 36 ms
30,948 KB
testcase_24 AC 34 ms
30,936 KB
testcase_25 AC 35 ms
31,032 KB
testcase_26 AC 35 ms
31,116 KB
testcase_27 AC 34 ms
31,068 KB
testcase_28 AC 34 ms
30,980 KB
testcase_29 AC 35 ms
31,092 KB
testcase_30 AC 33 ms
30,928 KB
testcase_31 AC 34 ms
31,120 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$n = trim(fgets(STDIN));
$statue = [];
for($i=0;$i<$n;$i++) {
    $eto = trim(fgets(STDIN));
    if(isset($statue[$eto])) {
        $statue[$eto]++;
    } else {
        $statue[$eto] = 1;
    }
}
if(max($statue) <= ceil($n /2)) {
    echo "YES";
} else {
    echo "NO";
}
echo PHP_EOL;
0