結果

問題 No.199 星を描こう
ユーザー maspymaspy
提出日時 2020-03-05 08:37:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 495 ms / 2,000 ms
コード長 573 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 44,460 KB
最終ジャッジ日時 2024-04-22 02:05:18
合計ジャッジ時間 14,626 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 458 ms
44,436 KB
testcase_01 AC 487 ms
44,192 KB
testcase_02 AC 484 ms
44,452 KB
testcase_03 AC 486 ms
44,452 KB
testcase_04 AC 495 ms
44,460 KB
testcase_05 AC 476 ms
44,332 KB
testcase_06 AC 476 ms
44,320 KB
testcase_07 AC 480 ms
43,940 KB
testcase_08 AC 486 ms
44,328 KB
testcase_09 AC 475 ms
44,196 KB
testcase_10 AC 452 ms
43,948 KB
testcase_11 AC 445 ms
44,192 KB
testcase_12 AC 458 ms
44,448 KB
testcase_13 AC 448 ms
44,196 KB
testcase_14 AC 449 ms
44,072 KB
testcase_15 AC 461 ms
44,320 KB
testcase_16 AC 459 ms
44,108 KB
testcase_17 AC 455 ms
44,324 KB
testcase_18 AC 453 ms
43,940 KB
testcase_19 AC 458 ms
44,068 KB
testcase_20 AC 454 ms
44,304 KB
testcase_21 AC 460 ms
44,192 KB
testcase_22 AC 463 ms
43,948 KB
testcase_23 AC 450 ms
44,336 KB
testcase_24 AC 453 ms
44,068 KB
testcase_25 AC 455 ms
44,268 KB
testcase_26 AC 454 ms
44,196 KB
testcase_27 AC 457 ms
44,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# %%
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import itertools

# %%
import numpy as np

# %%
XY = np.array(read().split(), np.int64)
X = XY[::2]
Y = XY[1::2]

# %%


def is_edge_of_convexhull(i, j):
    b = X[i] - X[j]
    a = Y[j] - Y[i]
    c = a * X[i] + b * Y[i]
    return np.count_nonzero(a * X + b * Y - c > 0) == 3


# %%
n = 0
it = itertools.product(range(5), repeat=2)
n = sum(is_edge_of_convexhull(i, j) for i, j in it if i != j)
print('YES' if n == 5 else 'NO')
0