結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー nnsniconnsnico
提出日時 2019-05-01 21:20:56
言語 Scala(Beta)
(3.4.0)
結果
WA  
実行時間 -
コード長 277 bytes
コンパイル時間 9,303 ms
コンパイル使用メモリ 257,600 KB
実行使用メモリ 62,880 KB
最終ジャッジ日時 2023-09-14 16:13:30
合計ジャッジ時間 33,819 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 951 ms
61,900 KB
testcase_01 AC 933 ms
61,880 KB
testcase_02 AC 953 ms
62,152 KB
testcase_03 AC 956 ms
61,792 KB
testcase_04 AC 967 ms
61,996 KB
testcase_05 WA -
testcase_06 AC 956 ms
62,160 KB
testcase_07 AC 951 ms
61,780 KB
testcase_08 AC 950 ms
61,888 KB
testcase_09 AC 952 ms
62,100 KB
testcase_10 AC 970 ms
61,840 KB
testcase_11 AC 952 ms
61,892 KB
testcase_12 AC 1,000 ms
61,868 KB
testcase_13 AC 960 ms
62,200 KB
testcase_14 AC 946 ms
61,840 KB
testcase_15 AC 993 ms
61,820 KB
testcase_16 AC 975 ms
61,868 KB
testcase_17 AC 978 ms
61,908 KB
testcase_18 AC 960 ms
61,868 KB
testcase_19 AC 968 ms
61,884 KB
testcase_20 AC 963 ms
61,980 KB
testcase_21 AC 944 ms
62,880 KB
testcase_22 AC 950 ms
62,228 KB
testcase_23 AC 955 ms
61,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

object Main extends App {
  val n: Int = scala.io.StdIn.readInt()

  def stream(n: Int): Stream[Int] = Stream.cons(n, stream(n + n))

  val mugen: Stream[Int] = (0 #:: stream(1)).map(_ * 2)

  val targetValue = mugen.find(_ > n - 1)

  println(mugen.indexOf(targetValue.get))
}
0