結果

問題 No.275 中央値を求めよ
ユーザー papinianuspapinianus
提出日時 2016-05-23 09:53:11
言語 PHP
(7.2.24)
結果
AC  
実行時間 15 ms / 1,000 ms
コード長 237 bytes
コンパイル時間 404 ms
実行使用メモリ 17,564 KB
最終ジャッジ日時 2023-01-22 21:11:08
合計ジャッジ時間 2,286 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
17,080 KB
testcase_01 AC 13 ms
17,068 KB
testcase_02 AC 14 ms
17,364 KB
testcase_03 AC 14 ms
17,268 KB
testcase_04 AC 13 ms
17,424 KB
testcase_05 AC 13 ms
17,132 KB
testcase_06 AC 13 ms
17,352 KB
testcase_07 AC 14 ms
17,140 KB
testcase_08 AC 14 ms
17,380 KB
testcase_09 AC 14 ms
17,460 KB
testcase_10 AC 14 ms
17,356 KB
testcase_11 AC 14 ms
17,096 KB
testcase_12 AC 13 ms
17,288 KB
testcase_13 AC 13 ms
17,272 KB
testcase_14 AC 14 ms
16,996 KB
testcase_15 AC 14 ms
17,464 KB
testcase_16 AC 15 ms
17,484 KB
testcase_17 AC 14 ms
17,540 KB
testcase_18 AC 13 ms
17,180 KB
testcase_19 AC 14 ms
17,384 KB
testcase_20 AC 14 ms
17,452 KB
testcase_21 AC 14 ms
17,036 KB
testcase_22 AC 14 ms
17,516 KB
testcase_23 AC 14 ms
17,260 KB
testcase_24 AC 14 ms
17,420 KB
testcase_25 AC 14 ms
17,316 KB
testcase_26 AC 14 ms
17,336 KB
testcase_27 AC 14 ms
17,292 KB
testcase_28 AC 14 ms
17,332 KB
testcase_29 AC 14 ms
17,364 KB
testcase_30 AC 14 ms
17,040 KB
testcase_31 AC 14 ms
17,272 KB
testcase_32 AC 14 ms
17,152 KB
testcase_33 AC 13 ms
17,488 KB
testcase_34 AC 13 ms
17,212 KB
testcase_35 AC 14 ms
17,564 KB
testcase_36 AC 14 ms
17,472 KB
testcase_37 AC 13 ms
17,268 KB
testcase_38 AC 13 ms
17,464 KB
testcase_39 AC 13 ms
17,264 KB
testcase_40 AC 14 ms
17,452 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$n = trim(fgets(STDIN));
$floorn = floor($n/2);
$nums = explode(' ', trim(fgets(STDIN)));
sort($nums);

if(($n / 2) != $floorn){
    echo $nums[$floorn].PHP_EOL;
} else {
    echo (($nums[$floorn] + $nums[$floorn-1]) /2).PHP_EOL;
}
0