Can anyone explain the solution for this problem 102014F - Directional Resemblance ?
The problem basically says:
We are given N vectors in 3D and we want to find 2 vectors such that the angle between them is minimum.
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
2 | atcoder_official | 162 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | nor | 150 |
Can anyone explain the solution for this problem 102014F - Directional Resemblance ?
The problem basically says:
We are given N vectors in 3D and we want to find 2 vectors such that the angle between them is minimum.
Name |
---|
sort by polar angle?
And then the minimum has to be between 2 consecutive vectors ?
Yes. If you want to practice implementing: https://mirror.codeforces.com/contest/598/problem/C
Thanks
Those 2 problems are completely different...
How so? I didn't download the OPs problemset, but it does "minimum angle between all pairs of vectors is what they're looking for.
In the problemset the vectors in question are 3d...
http://neerc.ifmo.ru/trains/zurich/analysis/20170426.pdf
Google is your friend!
Thank you
I solved that problem with a KD tree. Normalize the vectors, the distance will be proportional to the angle between them so you can use a KD tree to answer closest point.
Or you can use the same thing normalizing vectors in the sphere of same radius and solve it with the general idea for closest pairs (the idea in the editorial)