結果
| 問題 |
No.164 ちっちゃくないよ!!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-07-18 17:19:22 |
| 言語 | Scala(Beta) (3.6.2) |
| 結果 |
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 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
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)
}
}