結果

問題 No.3005 トレミーの問題
ユーザー 矢澤式WINTER
提出日時 2025-01-17 22:06:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 481 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 51,968 KB
最終ジャッジ日時 2025-01-17 22:06:43
合計ジャッジ時間 2,565 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

ax,ay = map(int,input().split())
bx,by = map(int,input().split())
cx,cy = map(int,input().split())
dx,dy = map(int,input().split())
a = complex(ax,ay)
b = complex(bx,by)
c = complex(cx,cy)
d = complex(dx,dy)
ans = ((a-c)*(b-d))/((a-d)*(b-c))
ans1 = (a-c)/(b-c)
ans2 = (a-d)/(b-d)
# print(ans)
# print(ans1)
# print(ans2)
if (abs(ans.imag) >= 0.000000000000001) or (abs(ans1.imag) <= 0.000000000000001 and abs(ans2.imag) <= 0.000000000000001):
    print("NO")
else:
    print("YES")
0