結果

問題 No.548 国士無双
ユーザー バカらっく
提出日時 2019-08-24 09:10:04
言語 Kotlin
(2.1.0)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 10,198 ms
コンパイル使用メモリ 435,996 KB
実行使用メモリ 57,072 KB
最終ジャッジ日時 2024-11-20 19:24:17
合計ジャッジ時間 18,291 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
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()
                                                                           ^

ソースコード

diff #

fun main(args: Array<String>){
    val arr = readLine()!!.toList()
    when {
        arr.distinct().size == arr.size -> {
            arr.forEach{ println(it)}
        }
        arr.distinct().size + 1 == arr.size -> {
            val ans = "abcdefghijklm".toList().filter { !arr.contains(it) }!!.first()
            println(ans)
        }
        else -> println("Impossible")
    }
}
0