結果

問題 No.716 距離
ユーザー komkomhkomkomh
提出日時 2019-06-11 13:16:04
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 346 ms / 2,000 ms
コード長 256 bytes
コンパイル時間 12,457 ms
コンパイル使用メモリ 418,708 KB
実行使用メモリ 54,904 KB
最終ジャッジ日時 2023-08-13 02:34:53
合計ジャッジ時間 28,130 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 328 ms
53,284 KB
testcase_01 AC 326 ms
53,340 KB
testcase_02 AC 328 ms
53,468 KB
testcase_03 AC 318 ms
53,184 KB
testcase_04 AC 330 ms
53,580 KB
testcase_05 AC 326 ms
53,312 KB
testcase_06 AC 346 ms
53,276 KB
testcase_07 AC 304 ms
52,920 KB
testcase_08 AC 308 ms
52,940 KB
testcase_09 AC 305 ms
53,096 KB
testcase_10 AC 322 ms
53,132 KB
testcase_11 AC 315 ms
53,128 KB
testcase_12 AC 331 ms
53,376 KB
testcase_13 AC 323 ms
53,168 KB
testcase_14 AC 302 ms
53,052 KB
testcase_15 AC 329 ms
53,096 KB
testcase_16 AC 318 ms
53,088 KB
testcase_17 AC 330 ms
53,328 KB
testcase_18 AC 310 ms
54,904 KB
testcase_19 AC 316 ms
53,256 KB
testcase_20 AC 300 ms
52,944 KB
testcase_21 AC 306 ms
53,084 KB
testcase_22 AC 309 ms
53,100 KB
testcase_23 AC 303 ms
53,080 KB
testcase_24 AC 314 ms
53,108 KB
testcase_25 AC 320 ms
53,148 KB
testcase_26 AC 312 ms
53,144 KB
testcase_27 AC 311 ms
53,140 KB
testcase_28 AC 300 ms
52,992 KB
testcase_29 AC 313 ms
53,140 KB
testcase_30 AC 326 ms
53,232 KB
testcase_31 AC 323 ms
53,364 KB
testcase_32 AC 318 ms
53,424 KB
testcase_33 AC 316 ms
53,256 KB
testcase_34 AC 315 ms
53,136 KB
testcase_35 AC 299 ms
52,976 KB
testcase_36 AC 306 ms
53,284 KB
testcase_37 AC 307 ms
53,024 KB
testcase_38 AC 313 ms
53,168 KB
testcase_39 AC 328 ms
53,108 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:4:9: warning: variable 'N' is never used
    val N = readLine()!!.toInt()
        ^
Main.kt:8:22: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Int
    val max = A.max()!! - A.min()!!
                     ^
Main.kt:8:34: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Int
    val max = A.max()!! - A.min()!!
                                 ^

ソースコード

diff #

package yukicoder

fun main() {
    val N = readLine()!!.toInt()
    val A = readLine()!!.split(" ").map(String::toInt)

    val min = (1 until A.size).map { A[it] - A[it - 1] }.min()
    val max = A.max()!! - A.min()!!

    println(min)
    println(max)
}
0