結果

問題 No.199 星を描こう
ユーザー rlangevinrlangevin
提出日時 2023-10-20 12:08:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 714 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 81,768 KB
実行使用メモリ 53,460 KB
最終ジャッジ日時 2023-10-20 12:08:29
合計ジャッジ時間 2,286 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,460 KB
testcase_01 AC 40 ms
53,460 KB
testcase_02 AC 45 ms
53,460 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 37 ms
53,460 KB
testcase_06 AC 37 ms
53,460 KB
testcase_07 AC 37 ms
53,460 KB
testcase_08 AC 38 ms
53,460 KB
testcase_09 AC 37 ms
53,460 KB
testcase_10 AC 37 ms
53,460 KB
testcase_11 AC 37 ms
53,460 KB
testcase_12 AC 37 ms
53,460 KB
testcase_13 AC 39 ms
53,460 KB
testcase_14 AC 37 ms
53,460 KB
testcase_15 AC 40 ms
53,460 KB
testcase_16 AC 37 ms
53,460 KB
testcase_17 AC 38 ms
53,460 KB
testcase_18 AC 37 ms
53,460 KB
testcase_19 AC 37 ms
53,460 KB
testcase_20 AC 38 ms
53,460 KB
testcase_21 AC 40 ms
53,460 KB
testcase_22 AC 39 ms
53,460 KB
testcase_23 AC 38 ms
53,460 KB
testcase_24 AC 39 ms
53,460 KB
testcase_25 AC 38 ms
53,460 KB
testcase_26 AC 38 ms
53,460 KB
testcase_27 AC 37 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

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