結果

問題 No.21 平均の差
ユーザー komkomhkomkomh
提出日時 2019-06-06 13:59:53
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 320 ms / 5,000 ms
コード長 253 bytes
コンパイル時間 11,702 ms
コンパイル使用メモリ 430,584 KB
実行使用メモリ 56,968 KB
最終ジャッジ日時 2024-04-30 20:51:59
合計ジャッジ時間 15,822 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 314 ms
56,900 KB
testcase_01 AC 316 ms
56,820 KB
testcase_02 AC 320 ms
56,852 KB
testcase_03 AC 319 ms
56,944 KB
testcase_04 AC 317 ms
56,944 KB
testcase_05 AC 316 ms
56,892 KB
testcase_06 AC 314 ms
56,928 KB
testcase_07 AC 317 ms
56,928 KB
testcase_08 AC 314 ms
56,968 KB
testcase_09 AC 313 ms
56,784 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:5:9: warning: variable 'K' is never used
    val K = readLine()!!.toInt()
        ^
Main.kt:8:28: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Int
    val max = numbers.max()!!
                           ^
Main.kt:9:28: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Int
    val min = numbers.min()!!
                           ^

ソースコード

diff #

package yukicoder

fun main() {
    val N = readLine()!!.toInt()
    val K = readLine()!!.toInt()
    val numbers: List<Int> = (0 until N).map { readLine()!!.toInt() }

    val max = numbers.max()!!
    val min = numbers.min()!!
    println(max - min)
}
0