結果

問題 No.716 距離
ユーザー 💕💖💞💕💖💞
提出日時 2018-08-01 00:12:15
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 348 ms / 2,000 ms
コード長 293 bytes
コンパイル時間 12,414 ms
コンパイル使用メモリ 445,760 KB
実行使用メモリ 60,616 KB
最終ジャッジ日時 2024-04-30 19:05:53
合計ジャッジ時間 27,556 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 348 ms
60,480 KB
testcase_01 AC 345 ms
60,564 KB
testcase_02 AC 339 ms
60,388 KB
testcase_03 AC 342 ms
60,600 KB
testcase_04 AC 343 ms
60,512 KB
testcase_05 AC 345 ms
60,552 KB
testcase_06 AC 344 ms
60,520 KB
testcase_07 AC 321 ms
60,240 KB
testcase_08 AC 312 ms
60,432 KB
testcase_09 AC 313 ms
60,400 KB
testcase_10 AC 329 ms
60,476 KB
testcase_11 AC 323 ms
60,360 KB
testcase_12 AC 343 ms
60,600 KB
testcase_13 AC 331 ms
60,404 KB
testcase_14 AC 317 ms
60,308 KB
testcase_15 AC 335 ms
60,436 KB
testcase_16 AC 335 ms
60,384 KB
testcase_17 AC 347 ms
60,432 KB
testcase_18 AC 324 ms
60,372 KB
testcase_19 AC 329 ms
60,428 KB
testcase_20 AC 319 ms
60,436 KB
testcase_21 AC 327 ms
60,508 KB
testcase_22 AC 337 ms
60,360 KB
testcase_23 AC 327 ms
60,336 KB
testcase_24 AC 341 ms
60,552 KB
testcase_25 AC 334 ms
60,368 KB
testcase_26 AC 336 ms
60,448 KB
testcase_27 AC 341 ms
60,608 KB
testcase_28 AC 327 ms
60,296 KB
testcase_29 AC 340 ms
60,392 KB
testcase_30 AC 339 ms
60,408 KB
testcase_31 AC 335 ms
60,616 KB
testcase_32 AC 337 ms
60,596 KB
testcase_33 AC 338 ms
60,584 KB
testcase_34 AC 337 ms
60,544 KB
testcase_35 AC 322 ms
60,384 KB
testcase_36 AC 329 ms
60,504 KB
testcase_37 AC 325 ms
60,420 KB
testcase_38 AC 330 ms
60,380 KB
testcase_39 AC 337 ms
60,436 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args:Array<String>) {
         ^
Main.kt:5:41: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Int
  val min = zs.slice(1..zs.size-1).min()!!
                                        ^

ソースコード

diff #

fun main(args:Array<String>) {
  readLine()
  val xs = readLine()!!.split(" ").map(String::toInt).toMutableList()
  val zs = (listOf( 0 ) + xs).zip(xs).map { (f1, f2) -> f2 - f1 }
  val min = zs.slice(1..zs.size-1).min()!!
  val ys = xs.sorted()
  println("$min\n${ys.last() - ys.first()}" )
}
0