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

23124번 - Intellectual Implementation 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
6 초 512 MB197660.000%

문제

There are $n$ rectangles on the coordinate plane, with sides parallel to the coordinate axis. The $i$-th rectangle covers all points $(x, y)$ with $l_i \le x \le r_i$ and $d_i \le y \le u_i$.

For simplicity, for every $i \neq j,ドル we have $l_i \neq l_j,ドル $r_i \neq r_j,ドル $l_i \neq r_j,ドル $d_i \neq d_j,ドル $u_i \neq u_j,ドル $d_i \neq u_j$.

Count the number of triples $(i, j, k)$ with 1ドル \le i < j < k \le n$ for which $i$-th, $j$-th, and $k$-th rectangles are pairwise disjoint (every pair of them has no common points).

입력

The first line of the input contains a single integer $n$ (1ドル \le n \le 2 \cdot 10^5$), the number of rectangles.

The $i$-th of the next $n$ lines contains four integers describing the $i$-th rectangle: $l_i,ドル $r_i,ドル $d_i,ドル $u_i$ ($-10^9 \le l_i < r_i \le 10^9,ドル $-10^9 \le d_i < u_i \le 10^9$).

It is guaranteed that, for every $i \neq j,ドル we have $l_i \neq l_j,ドル $r_i \neq r_j,ドル $l_i \neq r_j,ドル $d_i \neq d_j,ドル $u_i \neq u_j,ドル $d_i \neq u_j$.

출력

Output the number of triples $(i, j, k)$ with 1ドル \le i < j < k \le n$ for which $i$-th, $j$-th, and $k$-th rectangles are pairwise disjoint.

제한

예제 입력 1

5
1 5 1 5
4 8 2 6
3 7 3 7
2 6 28 32
42 46 42 46

예제 출력 1

3

예제 입력 2

6
1 8 6 10
2 5 3 12
3 4 15 20
0 9 2 22
-5 22 -2 23
-7 11 -1 17

예제 출력 2

0

힌트

출처

Camp > Petrozavodsk Programming Camp > Summer 2021 > Day 3: IQ test by kefaa2, antontrygubO_o, and gepardo I번

Contest > Open Cup > 2021/2022 Season > Stage 2: Grand Prix of IMO I번

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

출처

대학교 대회

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

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