2009-01-20
所要時間←→得点の計算
|→ Competing in a Rated Algorithm Competition, 12 Determining Score
以下Schemeですが
(define TT 75) (define (point MP time) (* MP (+ 0.3 (/ (* 0.7 TT TT) (+ (* 10 time time) (* TT TT)))))) (define (taken-time MP pt) (* TT (sqrt (/ (- (/ 0.7 (- (/ pt MP) 0.3)) 1) 10)))) (define (minsec min) (let* ([m (floor->exact min)] [s (floor->exact (* (- min m) 60))]) (format #t "~d'~d''\n" m s)))
所要時間(分)から得点を得る:
(point 250 3) => 247.24409448818895
得点から所要時間(分)を得る:
(taken-time 250 203.42) => 14.283829997874937 (minsec (taken-time 250 203.42)) => 14'17''