結果

問題 No.548 国士無双
ユーザー バカらっくバカらっく
提出日時 2019-08-24 09:10:04
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 11,937 ms
コンパイル使用メモリ 417,076 KB
実行使用メモリ 54,824 KB
最終ジャッジ日時 2023-08-13 02:55:23
合計ジャッジ時間 20,067 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 294 ms
52,836 KB
testcase_01 AC 289 ms
53,080 KB
testcase_02 AC 297 ms
53,384 KB
testcase_03 AC 292 ms
52,968 KB
testcase_04 AC 287 ms
52,820 KB
testcase_05 AC 293 ms
52,836 KB
testcase_06 AC 292 ms
53,000 KB
testcase_07 AC 289 ms
52,928 KB
testcase_08 AC 291 ms
53,104 KB
testcase_09 AC 292 ms
52,836 KB
testcase_10 AC 291 ms
52,932 KB
testcase_11 AC 293 ms
52,848 KB
testcase_12 AC 293 ms
54,824 KB
testcase_13 AC 293 ms
52,864 KB
testcase_14 AC 296 ms
52,704 KB
testcase_15 AC 296 ms
52,816 KB
testcase_16 AC 295 ms
52,928 KB
testcase_17 AC 297 ms
52,992 KB
testcase_18 AC 295 ms
52,836 KB
testcase_19 AC 297 ms
53,004 KB
testcase_20 AC 296 ms
52,920 KB
testcase_21 AC 299 ms
53,076 KB
testcase_22 AC 300 ms
52,912 KB
testcase_23 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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