Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions froglike6/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
| 6μ°¨μ‹œ | 2025.04.07 | λ°±νŠΈλž˜ν‚Ή| [N-Queen](https://www.acmicpc.net/problem/9663)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/24|
| 7μ°¨μ‹œ | 2025.04.09 | κ·Έλž˜ν”„ | [μ΅œμ†ŒλΉ„μš© κ΅¬ν•˜κΈ°](https://www.acmicpc.net/problem/1916)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/27|
| 8μ°¨μ‹œ | 2025.04.11 | 물리학 | [곰곰이와 μ‹œμ†Œ](https://www.acmicpc.net/problem/26072)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/31|
| 9μ°¨μ‹œ | 2025.04.30 | κΈ°ν•˜ν•™ | [ν‰ν–‰μ‚¬λ³€ν˜•](https://www.acmicpc.net/problem/1064)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/34|
---
26 changes: 26 additions & 0 deletions froglike6/geometry/1064.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import math
import sys
input = sys.stdin.readline

def main():
xA, yA, xB, yB, xC, yC = map(int, input().split())

cross = (xB - xA) * (yC - yA) - (yB - yA) * (xC - xA)
if cross == 0:
print(-1)
return

dAB = math.hypot(xA - xB, yA - yB)
dBC = math.hypot(xB - xC, yB - yC)
dCA = math.hypot(xC - xA, yC - yA)

s1 = dAB + dCA
s2 = dAB + dBC
s3 = dBC + dCA

answer = 2 * (max(s1, s2, s3) - min(s1, s2, s3))

print(f"{answer:.15f}")

if __name__=="__main__":
main()