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

30557번 - Don't Be Fake 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB38322580.645%

문제

DontBeFake is an app where people get a notification at a random point in time, and they have to take a picture of what they are doing right now.

You have $N$ friends on DontBeFake. Each friend has a set of intervals of seconds $[L, R]$ when they are available. If they get a notification at second $s$ and they are available, they will take a picture and you will get to see it. Because the DontBeFake app is slow and so is taking a picture, even if they are available a second later, they will not have time to take the picture. All friends live in the same time zone and will get one notification at exactly the same time in the day. All times are specified as seconds from midnight.

You want to know what is the maximum number of pictures you can view in the day, over all possible seconds that the notification can arrive. In addition, you also want to know how many different seconds the notification could arrive for the maximum number of pictures to be taken.

입력

Input begins with a line containing the integer $N$ (1ドル \leq N \leq 50$). The next $N$ lines each describes the set of available intervals for the $N$ friends. Each such line starts with an integer $M$ (1ドル \leq M \leq 10$) followed by $M$ pairs of integers $L_i,ドル $R_i$ ($L_i \leq R_i$) meaning that the friend is available between $L_i$ and $R_i$ seconds, inclusive. It is guaranteed that $R_i < L_{i+1}$ for all 1ドル \leq i < M,ドル so that the intervals do not overlap. It is also guaranteed that 0ドル \leq L_i, R_i < 86,400円$.

출력

Output on the first line the maximum number of pictures you can view in the day. On the second line, output the total number of seconds the notification could arrive for the maximum number of pictures to be taken.

제한

예제 입력 1

3
1 0 20000
2 10000 20000 40000 60000
1 15000 80000

예제 출력 1

3
5001

예제 입력 2

3
1 0 10000
2 10000 20000 30000 40000
2 20000 30000 50000 80000

예제 출력 2

2
3

힌트

출처

ICPC > Regionals > North America > Rocky Mountain Regional > 2023 Rocky Mountain Regional Contest J번

  • 문제를 만든 사람: Howard Cheng, Nick Wu
(追記) (追記ここまで)

출처

대학교 대회

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

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