結果

問題 No.275 中央値を求めよ
ユーザー da_louisda_louis
提出日時 2020-02-07 00:41:15
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 373 ms / 1,000 ms
コード長 269 bytes
コンパイル時間 11,874 ms
コンパイル使用メモリ 431,336 KB
実行使用メモリ 59,656 KB
最終ジャッジ日時 2023-10-25 22:53:28
合計ジャッジ時間 27,900 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 339 ms
58,728 KB
testcase_01 AC 335 ms
58,720 KB
testcase_02 AC 344 ms
58,768 KB
testcase_03 AC 336 ms
58,712 KB
testcase_04 AC 333 ms
58,716 KB
testcase_05 AC 335 ms
58,720 KB
testcase_06 AC 338 ms
58,756 KB
testcase_07 AC 351 ms
59,628 KB
testcase_08 AC 336 ms
58,768 KB
testcase_09 AC 341 ms
58,788 KB
testcase_10 AC 340 ms
58,788 KB
testcase_11 AC 318 ms
54,472 KB
testcase_12 AC 335 ms
58,684 KB
testcase_13 AC 337 ms
58,700 KB
testcase_14 AC 331 ms
58,704 KB
testcase_15 AC 369 ms
59,576 KB
testcase_16 AC 373 ms
59,628 KB
testcase_17 AC 367 ms
59,576 KB
testcase_18 AC 352 ms
58,836 KB
testcase_19 AC 358 ms
59,632 KB
testcase_20 AC 362 ms
59,644 KB
testcase_21 AC 355 ms
59,632 KB
testcase_22 AC 369 ms
59,648 KB
testcase_23 AC 367 ms
59,644 KB
testcase_24 AC 358 ms
58,820 KB
testcase_25 AC 368 ms
59,572 KB
testcase_26 AC 369 ms
59,656 KB
testcase_27 AC 367 ms
59,644 KB
testcase_28 AC 341 ms
58,760 KB
testcase_29 AC 356 ms
59,632 KB
testcase_30 AC 346 ms
58,756 KB
testcase_31 AC 359 ms
59,644 KB
testcase_32 AC 350 ms
58,784 KB
testcase_33 AC 355 ms
59,644 KB
testcase_34 AC 333 ms
58,756 KB
testcase_35 AC 354 ms
59,644 KB
testcase_36 AC 352 ms
59,628 KB
testcase_37 AC 340 ms
58,780 KB
testcase_38 AC 351 ms
58,824 KB
testcase_39 AC 342 ms
58,836 KB
testcase_40 AC 357 ms
59,572 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun main(args: Array<String>) {
    p746()
}

fun p746() {
    val n = readLine()!!.toInt()
    val aList = readLine()!!.split(' ').map { it.toDouble() }

    val sorted = aList.sorted()
    val answer = (sorted[(n - 1) / 2] + sorted[n / 2]) / 2

    println(answer)
}
0