結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
30,812 KB
testcase_01 AC 41 ms
30,716 KB
testcase_02 AC 40 ms
30,880 KB
testcase_03 AC 40 ms
30,652 KB
testcase_04 AC 43 ms
30,812 KB
testcase_05 AC 44 ms
30,656 KB
testcase_06 AC 41 ms
31,032 KB
testcase_07 AC 41 ms
30,848 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 41 ms
30,904 KB
testcase_11 WA -
testcase_12 AC 39 ms
30,752 KB
testcase_13 AC 41 ms
30,904 KB
testcase_14 AC 41 ms
30,844 KB
testcase_15 AC 41 ms
30,816 KB
testcase_16 AC 43 ms
30,864 KB
testcase_17 AC 41 ms
30,612 KB
testcase_18 AC 42 ms
30,864 KB
testcase_19 WA -
testcase_20 AC 43 ms
30,624 KB
testcase_21 AC 41 ms
30,948 KB
testcase_22 AC 41 ms
30,668 KB
testcase_23 WA -
testcase_24 AC 40 ms
30,728 KB
testcase_25 AC 41 ms
30,520 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 41 ms
31,152 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 41 ms
31,076 KB
testcase_38 AC 40 ms
30,852 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