結果

問題 No.53 悪の漸化式
ユーザー kaiyori_labkaiyori_lab
提出日時 2014-10-30 23:33:13
言語 Scala(Beta)
(3.4.0)
結果
RE  
実行時間 -
コード長 269 bytes
コンパイル時間 13,894 ms
コンパイル使用メモリ 265,108 KB
実行使用メモリ 64,312 KB
最終ジャッジ日時 2023-09-11 07:21:27
合計ジャッジ時間 31,676 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

object Main extends App{
	val sc = new java.util.Scanner(System.in)
	val n = sc.nextInt

	def calc(n1: BigDecimal, n2: BigDecimal): Stream[BigDecimal] = {
		n1 #:: calc(n2, (19/4.0 * n2) - (12 / 4.0 * n1) )
	}
	val res = calc(4, 3).take(n).last
	println(res)
}
0