結果

問題 No.548 国士無双
ユーザー 14番14番
提出日時 2022-07-05 18:55:08
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 290 ms / 2,000 ms
コード長 484 bytes
コンパイル時間 12,826 ms
コンパイル使用メモリ 422,816 KB
実行使用メモリ 53,304 KB
最終ジャッジ日時 2023-08-22 08:12:12
合計ジャッジ時間 21,807 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 286 ms
53,100 KB
testcase_01 AC 285 ms
53,012 KB
testcase_02 AC 284 ms
53,072 KB
testcase_03 AC 290 ms
52,976 KB
testcase_04 AC 290 ms
52,924 KB
testcase_05 AC 287 ms
52,972 KB
testcase_06 AC 289 ms
52,936 KB
testcase_07 AC 283 ms
52,992 KB
testcase_08 AC 283 ms
53,236 KB
testcase_09 AC 285 ms
53,008 KB
testcase_10 AC 287 ms
53,032 KB
testcase_11 AC 283 ms
53,032 KB
testcase_12 AC 284 ms
53,140 KB
testcase_13 AC 286 ms
52,980 KB
testcase_14 AC 285 ms
53,292 KB
testcase_15 AC 281 ms
53,276 KB
testcase_16 AC 285 ms
53,304 KB
testcase_17 AC 283 ms
53,100 KB
testcase_18 AC 283 ms
53,016 KB
testcase_19 AC 286 ms
53,028 KB
testcase_20 AC 272 ms
52,828 KB
testcase_21 AC 282 ms
52,984 KB
testcase_22 AC 274 ms
52,848 KB
testcase_23 AC 284 ms
52,980 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun main(args: Array<String>) {
    println(getAns())
}

fun getAns():String {
    val chars = "abcdefghijklm"

    val s = readLine()!!

    val ans = mutableListOf<Char>()
    for(i in chars) {
        val tmp  = s + i
        if(chars.any { it !in tmp }) {
            continue
        }
        if(tmp.length != chars.length +1) {
            continue
        }
        ans.add(i)
    }
    if(ans.isEmpty()) {
        return "Impossible"
    }
    return ans.joinToString("\n")
}
0