結果

問題 No.275 中央値を求めよ
ユーザー kagikakko_karikagikakko_kari
提出日時 2016-06-19 18:05:41
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 173 bytes
コンパイル時間 1,788 ms
コンパイル使用メモリ 30,968 KB
実行使用メモリ 31,304 KB
最終ジャッジ日時 2024-04-19 13:00:50
合計ジャッジ時間 5,153 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
30,800 KB
testcase_01 AC 34 ms
30,836 KB
testcase_02 AC 34 ms
31,028 KB
testcase_03 WA -
testcase_04 AC 34 ms
30,628 KB
testcase_05 AC 35 ms
31,144 KB
testcase_06 AC 36 ms
30,980 KB
testcase_07 AC 37 ms
30,896 KB
testcase_08 AC 36 ms
31,072 KB
testcase_09 AC 36 ms
31,028 KB
testcase_10 AC 33 ms
30,920 KB
testcase_11 WA -
testcase_12 AC 34 ms
30,860 KB
testcase_13 AC 35 ms
31,084 KB
testcase_14 AC 36 ms
31,032 KB
testcase_15 AC 34 ms
30,684 KB
testcase_16 AC 34 ms
31,036 KB
testcase_17 AC 36 ms
30,952 KB
testcase_18 AC 35 ms
30,904 KB
testcase_19 AC 36 ms
30,668 KB
testcase_20 AC 36 ms
31,304 KB
testcase_21 AC 35 ms
31,024 KB
testcase_22 AC 34 ms
31,188 KB
testcase_23 AC 34 ms
31,304 KB
testcase_24 AC 34 ms
30,896 KB
testcase_25 AC 35 ms
31,032 KB
testcase_26 AC 35 ms
31,148 KB
testcase_27 AC 36 ms
30,716 KB
testcase_28 AC 36 ms
31,032 KB
testcase_29 AC 36 ms
30,960 KB
testcase_30 AC 37 ms
30,868 KB
testcase_31 AC 36 ms
31,124 KB
testcase_32 AC 33 ms
31,080 KB
testcase_33 AC 36 ms
31,104 KB
testcase_34 AC 36 ms
31,032 KB
testcase_35 AC 35 ms
30,996 KB
testcase_36 AC 34 ms
31,040 KB
testcase_37 AC 33 ms
30,700 KB
testcase_38 AC 34 ms
30,880 KB
testcase_39 AC 35 ms
31,292 KB
testcase_40 AC 35 ms
31,068 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$n = trim(fgets(STDIN));
$a = explode(" ",fgets(STDIN));
sort($a);
if($n % 2 == 0){
echo ($a[$n / 2 - 1] + $a[$n / 2]) / 2 ."\n";
}else{
echo $a[($n - 1) / 2] ."\n";
}
0