結果

問題 No.21 平均の差
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2018-09-28 02:13:50
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 293 ms / 5,000 ms
コード長 231 bytes
コンパイル時間 9,254 ms
コンパイル使用メモリ 434,508 KB
実行使用メモリ 56,812 KB
最終ジャッジ日時 2024-04-30 19:18:30
合計ジャッジ時間 12,716 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 255 ms
56,704 KB
testcase_01 AC 258 ms
56,760 KB
testcase_02 AC 256 ms
56,704 KB
testcase_03 AC 256 ms
56,652 KB
testcase_04 AC 249 ms
56,716 KB
testcase_05 AC 255 ms
56,780 KB
testcase_06 AC 261 ms
56,812 KB
testcase_07 AC 293 ms
56,760 KB
testcase_08 AC 276 ms
56,648 KB
testcase_09 AC 269 ms
56,664 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: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()!!)
                            ^

ソースコード

diff #

fun main(args: Array<String>) {
	val N = readLine()!!.toInt()
	val K = readLine()!!.toInt()

	val a = MutableList(N) { 0 }

	a.forEachIndexed { i, _ ->
		val n = readLine()!!.toInt()
		a[i] = n
	}

	println(a.max()!! - a.min()!!)
}
0