結果

問題 No.548 国士無双
ユーザー バカらっくバカらっく
提出日時 2019-08-24 09:11:37
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 305 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 12,427 ms
コンパイル使用メモリ 416,116 KB
実行使用メモリ 56,896 KB
最終ジャッジ日時 2023-08-13 02:56:04
合計ジャッジ時間 19,763 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 289 ms
52,656 KB
testcase_01 AC 288 ms
53,120 KB
testcase_02 AC 286 ms
52,776 KB
testcase_03 AC 286 ms
52,792 KB
testcase_04 AC 287 ms
52,868 KB
testcase_05 AC 288 ms
52,712 KB
testcase_06 AC 305 ms
52,924 KB
testcase_07 AC 296 ms
54,540 KB
testcase_08 AC 283 ms
52,700 KB
testcase_09 AC 286 ms
52,816 KB
testcase_10 AC 289 ms
52,816 KB
testcase_11 AC 280 ms
52,732 KB
testcase_12 AC 286 ms
52,840 KB
testcase_13 AC 279 ms
53,076 KB
testcase_14 AC 280 ms
52,652 KB
testcase_15 AC 290 ms
52,980 KB
testcase_16 AC 304 ms
52,892 KB
testcase_17 AC 288 ms
52,700 KB
testcase_18 AC 282 ms
52,796 KB
testcase_19 AC 279 ms
52,772 KB
testcase_20 AC 292 ms
52,684 KB
testcase_21 AC 285 ms
52,740 KB
testcase_22 AC 278 ms
52,712 KB
testcase_23 AC 301 ms
56,896 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.sorted().forEach{ println(it)}
        }
        arr.distinct().size + 1 == arr.size -> {
            val ans = "abcdefghijklm".toList().filter { !arr.contains(it) }!!.first()
            println(ans)
        }
        else -> println("Impossible")
    }
}
0