A9445 | Sereja and Contests
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
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 $num_{2}$ $num_{1}$ " (where $num_{2}$ is the identifier of this $Div2$ round, $num_{1}$ is the identifier of the $Div1$ round). It is guaranteed that $num_{1}-num_{2}=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$ .
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 $num_{2}$ $num_{1}$ " (where $num_{2}$ is the identifier of this $Div2$ round, $num_{1}$ is the identifier of the $Div1$ round). It is guaranteed that $num_{1}-num_{2}=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.
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.
The maximum number of rounds equals $3$ . In this case all unused identifiers belong to usual $Div2$ rounds.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted