結果
| 問題 | No.132 点と平面との距離 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2015-01-22 09:56:45 | 
| 言語 | PyPy2 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 360 ms / 5,000 ms | 
| コード長 | 705 bytes | 
| コンパイル時間 | 2,309 ms | 
| コンパイル使用メモリ | 76,680 KB | 
| 実行使用メモリ | 78,864 KB | 
| 最終ジャッジ日時 | 2024-06-23 00:16:38 | 
| 合計ジャッジ時間 | 3,655 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 3 | 
ソースコード
import itertools,math
class Vector3:
    def __init__(self,x=0,y=0,z=0):
        self.x,self.y,self.z=x,y,z
    def __sub__(self,o):
        return Vector3(self.x-o.x,self.y-o.y,self.z-o.z)
    def outer_product(self,o):
        return Vector3(self.y*o.z-self.z*o.y,self.z*o.x-self.x*o.z,self.x*o.y-self.y*o.x)
    def inner_product(self,o):
        return self.x*o.x+self.y*o.y+self.z*o.z
    def norm(self):
        return math.sqrt(self.x**2+self.y**2+self.z**2)
def g():
    return Vector3(*map(float,raw_input().split()))
n=input()
P=g()
l=[g()-P for _ in range(n)]
ans=0
for a,b,c in itertools.combinations(l,3):
    t=(b-a).outer_product(c-a)
    ans+=abs(a.inner_product(t))/t.norm()
print(ans)
            
            
            
        