結果
問題 |
No.21 平均の差
|
ユーザー |
![]() |
提出日時 | 2018-09-28 02:09:41 |
言語 | Kotlin (2.1.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 230 bytes |
コンパイル時間 | 12,588 ms |
コンパイル使用メモリ | 437,580 KB |
実行使用メモリ | 56,940 KB |
最終ジャッジ日時 | 2024-11-20 16:50:36 |
合計ジャッジ時間 | 14,790 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 WA * 5 |
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used fun main(args: Array<String>) { ^ Main.kt:3:6: warning: variable 'K' is never used val K = readLine()!!.toInt() ^ Main.kt:12:17: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Int println(a.max()!! - a.min()!!) ^ Main.kt:12:29: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Int println(a.max()!! - a.min()!!) ^
ソースコード
fun main(args: Array<String>) { val N = readLine()!!.toInt() val K = readLine()!!.toInt() val a = mutableListOf(N, 0) a.forEachIndexed { i, _ -> val n = readLine()!!.toInt() a[i] = n } println(a.max()!! - a.min()!!) }