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 @@ -22,4 +22,5 @@
| 18์ฐจ์‹œ | 2025.07.03 | ์ž๋ฆฟ์ˆ˜๋ฅผ ์ด์šฉํ•œ ๋‹ค์ด๋‚˜๋ฏน ํ”„๋กœ๊ทธ๋ž˜๋ฐ | [ํ•ฉ ์ฐพ๊ธฐ](https://www.acmicpc.net/problem/7786)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/69|
| 19์ฐจ์‹œ | 2025.07.04 | ์• ๋“œ ํ˜น | [์„œ๋กœ์†Œ ๊ทธ๋ž˜ํ”„ ๊ฒŒ์ž„](https://www.acmicpc.net/problem/34035)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/72|
| 20์ฐจ์‹œ | 2025.07.09 | ์กฐํ•ฉ๋ก  | [์•”ํ˜ธ ๋งŒ๋“ค๊ธฐ](https://www.acmicpc.net/problem/1759)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/77|
| 21์ฐจ์‹œ | 2025.07.14 | ๊ธฐํ•˜ํ•™ | [Cows](https://www.acmicpc.net/problem/6850)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/82|
---
41 changes: 41 additions & 0 deletions froglike6/geometry/6850.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import sys
input = sys.stdin.readline

def cross(o, a, b):
return (a[0]-o[0])*(b[1]-o[1])-(a[1]-o[1])*(b[0]-o[0])

def convex_hull(points):
points = sorted(set(points))

if len(points) <= 1:
return points

lower = []
for p in points:
while len(lower) >= 2 and cross(lower[-2], lower[-1], p) <= 0:
lower.pop()
lower.append(p)

upper = []
for p in reversed(points):
while len(upper) >= 2 and cross(upper[-2], upper[-1], p) <= 0:
upper.pop()
upper.append(p)

return lower[:-1] + upper[:-1]

def shoelace_area(polygon):
n = len(polygon)
area = 0
for i in range(n):
x1, y1 = polygon[i]
x2, y2 = polygon[(i + 1) % n]
area += (x1 * y2) - (x2 * y1)
return abs(area) / 2

input_points = []
for _ in range(int(input())):
a, b = map(int,input().split())
input_points.append((a,b))

print(int(shoelace_area(convex_hull(input_points))//50))