結果

問題 No.164 ちっちゃくないよ!!
ユーザー ともきともき
提出日時 2015-07-18 17:19:22
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 848 ms / 2,000 ms
コード長 1,563 bytes
コンパイル時間 10,398 ms
コンパイル使用メモリ 277,340 KB
実行使用メモリ 63,232 KB
最終ジャッジ日時 2024-06-29 02:25:55
合計ジャッジ時間 20,648 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 795 ms
63,088 KB
testcase_01 AC 778 ms
63,004 KB
testcase_02 AC 782 ms
62,800 KB
testcase_03 AC 797 ms
63,064 KB
testcase_04 AC 806 ms
63,160 KB
testcase_05 AC 848 ms
63,112 KB
testcase_06 AC 833 ms
63,164 KB
testcase_07 AC 804 ms
63,228 KB
testcase_08 AC 837 ms
63,084 KB
testcase_09 AC 838 ms
63,232 KB
testcase_10 AC 816 ms
63,116 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