結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
31,116 KB
testcase_01 AC 42 ms
31,292 KB
testcase_02 AC 41 ms
31,284 KB
testcase_03 AC 41 ms
30,908 KB
testcase_04 AC 42 ms
31,212 KB
testcase_05 AC 42 ms
31,048 KB
testcase_06 AC 42 ms
31,220 KB
testcase_07 AC 42 ms
30,968 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 45 ms
31,480 KB
testcase_11 WA -
testcase_12 AC 40 ms
31,124 KB
testcase_13 AC 42 ms
30,976 KB
testcase_14 AC 41 ms
31,248 KB
testcase_15 AC 42 ms
31,124 KB
testcase_16 AC 42 ms
31,208 KB
testcase_17 AC 44 ms
31,228 KB
testcase_18 AC 40 ms
31,240 KB
testcase_19 WA -
testcase_20 AC 43 ms
31,148 KB
testcase_21 AC 40 ms
31,104 KB
testcase_22 AC 42 ms
31,236 KB
testcase_23 WA -
testcase_24 AC 42 ms
31,020 KB
testcase_25 AC 42 ms
31,224 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 44 ms
31,468 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 42 ms
31,212 KB
testcase_38 AC 40 ms
31,004 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