結果

問題 No.53 悪の漸化式
ユーザー MiyamonY
提出日時 2019-09-09 19:53:16
言語 Scheme
(Gauche-0.9.15)
結果
WA  
実行時間 -
コード長 315 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 5,504 KB
実行使用メモリ 16,256 KB
最終ジャッジ日時 2024-06-28 14:05:01
合計ジャッジ時間 1,476 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

(define vec (make-vector 101 100))

(vector-set! vec 0 4)
(vector-set! vec 1 3)

(define (calc n)
  (define val (vector-ref vec n))
  (cond ((< val 10) val)
	(else
	 (let1 v (/. (- (* 19 (calc (- n 1) )) (* 12 (calc (- n 2)))) 4)
	       (vector-set! vec n v)
	       v))))


(let* ((n (read)))
  (print (calc n)))
0