結果

問題 No.135 とりあえず1次元の問題
ユーザー minokasagominokasago
提出日時 2019-11-02 14:00:30
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 821 ms / 5,000 ms
コード長 203 bytes
コンパイル時間 11,532 ms
コンパイル使用メモリ 415,536 KB
実行使用メモリ 70,316 KB
最終ジャッジ日時 2023-10-13 01:23:55
合計ジャッジ時間 22,626 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 813 ms
70,316 KB
testcase_01 AC 302 ms
56,712 KB
testcase_02 AC 302 ms
58,540 KB
testcase_03 AC 293 ms
56,588 KB
testcase_04 AC 307 ms
56,912 KB
testcase_05 AC 308 ms
56,760 KB
testcase_06 AC 304 ms
56,976 KB
testcase_07 AC 311 ms
56,908 KB
testcase_08 AC 312 ms
56,736 KB
testcase_09 AC 308 ms
56,772 KB
testcase_10 AC 311 ms
56,644 KB
testcase_11 AC 310 ms
56,916 KB
testcase_12 AC 315 ms
57,084 KB
testcase_13 AC 314 ms
56,860 KB
testcase_14 AC 330 ms
57,188 KB
testcase_15 AC 313 ms
56,960 KB
testcase_16 AC 325 ms
57,028 KB
testcase_17 AC 358 ms
57,420 KB
testcase_18 AC 329 ms
56,644 KB
testcase_19 AC 327 ms
57,532 KB
testcase_20 AC 321 ms
57,068 KB
testcase_21 AC 523 ms
65,136 KB
testcase_22 AC 821 ms
69,888 KB
evil01.txt AC 664 ms
69,804 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:2:9: warning: variable 'N' is never used
    val N = readLine()!!.toInt()
        ^
Main.kt:4:77: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Int
    println(if (X.size < 2) 0 else (0..X.size-2).map { X[it+1]-X[it] }.min()!!)
                                                                            ^

ソースコード

diff #

fun main() {
    val N = readLine()!!.toInt()
    val X = readLine()!!.split(" ").map(String::toInt).sorted().distinct()
    println(if (X.size < 2) 0 else (0..X.size-2).map { X[it+1]-X[it] }.min()!!)
}
0