結果

問題 No.312 置換処理
ユーザー koba-e964koba-e964
提出日時 2022-01-15 19:30:10
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 1,008 ms / 2,000 ms
コード長 583 bytes
コンパイル時間 11,967 ms
コンパイル使用メモリ 263,504 KB
実行使用メモリ 63,292 KB
最終ジャッジ日時 2024-05-01 17:27:42
合計ジャッジ時間 58,569 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 971 ms
63,288 KB
testcase_01 AC 993 ms
63,172 KB
testcase_02 AC 990 ms
63,064 KB
testcase_03 AC 975 ms
63,120 KB
testcase_04 AC 962 ms
63,020 KB
testcase_05 AC 973 ms
63,276 KB
testcase_06 AC 958 ms
63,192 KB
testcase_07 AC 977 ms
63,152 KB
testcase_08 AC 970 ms
63,224 KB
testcase_09 AC 960 ms
63,072 KB
testcase_10 AC 959 ms
63,248 KB
testcase_11 AC 971 ms
63,152 KB
testcase_12 AC 967 ms
63,164 KB
testcase_13 AC 964 ms
63,156 KB
testcase_14 AC 957 ms
63,152 KB
testcase_15 AC 965 ms
62,984 KB
testcase_16 AC 970 ms
63,012 KB
testcase_17 AC 956 ms
63,164 KB
testcase_18 AC 956 ms
63,200 KB
testcase_19 AC 955 ms
63,036 KB
testcase_20 AC 962 ms
63,072 KB
testcase_21 AC 963 ms
63,184 KB
testcase_22 AC 974 ms
63,216 KB
testcase_23 AC 1,008 ms
63,068 KB
testcase_24 AC 964 ms
63,292 KB
testcase_25 AC 968 ms
63,088 KB
testcase_26 AC 965 ms
63,200 KB
testcase_27 AC 966 ms
63,188 KB
testcase_28 AC 967 ms
63,104 KB
testcase_29 AC 974 ms
63,040 KB
testcase_30 AC 977 ms
63,208 KB
testcase_31 AC 968 ms
63,104 KB
testcase_32 AC 981 ms
63,144 KB
testcase_33 AC 987 ms
63,220 KB
testcase_34 AC 980 ms
63,036 KB
testcase_35 AC 979 ms
63,160 KB
testcase_36 AC 975 ms
63,244 KB
testcase_37 AC 962 ms
63,204 KB
testcase_38 AC 961 ms
63,060 KB
testcase_39 AC 975 ms
63,156 KB
testcase_40 AC 972 ms
63,040 KB
testcase_41 AC 962 ms
63,220 KB
testcase_42 AC 972 ms
63,212 KB
testcase_43 AC 972 ms
63,016 KB
testcase_44 AC 974 ms
63,068 KB
権限があれば一括ダウンロードができます

ソースコード

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 => if (n >= 6 && n % 2 == 0) n / 2 else n
      case _ => calc(t + 1, n)
    }
  }
  val n = sc.nextLong
  println(calc(3, n))
}
0