結果

問題 No.275 中央値を求めよ
ユーザー clef_delphclef_delph
提出日時 2020-02-18 23:57:28
言語 PHP
(8.3.4)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 219 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 30,748 KB
実行使用メモリ 31,580 KB
最終ジャッジ日時 2024-04-16 04:20:33
合計ジャッジ時間 3,019 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
31,024 KB
testcase_01 AC 42 ms
31,004 KB
testcase_02 AC 49 ms
31,484 KB
testcase_03 WA -
testcase_04 AC 41 ms
30,848 KB
testcase_05 AC 41 ms
31,260 KB
testcase_06 AC 42 ms
31,216 KB
testcase_07 AC 42 ms
31,372 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 41 ms
31,456 KB
testcase_11 WA -
testcase_12 AC 41 ms
31,084 KB
testcase_13 WA -
testcase_14 AC 41 ms
31,192 KB
testcase_15 AC 42 ms
31,316 KB
testcase_16 AC 42 ms
31,008 KB
testcase_17 AC 41 ms
31,196 KB
testcase_18 AC 41 ms
31,244 KB
testcase_19 WA -
testcase_20 AC 42 ms
31,216 KB
testcase_21 AC 42 ms
30,832 KB
testcase_22 AC 42 ms
31,336 KB
testcase_23 WA -
testcase_24 AC 42 ms
31,136 KB
testcase_25 AC 42 ms
31,088 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 42 ms
31,280 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 42 ms
31,152 KB
testcase_38 AC 43 ms
31,368 KB
testcase_39 WA -
testcase_40 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$num=trim(fgets(STDIN));
$data=explode(" ",trim(fgets(STDIN)));
$centerNum=($num/2)-1;

sort($data);

if ($num%2==1){
    echo $data[$centerNum+1];
}else{
    echo ($data[$centerNum]+$data[$centerNum+1])/2;
}


?>
0