結果
問題 |
No.548 国士無双
|
ユーザー |
![]() |
提出日時 | 2019-08-24 09:11:37 |
言語 | Kotlin (2.1.0) |
結果 |
AC
|
実行時間 | 332 ms / 2,000 ms |
コード長 | 396 bytes |
コンパイル時間 | 11,003 ms |
コンパイル使用メモリ | 434,032 KB |
実行使用メモリ | 54,948 KB |
最終ジャッジ日時 | 2024-11-20 19:24:57 |
合計ジャッジ時間 | 19,790 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used fun main(args: Array<String>){ ^ Main.kt:8:76: warning: unnecessary non-null assertion (!!) on a non-null receiver of type List<Char> val ans = "abcdefghijklm".toList().filter { !arr.contains(it) }!!.first() ^
ソースコード
fun main(args: Array<String>){ val arr = readLine()!!.toList() when { arr.distinct().size == arr.size -> { arr.sorted().forEach{ println(it)} } arr.distinct().size + 1 == arr.size -> { val ans = "abcdefghijklm".toList().filter { !arr.contains(it) }!!.first() println(ans) } else -> println("Impossible") } }