結果

問題 No.548 国士無双
ユーザー 💕💖💞💕💖💞
提出日時 2017-09-10 02:24:29
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 364 ms / 2,000 ms
コード長 590 bytes
コンパイル時間 12,861 ms
コンパイル使用メモリ 437,972 KB
実行使用メモリ 60,640 KB
最終ジャッジ日時 2024-04-30 15:49:45
合計ジャッジ時間 22,717 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 356 ms
60,588 KB
testcase_01 AC 357 ms
60,560 KB
testcase_02 AC 364 ms
60,596 KB
testcase_03 AC 350 ms
60,632 KB
testcase_04 AC 355 ms
60,516 KB
testcase_05 AC 353 ms
60,492 KB
testcase_06 AC 354 ms
60,588 KB
testcase_07 AC 354 ms
60,640 KB
testcase_08 AC 355 ms
60,528 KB
testcase_09 AC 353 ms
60,624 KB
testcase_10 AC 357 ms
60,508 KB
testcase_11 AC 359 ms
60,524 KB
testcase_12 AC 353 ms
60,584 KB
testcase_13 AC 349 ms
60,528 KB
testcase_14 AC 352 ms
60,612 KB
testcase_15 AC 356 ms
60,596 KB
testcase_16 AC 353 ms
60,492 KB
testcase_17 AC 352 ms
60,532 KB
testcase_18 AC 352 ms
60,580 KB
testcase_19 AC 356 ms
60,608 KB
testcase_20 AC 358 ms
60,512 KB
testcase_21 AC 357 ms
60,524 KB
testcase_22 AC 353 ms
60,628 KB
testcase_23 AC 355 ms
60,500 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