結果

問題 No.199 星を描こう
ユーザー rlangevin
提出日時 2023-10-20 12:08:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 714 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 81,984 KB
実行使用メモリ 52,608 KB
最終ジャッジ日時 2024-09-20 07:39:32
合計ジャッジ時間 2,036 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

X, Y = [0] * 5, [0] * 5
for i in range(5):
    X[i], Y[i] = map(int, input().split())

def f(i, j, k):
    xj = X[j] - X[i]
    yj = Y[j] - Y[i]
    xk = X[k] - X[i]
    yk = Y[k] - Y[i]
    return xj * yk - xk * yj


for a in range(5):
    S = set()
    for b in range(5):
        if a == b:
            continue
        cntp, cntm = 0, 0
        for c in range(5):
            if a == c or b == c:
                continue
            v = f(a, b, c)
            if v == 0:
                print("NO")
                exit()
            if v > 0:
                cntp += 1
            else:
                cntm += 1
        S.add((cntp, cntm))
    if len(S) != 4:
        print("NO")
        exit()

print("YES")
0