結果

問題 No.275 中央値を求めよ
ユーザー ねずねず
提出日時 2018-01-25 08:38:03
言語 PHP8
(8.1.3)
結果
AC  
実行時間 6 ms / 1,000 ms
コード長 137 bytes
コンパイル時間 667 ms
使用メモリ 10,748 KB
最終ジャッジ日時 2023-01-22 22:50:45
合計ジャッジ時間 1,952 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 6 ms
10,472 KB
testcase_01 AC 5 ms
10,568 KB
testcase_02 AC 6 ms
10,624 KB
testcase_03 AC 6 ms
10,556 KB
testcase_04 AC 6 ms
10,456 KB
testcase_05 AC 6 ms
10,592 KB
testcase_06 AC 6 ms
10,644 KB
testcase_07 AC 6 ms
10,612 KB
testcase_08 AC 6 ms
10,600 KB
testcase_09 AC 5 ms
10,604 KB
testcase_10 AC 5 ms
10,648 KB
testcase_11 AC 6 ms
10,556 KB
testcase_12 AC 5 ms
10,616 KB
testcase_13 AC 6 ms
10,576 KB
testcase_14 AC 6 ms
10,512 KB
testcase_15 AC 6 ms
10,696 KB
testcase_16 AC 6 ms
10,748 KB
testcase_17 AC 6 ms
10,688 KB
testcase_18 AC 5 ms
10,560 KB
testcase_19 AC 6 ms
10,712 KB
testcase_20 AC 6 ms
10,560 KB
testcase_21 AC 6 ms
10,600 KB
testcase_22 AC 6 ms
10,596 KB
testcase_23 AC 6 ms
10,668 KB
testcase_24 AC 6 ms
10,544 KB
testcase_25 AC 6 ms
10,576 KB
testcase_26 AC 6 ms
10,640 KB
testcase_27 AC 6 ms
10,536 KB
testcase_28 AC 5 ms
10,628 KB
testcase_29 AC 6 ms
10,552 KB
testcase_30 AC 6 ms
10,580 KB
testcase_31 AC 6 ms
10,664 KB
testcase_32 AC 6 ms
10,636 KB
testcase_33 AC 6 ms
10,700 KB
testcase_34 AC 5 ms
10,648 KB
testcase_35 AC 6 ms
10,580 KB
testcase_36 AC 6 ms
10,652 KB
testcase_37 AC 6 ms
10,552 KB
testcase_38 AC 6 ms
10,656 KB
testcase_39 AC 5 ms
10,664 KB
testcase_40 AC 6 ms
10,704 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$n = trim(fgets(STDIN));
$a = explode(' ', trim(fgets(STDIN)));
sort($a);
print $n % 2 ? $a[($n-1)/2] : ($a[$n/2]+$a[$n/2-1])/2;
?>
0