Radio Waves zoj 3370

Radio Waves
Time Limit: 10 Seconds      Memory Limit: 32768 KB      Special Judge

It is well known, that radio waves interfere, so if two closely located radio transmitters use the same frequency, the quality of the programs is poor.

The company NateRadio is planning to transmit its programs in Flatland. The Ministry of Health and Communications has issued the license to the company that allows it to use two different frequencies for the transmission.

The company has n slots for radio transmitters located at different points of the country. However, the transmitters themselves are not yet bought. The managers of the company want to know what power the transmitters should be. The power of the transmitter affects the range it transmits the radio program to.

All transmitters will have the same power. Transmitters will be installed into the slots and each will be tuned to one of the two allowed frequencies. The power of the transmitters must be selected in such a way that the programs from no two transmitters tuned to the same frequency are simultaneously received at any point. Each slot must be used.

Since the company wants the programs to be received by most people, it wants to install as powerful transmitters as possible --- the range of the transmission must be maximal.

Input

The first line of the input file contains n --- the number of slots for the transmitters (3 ≤ n ≤ 1200). The following n lines contain two integer numbers each --- the coordinates of the corresponding slots. Coordinates do not exceed 104 by their absolute value. All slots are different.

There are multiple cases. Process to the end of file.

Output

On the first line of the output file print the maximal possible range of the transmitters. On the second line print n integer numbers --- for each transmitter slot print 1 if the transmitter in this slot must use the first frequency, or 2 if it must use the second one.

You answer must be accurate up to 10-6. All inaccurances under this level will be resolved in your favor.

Sample Input
4
0 0
0 1
1 0
1 1
Sample Output
0.70710678118654752
1 2 2 1

Author: Andrew Stankevich
Source: Andrew Stankevich's Contest #11

wa 无数次!
原因:(还记得的)
1.  high,low 对于solve成功与否的判断:
     ok 的话low=mid;       else  high=mid-1;
     mid>=high-1时跳出,在判断high是否满足……这样才能保证二分的距离正确。
2. bfs的判出条件,
   如果像开始那样while(num<n&&!(Q1.empty()&&Q2.empty())),那如果队列非空但是num>n咋办呢?!所以应该是while(!(Q1.empty()&&Q2.empty()))
其他错误错的不大有意义,在此不再赘述……
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值