A9931 | Mike and Fish
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
As everyone knows, bears love fish. But Mike is a strange bear; He hates fish! The even more strange thing about him is he has an infinite number of blue and red fish.
He has marked $n$ distinct points in the plane. $i$ -th point is point $(x_{i},y_{i})$ . He wants to put exactly one fish in each of these points such that the difference between the number of red fish and the blue fish on each horizontal or vertical line is at most 1.
He can't find a way to perform that! Please help him.
He has marked $n$ distinct points in the plane. $i$ -th point is point $(x_{i},y_{i})$ . He wants to put exactly one fish in each of these points such that the difference between the number of red fish and the blue fish on each horizontal or vertical line is at most 1.
He can't find a way to perform that! Please help him.
输入格式
The first line of input contains integer $n$ ( $1<=n<=2×10^{5}$ ).
The next $n$ lines contain the information about the points, $i$ -th line contains two integers $x_{i}$ and $y_{i}$ ( $1<=x_{i},y_{i}<=2×10^{5}$ ), the $i$ -th point coordinates.
It is guaranteed that there is at least one valid answer.
The next $n$ lines contain the information about the points, $i$ -th line contains two integers $x_{i}$ and $y_{i}$ ( $1<=x_{i},y_{i}<=2×10^{5}$ ), the $i$ -th point coordinates.
It is guaranteed that there is at least one valid answer.
输出格式
Print the answer as a sequence of $n$ characters 'r' (for red) or 'b' (for blue) where $i$ -th character denotes the color of the fish in the $i$ -th point.
输入输出样例
输入 #1
4 1 1 1 2 2 1 2 2
输出 #1
brrb
输入 #2
3 1 1 1 2 2 1
输出 #2
brr
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted