結果
| 問題 | 
                            No.199 星を描こう
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2016-11-15 17:32:28 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 35 ms / 2,000 ms | 
| コード長 | 480 bytes | 
| コンパイル時間 | 208 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-12-30 03:56:57 | 
| 合計ジャッジ時間 | 2,063 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 25 | 
ソースコード
#!/usr/bin/env python3
import itertools
cross = lambda a, b: (a.conjugate() * b).imag
ccw = lambda a, b, c: cross(b - a, c - a)
ps = [ complex(*[ int(it) for it in input().split() ]) for _ in range(5) ]
ans = False
for ps in itertools.permutations(ps):
    for i in range(5):
        f = lambda *args: ccw(*[ ps[(i+j)%5] for j in args ])
        if not (f(0, 1, 2) < 0 and f(0, 1, 3) > 0 and f(0, 1, 4) < 0):
           break
    else:
        ans = True
print(['NO','YES'][ans])