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

24283번 - Points 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB642100.000%

문제

Given are N points with integer coordinates in the standard coordinate system on the plane. A point is called extreme if both following assertions are true: 1. if you after leaving it and moving straight vertical you can go infinitely far away and also 2. if you after leaving it and moving straight horizontal you can also go infinitely far away. A point is called internal, if after leaving it you cannot go infinitely far away moving vertically neither horizontally. Write a program points that finds the count of extreme points and the count of internal points in the initial point configuration, and then executes requests of two kinds: "add point" and "remove point". After completing each request, the program should reprint the new count of extreme points and the new count of internal points.

입력

Your program reads from the first line of the standard input a positive integer N, which is the initial count of given points. Each of the following N lines contains two positive integers separated by a space - the coordinates of the consecutive given point. It follows a line containing a non-negative integer Q, which is the count of the requests that have to be processed. The following are Q lines, each containing three positive integers: the first integer has a value of 1 or 2: the value is 1 if the query is for adding a point and the value is 2 - if the query is for removing a point. The following two integers are the coordinates of the point to be added or to be removed. It is guaranteed that, on request for removal, the point to be removed is contained in the current set of points. It is guaranteed that there are no two points with identical coordinates at any moment in the plane.

출력

After reading the initial set of points and after completing each request, the program should print on the standard output a line containing two integers separated by exactly one space - the count of extreme and the count of internal points in the current set of points.

제한

  • 0 < N ≤ 100 000
  • 0 < Q ≤ 100 000
  • The coordinates of all points are positive integers not greater than 100 000.

예제 입력 1

10
1 4
2 1
1 2
3 4
4 2
2 2
1 1
3 1
3 2
4 3
3
1 4 4
2 1 1
1 2 3

예제 출력 1

6 1
5 1
6 1
7 2

힌트

Explanation: The initial set of points is given on the figure. The internal point is denoted by しろいしかく , the extreme points are denoted by ▪, and the remaining points − by о.

출처

Olympiad > International Autumn Tournament in Informatics > 2019 > Group B (Juniors) 2번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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