結果

問題 No.2515 Similar Triangles
ユーザー june19312june19312
提出日時 2023-10-27 21:22:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 403 bytes
コンパイル時間 421 ms
コンパイル使用メモリ 81,788 KB
実行使用メモリ 53,572 KB
最終ジャッジ日時 2023-10-27 21:22:35
合計ジャッジ時間 1,229 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,572 KB
testcase_01 AC 34 ms
53,572 KB
testcase_02 AC 34 ms
53,572 KB
testcase_03 AC 35 ms
53,572 KB
testcase_04 AC 38 ms
53,572 KB
testcase_05 AC 34 ms
53,572 KB
testcase_06 AC 34 ms
53,572 KB
testcase_07 AC 35 ms
53,572 KB
testcase_08 AC 36 ms
53,572 KB
testcase_09 AC 37 ms
53,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X1,Y1,X2,Y2,X3 = map(int,input().split())

def menseki_triangle(a,b,c):
    """
    a,b,cを頂点とする三角形の面積を求める。
    """
    x1,y1 = a[0],a[1]
    x2,y2 = b[0],b[1]
    x3,y3 = c[0],c[1]

    return abs((x1-x3)*(y2-y3)-(x2-x3)*(y1-y3))/2

a = menseki_triangle([0,0],[X1,Y1],[X3,0])
b = menseki_triangle([0,0],[X2,Y2],[X3,0])

if a == b:
    print("Yes")
else:
    print("No")
0