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

Cavli

Diamond V 다이아몬드 V
난이도
2s
시간 제한
32MB
메모리 제한
1
맞았습니다!!
2
제출 수
50.0%
정답률
레이팅

의견: 0

설명

Mirko found a wooden board and \(N\) nails in his attic. Mirko hammered the nails into the board as fast as possible. The board can be modeled by a coordinate plane and the nails as points in it. No two nails have the same x or the same y coordinate.

In order to keep having fun, Mirko stole his sister's elastic hair band, spread it over all nails and then let go. The elastic, naturally, tightened around the nails.

Mirko then repeats these steps while there are at least three nails in the board:

  1. Write down the area of the shape enclosed by the hair band.
  2. Pick the leftmost, rightmost, topmost or bottommost nail in the board.
  3. Remove the chosen nail from the board; the elastic tightens again around the remaining nails.

Write a program that calculates the numbers written in step 1 of each iteration, if we know the nail Mirko picks in step 2 of each iteration.

제약

In test cases worth 50% points, N will be less than 1000.

Contest #2, \(15^{th}\) November 2008

입력 형식

The first line contains the integer \(N\) (\(3 \le N \le 300\,000\)), the number of nails.

Each of the following \(N\) lines contains two integers separated by a space, the coordinates of a nail. All coordinates will be between \(1\) and \(1\,000\,000\,000\). No two nails will share the same x or y coordinate.

The next line contains \(N-2\) letters L, R, U or D. The letters represent the nails Mirko picked in order:

  • L for the leftmost nail (smallest x coordinate),
  • R for the rightmost nail (largest x coordinate),
  • U for the topmost nail (largest y coordinate),
  • D for the bottommost nail (smallest y coordinate).
출력 형식

Output \(N-2\) numbers, each on a separate line. The numbers are, in order, the areas that Mirko wrote down. Output numbers with one digit after the decimal point.

Scoring: In test cases worth \(50\%\) of points, \(N\) will be less than \(1000\).

서브태스크
서브태스크점수설명

Subtask 1

70점

\(N < 1000\)

Subtask 2

70점

No additional constraints (\(N \le 300\,000\)).

예제 1
입력
5
1 4
2 2
4 1
3 5
5 3
LUR
출력
9.0
6.5
2.5
예제 2
입력
8
1 6
2 4
3 1
4 2
5 7
6 5
7 9
8 3
URDLUU
출력
34.0
24.0
16.5
14.0
9.5
5.0
문제 정보

riseoj 작성

출처 COCI 2008/2009 Contest 2

평가 및 의견

Cavli

개요
출제자 난이도 Diamond V 다이아몬드 V 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

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

풀이 제출

Cavli

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