結果

問題 No.21 平均の差
ユーザー 💕💖💞💕💖💞
提出日時 2017-04-08 18:32:42
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 313 ms / 5,000 ms
コード長 1,436 bytes
コンパイル時間 11,271 ms
コンパイル使用メモリ 435,560 KB
実行使用メモリ 56,820 KB
最終ジャッジ日時 2024-04-30 13:08:25
合計ジャッジ時間 15,188 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 312 ms
56,800 KB
testcase_01 AC 310 ms
56,724 KB
testcase_02 AC 308 ms
56,744 KB
testcase_03 AC 313 ms
56,820 KB
testcase_04 AC 312 ms
56,776 KB
testcase_05 AC 312 ms
56,764 KB
testcase_06 AC 313 ms
56,816 KB
testcase_07 AC 303 ms
56,800 KB
testcase_08 AC 308 ms
56,716 KB
testcase_09 AC 310 ms
56,712 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {                                                                                                                                                                             
         ^
Main.kt:7:21: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Int
  println(eval.max()!! - eval.min()!!)                                                                                                                                                                      
                    ^
Main.kt:7:36: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Int
  println(eval.max()!! - eval.min()!!)                                                                                                                                                                      
                                   ^

ソースコード

diff #

fun main(args: Array<String>) {                                                                                                                                                                             
  val n = readLine()!!.toInt()                                                                                                                                                                              
  readLine()                                                                                                                                                                                                
  val eval = (1..n).map {                                                                                                                                                                                   
    readLine()!!.toInt()                                                                                                                                                                                    
  }.toList()                                                                                                                                                                                                
  println(eval.max()!! - eval.min()!!)                                                                                                                                                                      
}
0