結果
| 問題 | No.199 星を描こう |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-15 17:32:28 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 21 ms / 2,000 ms |
| + 640µs | |
| コード長 | 480 bytes |
| 記録 | |
| コンパイル時間 | 56 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2026-10-10 13:14:15 |
| 合計ジャッジ時間 | 2,319 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
#!/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])