結果

問題 No.312 置換処理
ユーザー koba-e964koba-e964
提出日時 2015-12-05 02:01:11
言語 Scala(Beta)
(3.4.0)
結果
WA  
実行時間 -
コード長 573 bytes
コンパイル時間 12,720 ms
コンパイル使用メモリ 246,880 KB
実行使用メモリ 63,152 KB
最終ジャッジ日時 2023-09-11 22:18:08
合計ジャッジ時間 57,895 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 974 ms
62,472 KB
testcase_01 AC 1,065 ms
62,440 KB
testcase_02 AC 1,001 ms
62,732 KB
testcase_03 AC 994 ms
62,600 KB
testcase_04 AC 1,017 ms
62,596 KB
testcase_05 AC 963 ms
62,560 KB
testcase_06 AC 968 ms
62,648 KB
testcase_07 AC 991 ms
62,512 KB
testcase_08 AC 986 ms
62,664 KB
testcase_09 AC 955 ms
62,612 KB
testcase_10 AC 959 ms
62,504 KB
testcase_11 AC 984 ms
62,528 KB
testcase_12 AC 970 ms
62,568 KB
testcase_13 AC 981 ms
62,660 KB
testcase_14 AC 994 ms
62,696 KB
testcase_15 AC 992 ms
62,632 KB
testcase_16 AC 975 ms
62,840 KB
testcase_17 AC 976 ms
62,592 KB
testcase_18 AC 965 ms
62,480 KB
testcase_19 AC 983 ms
62,836 KB
testcase_20 AC 987 ms
62,564 KB
testcase_21 AC 974 ms
62,480 KB
testcase_22 AC 961 ms
62,516 KB
testcase_23 WA -
testcase_24 AC 957 ms
62,572 KB
testcase_25 AC 961 ms
62,576 KB
testcase_26 AC 953 ms
62,712 KB
testcase_27 AC 960 ms
62,964 KB
testcase_28 AC 971 ms
62,636 KB
testcase_29 AC 982 ms
62,468 KB
testcase_30 AC 987 ms
62,436 KB
testcase_31 AC 980 ms
62,664 KB
testcase_32 AC 961 ms
62,568 KB
testcase_33 AC 972 ms
62,660 KB
testcase_34 AC 960 ms
62,532 KB
testcase_35 AC 970 ms
62,836 KB
testcase_36 AC 972 ms
62,540 KB
testcase_37 AC 973 ms
62,596 KB
testcase_38 AC 979 ms
62,608 KB
testcase_39 AC 973 ms
62,592 KB
testcase_40 AC 980 ms
62,880 KB
testcase_41 AC 956 ms
62,512 KB
testcase_42 AC 967 ms
62,544 KB
testcase_43 AC 963 ms
62,460 KB
testcase_44 AC 966 ms
62,628 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 % 2 == 0) n / 2 else n
      case _ => calc(t + 1, n)
    }
  }
  val n = sc.nextLong
  println(calc(3, n))
}
0