CF547D.Mike and Fish
省选/NOI-
通过率:0%
时间限制:3.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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.
众所周知,熊都喜欢鱼。但迈克是一只奇怪的熊——他讨厌鱼!更奇怪的是,他拥有无限多的蓝色鱼和红色鱼。

他在平面上标出了 n 个互不相同的点,其中第 i 个点为 (xi,yi)。他希望在每个点上恰好放置一条鱼(即每点放一条鱼,鱼的颜色为红色或蓝色),使得每条水平线或垂直线上红色鱼的数量与蓝色鱼的数量之差的绝对值至多为 1。
他找不到满足条件的放置方法!请帮助他。
输入格式
The first line of input contains integer n (1 ≤ n ≤ 2 × 105).
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 × 105), the i-th point coordinates.
It is guaranteed that there is at least one valid answer.
输入的第一行包含一个整数 n(1 ≤ n ≤ 2 × 105)。
接下来的 n 行描述各点的信息,其中第 i 行包含两个整数 xi 和 yi(1 ≤ xi, yi ≤ 2 × 105),表示第 i 个点的坐标。
保证至少存在一个合法答案。
输出格式
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.
将答案输出为一个由 n 个字符组成的序列,每个字符为 'r'(表示红色)或 'b'(表示蓝色),其中第 i 个字符表示第 i 个位置上鱼的颜色。
输入输出样例
输入#1
4 1 1 1 2 2 1 2 2
输出#1
brrb
输入#2
3 1 1 1 2 2 1
输出#2
brr
输入解题思路,AI测评打分。不知道怎么写?