結果

問題 No.164 ちっちゃくないよ!!
ユーザー ともきともき
提出日時 2015-07-18 17:19:22
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 987 ms / 2,000 ms
コード長 1,563 bytes
コンパイル時間 10,547 ms
コンパイル使用メモリ 261,864 KB
実行使用メモリ 62,264 KB
最終ジャッジ日時 2023-09-11 11:51:34
合計ジャッジ時間 22,443 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 942 ms
61,676 KB
testcase_01 AC 940 ms
62,264 KB
testcase_02 AC 942 ms
61,632 KB
testcase_03 AC 932 ms
61,704 KB
testcase_04 AC 925 ms
61,884 KB
testcase_05 AC 987 ms
62,048 KB
testcase_06 AC 981 ms
62,100 KB
testcase_07 AC 948 ms
62,028 KB
testcase_08 AC 975 ms
62,164 KB
testcase_09 AC 982 ms
61,968 KB
testcase_10 AC 929 ms
61,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import scala.io.StdIn.readLine
import scala.collection.mutable.PriorityQueue
import scala.annotation.tailrec

// PriorityQueue[Long]()(scala.math.Ordering.Long.reverse)
package net.pushl {
  package number {
    // Prime  (Prime.scala)
    // Number (Number.scala)
  }
  package string {
    // RollingHash (RollingHash.scala)
  }
  package geometry {
    // Point
    // Segment
    // Line
  }
  object EnRich {
    implicit class AString(val self : String) extends AnyVal {
      def splitToIntVector    = self.split(" ").map(_.toInt).toVector
      def splitToDoubleVector = self.split(" ").map(_.toDouble).toVector

      def splitToDoubleTuple2 = splitTuple2(() => splitToDoubleVector)
      def splitToIntTuple2    = splitTuple2(() => splitToIntVector)
      def splitToDoubleTuple3 = splitTuple3(() => splitToDoubleVector)
      def splitToIntTuple3    = splitTuple3(() => splitToIntVector)

      private def splitTuple2[X](splitTo: () => Vector[X]) = {
        val ab = splitTo()
        (ab(0),ab(1))
      }
      private def splitTuple3[X](splitTo: () => Vector[X]) = {
        val abc = splitTo()
        (abc(0),abc(1),abc(2))
      }
    }
  }
}

object Main {
  def solve(s : String) : BigInt = {
    val alpha_converted = s.map((c) => if('0' <= c && c <= '9') c-'0'
                                       else c-'A'+10)
    val m = alpha_converted.max+1
    alpha_converted.foldLeft(BigInt(0))((a,b) => a*m+b)
  }
  def main(args : Array[String]) : Unit = {
    val n = readLine.toInt
    println((1 to n).map(_ => solve(readLine())).min)
  }
}
0