結果

問題 No.587 七対子
ユーザー 💕💖💞💕💖💞
提出日時 2018-03-07 12:19:42
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 298 ms / 2,000 ms
コード長 484 bytes
コンパイル時間 16,621 ms
コンパイル使用メモリ 420,824 KB
実行使用メモリ 53,496 KB
最終ジャッジ日時 2023-09-27 02:21:13
合計ジャッジ時間 24,362 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 291 ms
52,924 KB
testcase_01 AC 289 ms
52,972 KB
testcase_02 AC 291 ms
53,084 KB
testcase_03 AC 291 ms
53,288 KB
testcase_04 AC 287 ms
53,040 KB
testcase_05 AC 291 ms
53,008 KB
testcase_06 AC 291 ms
53,184 KB
testcase_07 AC 296 ms
53,040 KB
testcase_08 AC 293 ms
53,272 KB
testcase_09 AC 290 ms
52,988 KB
testcase_10 AC 292 ms
53,364 KB
testcase_11 AC 287 ms
52,892 KB
testcase_12 AC 291 ms
53,036 KB
testcase_13 AC 288 ms
53,156 KB
testcase_14 AC 291 ms
52,952 KB
testcase_15 AC 295 ms
53,188 KB
testcase_16 AC 295 ms
53,260 KB
testcase_17 AC 289 ms
53,152 KB
testcase_18 AC 297 ms
53,184 KB
testcase_19 AC 287 ms
53,496 KB
testcase_20 AC 289 ms
52,976 KB
testcase_21 AC 290 ms
53,180 KB
testcase_22 AC 295 ms
52,888 KB
testcase_23 AC 294 ms
53,136 KB
testcase_24 AC 298 ms
53,100 KB
testcase_25 AC 298 ms
52,796 KB
testcase_26 AC 293 ms
53,240 KB
testcase_27 AC 293 ms
52,788 KB
testcase_28 AC 292 ms
52,804 KB
testcase_29 AC 295 ms
53,012 KB
testcase_30 AC 295 ms
53,080 KB
testcase_31 AC 295 ms
53,104 KB
testcase_32 AC 291 ms
53,296 KB
testcase_33 AC 296 ms
52,912 KB
testcase_34 AC 294 ms
52,912 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args:Array<String>) {
         ^

ソースコード

diff #

fun main(args:Array<String>) {
  val cs = readLine()!!.toList().map { it.toString() }

  val char_freq = mutableMapOf<String, Int>()
  cs.map { c ->
    if( char_freq.get(c) == null )
      char_freq[c] = 0
    char_freq[c] = char_freq[c]!! + 1
  }
  val size1 = char_freq.toList().filter { it.second == 2 }.size
  val one = char_freq.toList().filter { it.second == 1 }

  when {
    one.size == 1 && size1 == 6 -> { println(one[0].first) }
    else -> { println("Impossible") }
  }
}
0