結果

問題 No.548 国士無双
ユーザー 💕💖💞💕💖💞
提出日時 2017-09-06 01:02:39
言語 Kotlin
(1.9.10)
結果
AC  
実行時間 300 ms / 2,000 ms
コード長 450 bytes
コンパイル時間 13,346 ms
コンパイル使用メモリ 423,952 KB
実行使用メモリ 57,776 KB
最終ジャッジ日時 2023-08-12 20:31:12
合計ジャッジ時間 21,804 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 277 ms
56,088 KB
testcase_01 AC 276 ms
56,092 KB
testcase_02 AC 281 ms
56,136 KB
testcase_03 AC 282 ms
55,920 KB
testcase_04 AC 288 ms
56,056 KB
testcase_05 AC 275 ms
55,948 KB
testcase_06 AC 282 ms
56,088 KB
testcase_07 AC 279 ms
55,944 KB
testcase_08 AC 300 ms
55,968 KB
testcase_09 AC 278 ms
56,148 KB
testcase_10 AC 288 ms
55,868 KB
testcase_11 AC 275 ms
55,928 KB
testcase_12 AC 285 ms
56,016 KB
testcase_13 AC 292 ms
56,084 KB
testcase_14 AC 297 ms
56,344 KB
testcase_15 AC 293 ms
56,228 KB
testcase_16 AC 284 ms
56,212 KB
testcase_17 AC 288 ms
56,288 KB
testcase_18 AC 289 ms
55,880 KB
testcase_19 AC 285 ms
56,108 KB
testcase_20 AC 287 ms
56,284 KB
testcase_21 AC 288 ms
57,776 KB
testcase_22 AC 284 ms
55,972 KB
testcase_23 AC 280 ms
56,120 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:11: warning: parameter 'args' is never used
fun main( args : Array<String> ) {
          ^
Main.kt:7:12: warning: variable 'k' is never used
      val (k, arr) = it
           ^

ソースコード

diff #

fun main( args : Array<String> ) {
  val a = readLine()!!
  "abcdefghijklm".map { x ->
    (a + x.toString()).groupBy {
      it
    }.map { 
      val (k, arr) = it
      arr.size
    }.sortedBy { it }.let {
      it == listOf(1,1,1,1,1,1,1,1,1,1,1,1,2)
    }.let { 
      Pair(x, it)
    }
  }.filter {
    it.second == true
  }.let { 
    when { 
      it.size >= 1 -> it.map { println(it.first)  } 
      else -> println("Impossible")
    }
  }
}
0