| # | User | Rating |
|---|---|---|
| 1 | Benq | 3857 |
| 2 | jiangly | 3810 |
| 3 | maroonrk | 3534 |
| 4 | tourist | 3528 |
| 5 | Kevin114514 | 3510 |
| 6 | turmax | 3411 |
| 7 | Um_nik | 3387 |
| 8 | Radewoosh | 3367 |
| 9 | heuristica | 3322 |
| 10 | strapple | 3317 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 158 |
| 2 | maspy | 150 |
| 3 | Um_nik | 146 |
| 4 | Errichto | 139 |
| 5 | adamant | 136 |
| 6 | maroonrk | 134 |
| 7 | DNR | 133 |
| 8 | Dominater069 | 131 |
| 9 | Proof_by_QED | 130 |
| 9 | AmShZ | 130 |
|
0
You can read editorial, in which proves why it enough to add $$$(l, l - 1)$$$ and $$$(r, r + 1)$$$ edges |
|
0
You need to try add edges $$$(r, r + 1)$$$ too. |
|
+244
Yes, the author's solution in C was incorrect. We haven't noticed it in 9 months. We stressed this solution (as it turned out, we stressed it terribly), I even wrote an analysis with a proof of this greed. Now an exercise for the reader, find the error in this tutorial: Tutorial First, let's remember for each dish how many other \bf{unplanted} people like it, let for dish $$$i$$$ this value will be equal to $$$b_i$$$. The following greedy solution works: let's try to take a dish $$$j$$$ such that $$$b_j$$$ is the maximum of the array $$$b$$$, consider another free table with a maximum capacity of $$$k$$$. Then you can put $$$\min(b_j, c_k)$$$ guests at table $$$k$$$, and change $$$b_j := b_j - \min(b_j, c_k)$$$. After that, you need to continue the algorithm, if there are still free tables and unsettled guests. If there are unseated guests at the end, we will seat them at any tables — they will not be satisfied, that is, we need to minimize the number of free seats. Let's prove this solution: 1) Obviously, it is not profitable to put dish $$$i$$$ on the table and at the same time not seat the maximum possible number of people who have dish $$$i$$$ as their favorite. 2) It is profitable to take the maximum $$$b_i$$$ and seat $$$k$$$ at the table with the maximum $$$c_k$$$. Let's assume that we seated at table $$$k$$$ not $$$b_i$$$, but another $$$b_j \le b_i$$$. Then if:
That is, taking the maximum $$$b_i$$$ is no worse than taking another $$$b_j \le b_i$$$, so we are sure that at each iteration of the algorithm we seat the maximum possible number of guests. |
|
0
The most cyan round ever. It will be interesting! |
|
-42
The most unbalanced and unprincipled round I've ever seen, change my mind... |
|
0
As a tester, I don't remember tasks. spoiler Also I haven't been in SIS winter |
|
0
|
|
0
Auto comment: topic has been updated by AndreyPavlov (previous revision, new revision, compare). |
|
0
Auto comment: topic has been updated by AndreyPavlov (previous revision, new revision, compare). |
|
0
Auto comment: topic has been updated by AndreyPavlov (previous revision, new revision, compare). |
|
0
I do not consider the Fenwick tree and the non-recursive segment tree to be similar in structure. |
|
+17
All good, but benchmark have 1 error: Fenwick != Segment tree |
|
+15
Another div1 with trygub support? It will be fine. |
|
+12
This was very interesting and good round! Thanks for this tasks. |
| Name |
|---|


