結果
| 問題 |
No.132 点と平面との距離
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-01-21 01:06:05 |
| 言語 | Ruby (3.4.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 431 bytes |
| コンパイル時間 | 50 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 28,800 KB |
| 最終ジャッジ日時 | 2024-06-22 23:30:20 |
| 合計ジャッジ時間 | 9,206 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 TLE * 1 -- * 1 |
コンパイルメッセージ
Syntax OK
ソースコード
require 'matrix'
class Vector
def outer_product(o)
raise 'outer_product is size3 only(size#{self.size})' unless size == 3
Vector[
self[1]*o[2]-self[2]*o[1],
self[2]*o[0]-self[0]*o[2],
self[0]*o[1]-self[1]*o[0],
]
end
end
def g;Vector[*gets.split.map(&:to_f)]end
n=gets.to_i
P=g
p((1..n).map{g-P}.combination(3).map{|a,b,c|
t=(b-a).outer_product(c-a)
a.inner_product(t).abs/t.norm
}.inject(:+))