| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3611 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | Radewoosh | 3415 |
| 8 | Um_nik | 3376 |
| 9 | maroonrk | 3361 |
| 10 | XVIII | 3345 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 162 |
| 2 | adamant | 148 |
| 3 | Um_nik | 146 |
| 4 | Dominater069 | 143 |
| 5 | errorgorn | 141 |
| 6 | cry | 138 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 10 | soullless | 133 |
|
0
Sorry, I forgot.
|
|
0
Auto comment: topic has been updated by bao987 (previous revision, new revision, compare). |
|
0
Is it true that they really share the same trick? Thank you. |
|
0
Problem 2. WiFi Stations (7 points) Alice is designing a wired internet connection system for WiFi stations. Specifically, on the coordinate plane there are n WiFi stations, numbered from 1 to n. The i-th station (1 ≤ i ≤ n) has coordinates (xi, yi). In order for a station to broadcast internet, Alice must connect it to the internet via a cable to one station. If station i already has internet, it can broadcast within a radius of ri, and any station within that radius will also have internet. That station can in turn continue to broadcast within its own radius, and so on… More precisely, if a station with coordinates (x, y) and radius r has internet, then any station with coordinates (u, v) such that (x – u)² + (y – v)² ≤ r² will also have internet. Alice wants to connect cables to as few stations as possible so that all n stations can broadcast internet. Requirement: Given the coordinates and radii of the stations, help Alice determine the minimum number of stations that need to be connected via cables so that all n stations can broadcast internet. Input: (from the file WIFI.INP) The first line contains a positive integer n (n ≤ 2 × 10^5), the number of stations. Each of the next n lines contains three integers xi, yi, ri (|xi|, |yi| ≤ 10^6; 0 < ri ≤ 10^6). Note: There may be multiple stations at the same location. Output: (to the file WIFI.OUT) Output a single positive integer — the minimum number of stations that need to be connected via cables so that all n stations can broadcast internet. Constraints: Subtask 1 (20%): n ≤ 10 Subtask 2 (20%): n ≤ 1000 Subtask 3 (20%): All stations’ coordinates lie on the same straight line Subtask 4 (20%): ri ≤ 10 Subtask 5 (20%): No additional constraints This is the full problem statement that I’m asking about. Perhaps the problem you suggested to me and this one are two completely different problems. |
|
0
Yes, exactly. So I need some ideas from everyone — maybe a sweep line? |
|
0
Oh, sorry, I completely forgot to mention what I need. Right now, I don’t know how to solve this problem yet. I’m guessing it might be related to geometry or sweepline, but I don’t have a concrete approach. I’d like everyone’s help — do you have any ideas for a solution? |
|
0
Auto comment: topic has been updated by bao987 (previous revision, new revision, compare). |
|
0
Maybe I went a bit overkill and couldn’t come up with anything simpler, so I ended up implementing something quite similar to the Min25 sieve combined with Lagrange interpolation. Anyway, thank you very much! P.S.: I'm still a bit unsure whether one particular problem truly requires using the Min25 sieve or not. |
|
0
Oh oh, thank you — even though it’ll probably get me “judged” :)))) |
|
0
You mean using a segmented sieve combined with the trick of storing precomputed values in constant arrays, like the number of elements with exponent , etc., and then computing the answer? |
|
0
Thank you, I guess I have to learn the Min25 sieve now, because when I manually ran the segmented sieve with n, m = 3e7, it already took about 1–2 seconds, so it can’t be optimized further. |
|
0
Sorry, but since m ≤ 3e8, creating an array for storage is completely impossible. |
|
0
Thank you |
|
0
Thank you, but libraries like GNU PBDS are probably not allowed on OJ. If using a BBST, could you give me some suggestions? For example, how to insert, delete, and query? |
|
0
Ah, I understand how sweepline works now, but the problem is my code is running into TLE. So, is it really necessary to switch to a BBST? If not, how can I optimize it now (since I haven't learned BBST yet)? Link code: https://ide.usaco.guide/OVaceGEffjT2SpKEf-5 |
|
0
Sorry, may I ask a bit more: do you mean that each event corresponds to a vertex sweep? And if we sweep by vertices, then each vertex will have two edges associated with it in one event. So how do we handle each of these events? Apologies — I'm still not very good at these kinds of problems. |
|
0
Auto comment: topic has been updated by bao987 (previous revision, new revision, compare). |
| Name |
|---|


