結果
問題 | No.135 とりあえず1次元の問題 |
ユーザー |
![]() |
提出日時 | 2017-06-27 23:19:00 |
言語 | Kotlin (2.1.0) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 277 bytes |
コンパイル時間 | 13,766 ms |
コンパイル使用メモリ | 445,696 KB |
実行使用メモリ | 76,656 KB |
最終ジャッジ日時 | 2024-11-20 10:48:16 |
合計ジャッジ時間 | 25,329 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 RE * 1 |
コンパイルメッセージ
Main.kt:1:11: warning: parameter 'args' is never used fun main( args : Array<String> ) { ^ Main.kt:14:5: warning: expression under 'when' is never equal to null null -> println(0) ^
ソースコード
fun main( args : Array<String> ) { readLine() val bs = readLine()!! .split(" ") .map { it.toInt() } .toSet() .sorted() val ans = (0..bs.size-2).map { i -> bs[i+1] - bs[i] }.min() when(ans) { null -> println(0) else -> println(ans) } }