結果

問題 No.275 中央値を求めよ
ユーザー tazakkytazakky
提出日時 2017-09-12 14:46:03
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 298 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 30,800 KB
実行使用メモリ 31,572 KB
最終ジャッジ日時 2024-04-25 07:05:41
合計ジャッジ時間 3,652 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
30,780 KB
testcase_01 AC 41 ms
30,728 KB
testcase_02 AC 40 ms
30,668 KB
testcase_03 AC 42 ms
30,756 KB
testcase_04 AC 40 ms
30,652 KB
testcase_05 AC 39 ms
30,664 KB
testcase_06 AC 41 ms
30,836 KB
testcase_07 AC 41 ms
30,744 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 41 ms
30,708 KB
testcase_11 WA -
testcase_12 AC 41 ms
31,000 KB
testcase_13 AC 41 ms
30,824 KB
testcase_14 AC 40 ms
30,852 KB
testcase_15 AC 41 ms
30,848 KB
testcase_16 AC 41 ms
30,844 KB
testcase_17 AC 40 ms
30,664 KB
testcase_18 AC 40 ms
30,768 KB
testcase_19 WA -
testcase_20 AC 42 ms
30,696 KB
testcase_21 AC 40 ms
30,616 KB
testcase_22 AC 41 ms
30,788 KB
testcase_23 WA -
testcase_24 AC 41 ms
30,880 KB
testcase_25 AC 41 ms
30,824 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 41 ms
30,696 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 40 ms
30,668 KB
testcase_38 AC 41 ms
30,960 KB
testcase_39 WA -
testcase_40 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
    $n = trim(fgets(STDIN));
    $input = explode(" ",trim(fgets(STDIN)));
    //print_r($input);
    sort($input);
    if($n % 2 == 1){
        $c = floor($n % 2);
        echo $input[$c];
    }else{
        $c = $n / 2;
        echo round((($input[$c - 1] + $input[$c]) / 2), 1);
    }

?>
0