結果

問題 No.548 国士無双
ユーザー 💕💖💞💕💖💞
提出日時 2017-09-10 02:24:29
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 328 ms / 2,000 ms
コード長 590 bytes
コンパイル時間 12,474 ms
コンパイル使用メモリ 420,352 KB
実行使用メモリ 58,724 KB
最終ジャッジ日時 2023-08-12 20:43:57
合計ジャッジ時間 21,865 ms
ジャッジサーバーID
(参考情報)
judge12 / judge8
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 323 ms
56,988 KB
testcase_01 AC 321 ms
56,864 KB
testcase_02 AC 321 ms
57,144 KB
testcase_03 AC 323 ms
56,844 KB
testcase_04 AC 323 ms
57,132 KB
testcase_05 AC 324 ms
56,956 KB
testcase_06 AC 320 ms
56,908 KB
testcase_07 AC 322 ms
56,828 KB
testcase_08 AC 322 ms
56,936 KB
testcase_09 AC 318 ms
56,868 KB
testcase_10 AC 315 ms
56,944 KB
testcase_11 AC 324 ms
56,908 KB
testcase_12 AC 320 ms
56,876 KB
testcase_13 AC 319 ms
57,136 KB
testcase_14 AC 324 ms
56,776 KB
testcase_15 AC 321 ms
56,940 KB
testcase_16 AC 321 ms
58,724 KB
testcase_17 AC 322 ms
56,964 KB
testcase_18 AC 321 ms
56,768 KB
testcase_19 AC 323 ms
56,984 KB
testcase_20 AC 324 ms
56,696 KB
testcase_21 AC 319 ms
57,156 KB
testcase_22 AC 328 ms
57,040 KB
testcase_23 AC 324 ms
56,912 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:11: warning: parameter 'args' is never used
fun main( args : Array<String> ) {
          ^

ソースコード

diff #

fun main( args : Array<String> ) {
  val bs = readLine()!!
  val cs = "abcdefghijklm".map { x ->
    val mm = (bs + x.toString())
      .toList()
      .groupBy { 
        it
      }.map { 
        val (k, arr) = it
        Pair(k, arr.size)
      }.toMap()
    val res = "abcdefghijklm".map {
      mm[it]
    }.sortedBy { 
      it 
    }.let { 
      when { 
        it.joinToString("") == "1111111111112" -> x
        else -> null
      }
    }
    res
  }.filter {
    it != null
  }
  when {
    cs.size == 0 -> println("Impossible")
    else -> cs.map {
      println(it)
    }
  }
}
0