結果

問題 No.21 平均の差
ユーザー 💕💖💞💕💖💞
提出日時 2017-04-08 18:32:42
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 280 ms / 5,000 ms
コード長 1,436 bytes
コンパイル時間 14,038 ms
コンパイル使用メモリ 410,860 KB
実行使用メモリ 53,180 KB
最終ジャッジ日時 2023-08-12 18:01:33
合計ジャッジ時間 16,974 ms
ジャッジサーバーID
(参考情報)
judge14 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 273 ms
52,536 KB
testcase_01 AC 275 ms
52,416 KB
testcase_02 AC 264 ms
52,660 KB
testcase_03 AC 270 ms
52,600 KB
testcase_04 AC 280 ms
52,504 KB
testcase_05 AC 276 ms
52,724 KB
testcase_06 AC 270 ms
52,428 KB
testcase_07 AC 262 ms
53,180 KB
testcase_08 AC 262 ms
52,636 KB
testcase_09 AC 272 ms
52,368 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