結果

問題 No.716 距離
ユーザー komkomhkomkomh
提出日時 2019-06-11 13:16:04
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 316 ms / 2,000 ms
コード長 256 bytes
コンパイル時間 10,131 ms
コンパイル使用メモリ 438,816 KB
実行使用メモリ 57,380 KB
最終ジャッジ日時 2024-04-30 21:02:01
合計ジャッジ時間 22,867 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 296 ms
57,264 KB
testcase_01 AC 298 ms
57,324 KB
testcase_02 AC 295 ms
57,264 KB
testcase_03 AC 295 ms
57,244 KB
testcase_04 AC 294 ms
57,244 KB
testcase_05 AC 300 ms
57,272 KB
testcase_06 AC 292 ms
57,248 KB
testcase_07 AC 268 ms
57,048 KB
testcase_08 AC 268 ms
57,024 KB
testcase_09 AC 268 ms
56,988 KB
testcase_10 AC 292 ms
57,116 KB
testcase_11 AC 284 ms
57,272 KB
testcase_12 AC 296 ms
57,156 KB
testcase_13 AC 290 ms
57,060 KB
testcase_14 AC 266 ms
57,012 KB
testcase_15 AC 285 ms
57,100 KB
testcase_16 AC 285 ms
57,300 KB
testcase_17 AC 286 ms
57,204 KB
testcase_18 AC 273 ms
57,156 KB
testcase_19 AC 285 ms
57,136 KB
testcase_20 AC 272 ms
57,112 KB
testcase_21 AC 278 ms
57,180 KB
testcase_22 AC 282 ms
57,104 KB
testcase_23 AC 278 ms
57,084 KB
testcase_24 AC 294 ms
57,228 KB
testcase_25 AC 316 ms
57,144 KB
testcase_26 AC 287 ms
57,320 KB
testcase_27 AC 292 ms
57,252 KB
testcase_28 AC 283 ms
57,008 KB
testcase_29 AC 292 ms
57,244 KB
testcase_30 AC 288 ms
57,196 KB
testcase_31 AC 287 ms
57,360 KB
testcase_32 AC 293 ms
57,380 KB
testcase_33 AC 284 ms
57,328 KB
testcase_34 AC 279 ms
57,200 KB
testcase_35 AC 270 ms
57,052 KB
testcase_36 AC 280 ms
57,192 KB
testcase_37 AC 275 ms
57,052 KB
testcase_38 AC 280 ms
57,304 KB
testcase_39 AC 286 ms
57,296 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