結果

問題 No.21 平均の差
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2018-09-28 02:09:41
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 230 bytes
コンパイル時間 10,523 ms
コンパイル使用メモリ 434,212 KB
実行使用メモリ 57,096 KB
最終ジャッジ日時 2024-04-30 19:18:12
合計ジャッジ時間 14,217 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 279 ms
56,708 KB
testcase_01 AC 283 ms
56,680 KB
testcase_02 WA -
testcase_03 AC 283 ms
56,824 KB
testcase_04 AC 286 ms
56,760 KB
testcase_05 WA -
testcase_06 AC 284 ms
56,780 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 = mutableListOf(N, 0)

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

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