結果

問題 No.349 干支の置き物
ユーザー mesh1nekomesh1neko
提出日時 2016-05-14 16:10:10
言語 PHP
(8.3.4)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 269 bytes
コンパイル時間 2,867 ms
コンパイル使用メモリ 30,836 KB
実行使用メモリ 31,352 KB
最終ジャッジ日時 2024-04-28 14:49:02
合計ジャッジ時間 3,713 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
30,980 KB
testcase_01 AC 34 ms
31,352 KB
testcase_02 AC 36 ms
30,968 KB
testcase_03 AC 33 ms
30,912 KB
testcase_04 AC 32 ms
31,016 KB
testcase_05 AC 33 ms
31,116 KB
testcase_06 AC 33 ms
31,348 KB
testcase_07 AC 33 ms
31,032 KB
testcase_08 AC 32 ms
31,224 KB
testcase_09 AC 37 ms
31,124 KB
testcase_10 AC 36 ms
31,056 KB
testcase_11 AC 34 ms
31,088 KB
testcase_12 AC 33 ms
31,144 KB
testcase_13 AC 35 ms
30,980 KB
testcase_14 AC 34 ms
31,096 KB
testcase_15 AC 34 ms
31,140 KB
testcase_16 AC 34 ms
30,832 KB
testcase_17 AC 33 ms
31,308 KB
testcase_18 AC 34 ms
30,976 KB
testcase_19 AC 34 ms
31,160 KB
testcase_20 AC 34 ms
31,240 KB
testcase_21 AC 34 ms
31,040 KB
testcase_22 AC 35 ms
31,304 KB
testcase_23 AC 36 ms
31,096 KB
testcase_24 AC 34 ms
31,036 KB
testcase_25 AC 36 ms
31,144 KB
testcase_26 AC 35 ms
31,324 KB
testcase_27 AC 35 ms
30,960 KB
testcase_28 AC 34 ms
30,908 KB
testcase_29 AC 34 ms
30,992 KB
testcase_30 AC 35 ms
31,276 KB
testcase_31 AC 37 ms
31,076 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$n = trim(fgets(STDIN));

$etos = array();

for ($i = 0; $i < $n; $i++) {
    $etos[] = trim(fgets(STDIN));
}

$cnt = count($etos);
$max = max(array_count_values($etos));

if ($max <= (($cnt + 1) / 2)) {
    echo "YES", PHP_EOL;
} else {
    echo "NO", PHP_EOL;
}
0