Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
|---|---|---|---|---|---|---|
| 2038 | 2024-2025 ICPC, NERC, Southern and Volga Russian Regional Contest (Unrated, Online Mirror, ICPC Rules, Preferably Teams) | FINISHED | False | 18000 | 44479523 | Nov. 18, 2024, 10:35 a.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 480 ) | F | Alternative Platforms | PROGRAMMING | combinatorics data structures fft math sortings | 2500 |
Suppose you are working in the Ministry of Digital Development of Berland, and your task is to monitor the industry of video blogging. There are (n) bloggers in Berland. Recently, due to the poor state of the main video platform in Berland, two alternative platforms were introduced. That's why bloggers started to reupload their videos to these alternative platforms. You've got the statistics that the (i)-th blogger uploaded (v_i) videos to the first alternative platform and (r_i) videos to the second alternative platform. You think that a potential user will be upset if even at least one of his favorite bloggers doesn't upload anything. However, if a blogger uploads videos to both platforms, the user will watch that blogger on the platform where more videos are available. So, you've come up with the following function to estimate user experience. Suppose a user watches (k) bloggers (b_1, b_2, \dots, b_k); then, let user experience be ()E(b_1, \dots, b_k) = \max\left(\min_{i=1..k}{vb_i}, \min_{i=1..k}{rb_i}\right).() In order to get some statistics, you want to calculate the value (\mathit{avg}_k) that is equal to an average experience among all subsets of bloggers of size (k). Also, you have to calculate (\mathit{avg}_k) for each (k) from (1) to (n). Since answers may be too large, print them modulo (998\,244\,353). The first line contains a single integer (n) ((1 \le n \le 2 \cdot 10^5)) — the number of bloggers. The second line contains (n) integers (v_1, v_2, \dots, v_n) ((0 \le v_i \le 10^6)), where (v_i) is the number of videos of the (i)-th blogger on the first alternative platform. The third line contains (n) integers (r_1, r_2, \dots, r_n) ((0 \le r_i \le 10^6)), where (r_i) is the number of videos of the (i)-th blogger on the second alternative platform. Print (n) integers (\mathit{avg}_1, \mathit{avg}_2, \dots, \mathit{avg}_n). |
No solutions yet.