TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description







Input Format

There are multiple test cases in the input file, terminated by EOF.


The first line contains an integer N (N<=200000), the number of companies that have applied for renting the auditorium. Lines 2 to N+1 contain two integers.
The integers on line i+1 are the starting and ending dates for the request from company i.


For each
company’s request, the starting day is always greater than or equal to 1 and
the ending day never exceeds 109
.

Output Format

The first line of the output should consist of an integer M, the maximum
number of companies to which the auditorium can be rented. This should be
followed by a line containing M integers listing the identities of the companies
that appear in the lexicographically smallest such set.

Sample Input 1

4
4 9
9 11
13 19
10 17

4
4 9
9 11
13 19
10 17

Sample Output 1

2
1 3
2
1 3

Hints

Problem Source

Migrated from old NTUJ.

APIO'09, problem 2

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 10000 65536 200