Nộp bài  Các bài nộp  Làm tốt nhất  Về danh sách bài 
MCONVOI  Con Voi 
Đọc đề đẹp hơn ở:
https://codeforces.com/group/FLVn1Sc504/contest/274710/problem/Q
https://codeforces.com/group/FLVn1Sc504/contest/274505/problem/V
https://codeforces.com/group/FLVn1Sc504/contest/274710/problem/Q
https://codeforces.com/group/FLVn1Sc504/contest/274505/problem/V
English  Vietnamese 
An elephant lives by a lake with N plants on the surface. The lake
can be modeled by a coordinate plane, with plants at points with
integer coordinates.
Every morning after waking up, the elephant performs his
morning exercise, happily jumping from plant to plant. For
reasons best left undiscussed, the elephant can always jump only to
another plant with both coordinates larger than the coordinates of
the plant it is currently on. In other words, from plant (x1, y1) the
elephant can jump to plant (x2, y2) only if x2 > x1 and y2 > y1.
The elephant can start his exercise at any plant on the lake.
Write a program that, given the coordinates of all plants, calculates
the length of the longest sequence of plants the elephant can visit.
Additionally, calculate the number of different such longest
sequences. Because this second number can be large, calculate it
modulo 1 000 000 007.
Input
The first line contains the integer N (1 ≤ N ≤ 300 000), the number of plants.
Each of the following N lines contains the coordinates of one plant,
two integers between 0 and 10^9.
No two plants will have the same pair of coordinates.
Output
On the first line output the length of the longest sequence of plants
the elephant can jump on.
On the second line output the number of such sequences of maximum length,
modulo 1 000 000 007.
Sample
Sample input
input
11
8 6
7 4
5 4
5 1
5 6
6 2
3 2
4 3
4 5
3 5
2 4
output
4
3
input
6
1 3
2 2
3 1
5 3
4 4
3 5
output
2
7
Được gửi lên bởi:  ~!(*(@*!@^& 
Ngày:  20090302 
Thời gian chạy:  1s 
Giới hạn mã nguồn:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Ngôn ngữ cho phép:  Tất cả ngoại trừ: ERL GOSU JSRHINO NODEJS PERL6 PYPY RUST SED VB.NET 
Nguồn bài:  COI 08 
hide comments


20191105 15:38:43
dijkstra ac 

20181116 04:15:50
mod nho xu li so am 

20180811 17:50:31
IT ac :D http://bit.ly/2FnjkEm sạch ko tỳ vết :v Last edit: 20190111 17:38:02 

20180112 08:48:29
kho vai noi ra Last edit: 20180112 08:49:27 

20180101 02:13:43
1/1/2018 VOI ledacthuongvq 

20171231 10:10:47 hồ vãn tuấn
1 0 0 thi sao 

20170621 04:36:39
đéo ns nhiều 1 đấm ac :) cơ mà nghĩ lâu vãi 

20170618 03:53:27
Bài này LIS cơ bản thôi có gì mà IT 2D :) 

20160826 18:10:09 Sơn Tùng MTP
BIT 2D đồ đủ kiểu. Đúng là làm quá mà... :)) 

20160615 04:11:16
Duyet trau la AC lien =)) 