結果

問題 No.21 平均の差
コンテスト
ユーザー バカらっく
提出日時 2019-09-02 00:05:26
言語 Kotlin
(2.3.20)
コンパイル:
kotlinc _filename_ -include-runtime -d main.jar
実行:
kotlin main.jar
結果
AC  
実行時間 271 ms / 5,000 ms
コード長 294 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 10,290 ms
コンパイル使用メモリ 452,812 KB
実行使用メモリ 52,364 KB
最終ジャッジ日時 2026-05-23 17:52:17
合計ジャッジ時間 17,075 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:10:26: warning: unnecessary non-null assertion (!!) on a non-null receiver of type 'Int'.
    val ans = items.max()!! - items.min()!!
                         ^^
Main.kt:10:42: warning: unnecessary non-null assertion (!!) on a non-null receiver of type 'Int'.
    val ans = items.max()!! - items.min()!!
                                         ^^

ソースコード

diff #
raw source code

fun main(args: Array<String>) {
    val inputCount = readLine()!!.toInt()
    val groupCount = readLine()!!.toInt()
    val items = mutableListOf<Int>()

    (1..inputCount).forEach {
        items.add(readLine()!!.toInt())
    }

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