Logo
(追記) (追記ここまで)

6075번 - Largest Fence 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 128 MB57282151.220%

문제

Farmer John has purchased N (5 <= N <= 250) fence posts in order to build a very nice-looking fence. Everyone knows the best fences are convex polygons where fence posts form vertices of a polygon. The pasture is represented as a rectilinear grid; fencepost i is at integer coordinates (x_i, y_i) (1 <= x_i <= 1,000; 1 <= y_i <= 1000).

Given the locations of N fence posts (which, intriguingly, feature no set of three points which are collinear), what is the largest number of fence posts FJ can use to create a fence that is convex?

For test cases worth 45% of the points for this problem, N <= 65.

입력

  • Line 1: A single integer: N
  • Lines 2..N+1: Line i+1 describes fence post i's location with two space-separated integers: x_i and y_i

출력

  • Line 1: A single integer, the maximum possible number of fence posts that form a convex polygon.

제한

예제 입력 1

6
5 5
2 3
3 2
1 5
5 1
1 1

예제 출력 1

5

힌트

The largest convex polygon is the pentagon (2,3), (3,2), (5,1), (5,5), (1,5).

출처

Olympiad > USA Computing Olympiad > 2008-2009 Season > USACO December 2008 Contest > Gold 4번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /