목차

Icebergs

ps
링크acmicpc.net/…
출처BOJ
문제 번호18298
문제명Icebergs
레벨골드 5
분류

기하학

시간복잡도O(N*P)
인풋사이즈N<=1000, P<=50
사용한 언어Python 3.11
제출기록31256KB / 96ms
최고기록96ms
해결날짜2023/04/12

풀이

코드

"""Solution code for "BOJ 18298. Icebergs".

- Problem link: https://www.acmicpc.net/problem/18298
- Solution link: http://www.teferi.net/ps/problems/boj/18298

Tags: [geometry]
"""

import sys
from teflib import geometry


def main():
    N = int(sys.stdin.readline())
    twice_of_area = 0
    for _ in range(N):
        P = int(sys.stdin.readline())
        points = [
            [int(x) for x in sys.stdin.readline().split()] for _ in range(P)
        ]
        twice_of_area += geometry.twice_of_polygon_area(points)

    print(twice_of_area // 2)


if __name__ == '__main__':
    main()