結果

問題 No.132 点と平面との距離
コンテスト
ユーザー gigurururu
提出日時 2015-01-22 09:56:45
言語 PyPy2
(7.3.20)
コンパイル:
pypy2 -m py_compile _filename_
実行:
/usr/bin/pypy2 Main.pyc
結果
AC  
実行時間 244 ms / 5,000 ms
コード長 705 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 351 ms
コンパイル使用メモリ 80,652 KB
実行使用メモリ 84,284 KB
最終ジャッジ日時 2026-03-07 08:39:38
合計ジャッジ時間 1,394 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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)
0