306358: CF1184C3. Heidi and the Turing Test (Hard)

Memory Limit:256 MB Time Limit:15 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Heidi and the Turing Test (Hard)

题目描述

The Cybermen have again outwitted the Daleks! Unfortunately, this time the Daleks decided to abandon these tasks altogether, which means the Doctor has to deal with them. The Doctor can handle the Daleks on his own, but Heidi now has to make sure that the Cybermen are kept busy with this next task. There are $ k $ rings on a plane. For each ring, $ n $ points are uniformly sampled with a small random noise. The task is to recover the rings given only the noisy samples. The rings and the samples are generated as follows. The center of a ring is uniformly sampled from a disk of radius $ 1\,000\,000 $ centered at the origin, and the radius of the ring is uniformly sampled from $ [250\,000, 750\,000] $ . Let $ R $ be a ring with center $ (x, y) $ and radius $ r $ . To sample a point from $ R $ , an angle $ \theta $ is uniformly sampled from $ [0, 2\pi] $ and a distance $ d $ is uniformly sampled from $ [0.9r, 1.1r] $ . The coordinates of the sampled point are then $ (x+d\cos(\theta), y+d\sin(\theta)) $ rounded to the closest integers. The distance between rings is measured by their Hausdorff distance. In our case, the distance between two rings $ R_1, R_2 $ can be written as follow. Let $ d $ be the distance between the two centers and $ r_1, r_2 $ be the radii. Then the distance is $ $dist(R_1, R_2)=\max(\min(d_{--}, d_{-+}),\min(d_{+-}, d_{++}), \min(d_{--}, d_{+-}), \min(d_{-+}, d_{++})) $ $ , where $ d\_{++}=|d+r\_1+r\_2| $ , $ d\_{+-}=|d+r\_1-r\_2| $ , $ d\_{-+}=|d-r\_1+r\_2| $ , $ d\_{--}=|d-r\_1-r\_2| $ .</p><p>We say that a ring $ R\_0 $ is recovered if one of the rings $ R $ in the output has Hausdorff distance less than $ 100\\,000 $ from $ R\_0 $ . </p><p>An output is accepted if all the rings are recovered. It is guaranteed that the distances between any two rings is greater than $ 600\\,000$. Remember that a human can very easily solve this task, so make sure that no human traitors are helping the Cybermen complete this task.

输入输出格式

输入格式


The first line contains an integer $ k $ ( $ 1 \leq k \leq 4 $ ), the number of rings. The second line contains an integer $ n $ ( $ 100 \leq n \leq 1\,000 $ ), the number of samples per ring. The following $ n \times k $ lines contain the samples, one sample per line. Each line contains a pair of integers $ x_i, y_i $ , where $ (x_i, y_i) $ are the coordinates of the $ i $ -th sample.

输出格式


输入输出样例

暂无测试点

说明

Here is how one of tests with $ k=4 $ and $ n=100 $ looks like. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1184C3/d78b71dfb582cda9ad7b1972e1d1931c9fb4a31d.png)You can download the sample input and output [here](//assets.codeforces.com/rounds/1184/c1.zip).

Input

暂时还没有翻译

加入题单

算法标签: