CF401B.Sereja and Contests
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
The first line contains two integers: x (1<=x<=4000) — the round Sereja is taking part in today, and k (0<=k<4000) — the number of rounds he took part in.
Next k lines contain the descriptions of the rounds that Sereja took part in before. If Sereja took part in one of two simultaneous rounds, the corresponding line looks like: "1 num2 num1 " (where num2 is the identifier of this Div2 round, num1 is the identifier of the Div1 round). It is guaranteed that num1−num2=1 . If Sereja took part in a usual Div2 round, then the corresponding line looks like: "2 num " (where num is the identifier of this Div2 round). It is guaranteed that the identifiers of all given rounds are less than x .
输入格式
Print in a single line two integers — the minimum and the maximum number of rounds that Sereja could have missed.
输出格式
In the second sample we have unused identifiers of rounds 1, 6, 7. The minimum number of rounds Sereja could have missed equals to 2. In this case, the round with the identifier 1 will be a usual Div2 round and the round with identifier 6 will be synchronous with the Div1 round.
The maximum number of rounds equals 3 . In this case all unused identifiers belong to usual Div2 rounds.
输入输出样例
输入#1
3 2 2 1 2 2
输出#1
0 0
输入#2
9 3 1 2 3 2 8 1 4 5
输出#2
2 3
输入#3
10 0
输出#3
5 9
说明/提示
In the second sample we have unused identifiers of rounds 1, 6, 7. The minimum number of rounds Sereja could have missed equals to 2. In this case, the round with the identifier 1 will be a usual Div2 round and the round with identifier 6 will be synchronous with the Div1 round.
The maximum number of rounds equals 3 . In this case all unused identifiers belong to usual Div2 rounds.