結果
問題 | No.105 arcの六角ボルト |
ユーザー | ducktail |
提出日時 | 2018-09-06 21:24:31 |
言語 | Scheme (Gauche-0.9.14) |
結果 |
RE
|
実行時間 | - |
コード長 | 660 bytes |
コンパイル時間 | 141 ms |
コンパイル使用メモリ | 6,980 KB |
実行使用メモリ | 14,660 KB |
最終ジャッジ日時 | 2023-08-15 19:52:16 |
合計ジャッジ時間 | 1,047 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
(要ログイン)
ソースコード
(use math.const) (define (main args) (let [(n (read))] (let loop [(x n)] (cond [(zero? x) #t] [else (print (solve)) (loop (- x 1))]))) 0) (define (solve) (let [(pl (read-points)) (xmn (cos (* pi/180 171))) (xmx (cos (* pi/180 119)))] ($ apply min $ filter (^a (> a 0)) $ map ang $ filter (^p (and (< (car p) xmx) (< xmn (car p)) (> (cadr p) 0))) pl))) (define (read-points) (let loop [(n 6) (ls ())] (cond [(zero? n) ls] [else (loop (- n 1) (cons (list (read) (read)) ls))]))) (define (ang x) (- (* 180/pi (acos (car x))) 120.0))