結果
問題 | No.21 平均の差 |
ユーザー | toshiro_yanagi |
提出日時 | 2018-09-28 01:37:23 |
言語 | Kotlin (1.9.23) |
結果 |
AC
|
実行時間 | 313 ms / 5,000 ms |
コード長 | 226 bytes |
コンパイル時間 | 11,520 ms |
コンパイル使用メモリ | 435,228 KB |
実行使用メモリ | 56,804 KB |
最終ジャッジ日時 | 2024-04-30 19:17:48 |
合計ジャッジ時間 | 15,867 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 308 ms
56,640 KB |
testcase_01 | AC | 307 ms
56,640 KB |
testcase_02 | AC | 311 ms
56,616 KB |
testcase_03 | AC | 306 ms
56,768 KB |
testcase_04 | AC | 307 ms
56,732 KB |
testcase_05 | AC | 309 ms
56,752 KB |
testcase_06 | AC | 304 ms
56,652 KB |
testcase_07 | AC | 304 ms
56,804 KB |
testcase_08 | AC | 313 ms
56,668 KB |
testcase_09 | AC | 311 ms
56,660 KB |
コンパイルメッセージ
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:11:17: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Int println(a.max()!! - a.min()!!) ^ Main.kt:11: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<Int>() for (i in 0 until N) { val n = readLine()!!.toInt() a.add(n) } println(a.max()!! - a.min()!!) }