RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
ICPC00029

G. Map Tiles

Unrated 레이팅 미적용
난이도
20s
시간 제한
1024MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

Publishing maps is not an easy task. First you need some appropriate transformation to display the earth’s spherical shape in a t\(wo-di\)mensional plane. Then another issue arises – most hi\(gh-qu\)ality maps are too large to be printed on a single page of paper. To cope with that, map publishers often split maps into several rectangular tiles, and print each tile on one page. In this problem, you will examine this “tiling” process. The International Cartographic Publishing Company (ICPC) needs to cut their printing costs by mi\(ni- mi\)zing the number of tiles used for their maps. Even with a fixed tile size (determined by the page size) and map scale, you can still optimize the situation by adjusting the tile grid. The left side of Figure G.1 shows 14 map tiles covering a region. The right side shows how you can cover the same region with only 10 tiles, without changing the tile sizes or orientation. Figure G.1: Two possible ways of tiling Texas. Your task is to help the ICPC find the minimum number of tiles needed to cover a given region. For simplicity, the region will be given as a closed polygon that does not intersect itself. Note that the tiles must be part of a rectangular grid aligned with the \(x-ax\)is and \(y-ax\)is. That is, they touch each other only with their whole sides and cannot be rotated. Also note that although all input coordinates are integers, tiles may be located at n\(on-in\)teger coordinates. The polygon may touch the edges of marginal lines (as in Sample Input 2). However, to avoid floati\(ng- po\)int issues, you may assume the optimal answer will not change even if the polygon is allowed to go outside the map tiles by a distance of \(10^{−}^{6}\).

제약
입력 형식

The input consists of a single test case. The first line of a test case contains three integers: \(n\), \(xs\), and \(ys\). The number of polygon vertices is \(n\) (\(3 \le n \le 50\)), and \(x_{s}\) and \(y_{s}\) (\(1 \le x_{s}\), \(y_{s} \le 100\)) are the dimensions of each tile. Each of the next \(n\) lines contains two integers \(x\) and \(y\) (\(0 \le x \le 10x_{s}\), \(0 \le y \le 10y_{s}\)), specifying the vertices of the polygon representing the region (in either clockwise or count\(er-cl\)ockwise order).

출력 형식

Display the minimal number of tiles necessary to cover the whole interior of the polygon.

예제 1
입력
12 9 9
1 8
1 16
6 16
9 29
19 31
23 24
30 23
29 18
20 12
22 8
14 0
14 8
출력
10
예제 2
입력
4 5 7
10 10
15 10
15 17
10 17
출력
1
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC World Finals 2013

평가 및 의견

G. Map Tiles

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

G. Map Tiles

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8