I need help for this problem. Please.
# | 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 |
4 | atcoder_official | 160 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | Dominater069 | 154 |
8 | awoo | 154 |
10 | luogu_official | 151 |
Name |
---|
Bruteforce all n points and consider as a "center". There is one straight stripe(lane) with 2 km width and infinite length. Consider all the sptripes with central point on it's edge. For each non central point you should create two events: anlge of a stripe when city enter and leaves the stripe. Sort them by angle. Now you can count how many points lies on each of the stripes in O(n). Total complexity will be O(n^2 * log(n)).
Thanks for your reply. It becomes hard to me to implement your idea. It will be helpful if you kindly explain your idea that is easy to understand for me.
Sorry for my bad English.
Red point is a center. Blue points — other cities. Rotate stripe around it.
There are two pictures: on the first one rightmost point enters in to stripe, on the second one leaves stripe. When you rotate the stripe near 180 degrees, there will one more enter event, and one more leave event (stripe will be upper than red point). Calculate all 4 events for each point, sort them by angle...