結果

問題 No.313 π
ユーザー くわいくわい
提出日時 2015-12-10 01:00:17
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 1,129 ms / 5,000 ms
コード長 641 bytes
コンパイル時間 13,002 ms
コンパイル使用メモリ 262,824 KB
実行使用メモリ 64,192 KB
最終ジャッジ日時 2023-09-11 22:39:30
合計ジャッジ時間 53,491 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,120 ms
63,300 KB
testcase_01 AC 1,111 ms
63,368 KB
testcase_02 AC 1,105 ms
64,192 KB
testcase_03 AC 1,104 ms
63,372 KB
testcase_04 AC 1,098 ms
63,276 KB
testcase_05 AC 1,101 ms
63,300 KB
testcase_06 AC 1,105 ms
63,224 KB
testcase_07 AC 1,099 ms
63,168 KB
testcase_08 AC 1,102 ms
63,244 KB
testcase_09 AC 1,103 ms
63,184 KB
testcase_10 AC 1,098 ms
63,124 KB
testcase_11 AC 1,109 ms
63,340 KB
testcase_12 AC 1,115 ms
63,228 KB
testcase_13 AC 1,091 ms
63,452 KB
testcase_14 AC 1,113 ms
63,308 KB
testcase_15 AC 1,125 ms
63,332 KB
testcase_16 AC 1,119 ms
63,208 KB
testcase_17 AC 1,129 ms
63,204 KB
testcase_18 AC 1,127 ms
63,236 KB
testcase_19 AC 1,117 ms
63,208 KB
testcase_20 AC 1,113 ms
63,196 KB
testcase_21 AC 1,100 ms
63,196 KB
testcase_22 AC 1,098 ms
63,412 KB
testcase_23 AC 1,119 ms
63,492 KB
testcase_24 AC 1,108 ms
63,208 KB
testcase_25 AC 1,109 ms
63,336 KB
testcase_26 AC 1,108 ms
63,228 KB
testcase_27 AC 1,113 ms
63,276 KB
testcase_28 AC 1,096 ms
63,240 KB
testcase_29 AC 1,119 ms
63,264 KB
testcase_30 AC 1,106 ms
63,284 KB
testcase_31 AC 1,108 ms
63,628 KB
testcase_32 AC 1,113 ms
63,156 KB
testcase_33 AC 1,107 ms
63,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import scala.io.StdIn

object Main extends App {

  val c = Map(
    '1' -> 20063,
    '2' -> 19892,
    '3' -> 20011,
    '4' -> 19874,
    '5' -> 20199,
    '6' -> 19898,
    '7' -> 20163,
    '8' -> 19956,
    '9' -> 19841,
    '0' -> 20104,
    '.' -> 1
  )

  def proc(pi: String): (Int, Int) = {
    val charCounts = pi.groupBy(identity).map(x => x._1 -> x._2.length)

    val wrong = charCounts.find(x => c(x._1) < x._2).get._1.asDigit
    val right = charCounts.find(x => c(x._1) > x._2).get._1.asDigit
    (wrong, right)
  }

  val pi = StdIn.readLine()

  val result: (Int, Int) = proc(pi)
  println(result._1 + " " + result._2)
}
0