結果

問題 No.312 置換処理
ユーザー koba-e964
提出日時 2015-12-05 02:00:09
言語 Scala(Beta)
(3.6.2)
結果
WA  
実行時間 -
コード長 546 bytes
コンパイル時間 7,902 ms
コンパイル使用メモリ 253,712 KB
実行使用メモリ 65,032 KB
最終ジャッジ日時 2024-06-29 11:49:54
合計ジャッジ時間 47,279 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 42 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

/*
 * Reference: http://lizan.asia/blog/2012/12/11/scala-competitive/
 */

object Main extends App {
  import java.{util => ju}
  import scala.annotation._
  import scala.collection._
  import scala.collection.{mutable => mu}
  import scala.collection.JavaConverters._
  import scala.math._
  val sc = new ju.Scanner(System.in)
  @tailrec
  def  calc(t:Long, n : Long) : Long={
    () match {
     case  _ if n % t == 0 => t
      case _ if 2 * n < t * t => n
      case _ => calc(t + 1, n)
    }
  }
  val n = sc.nextLong
  println(calc(3, n))
}
0