Thanks for participating!
The top 5 contestants from this week's contest are:
Great job guys!
Here's the Editorial for the contest. Feedback of any kind is appreciated in the comments.
Tutorial
Solution
Tutorial
Solution
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
STL #1 Round Editorial
Thanks for participating!
The top 5 contestants from this week's contest are:
Great job guys!
Here's the Editorial for the contest. Feedback of any kind is appreciated in the comments.
Let's store the last moment when somebody gets a tea in the variable $$$lst$$$. Then if for the $$$i-th$$$ student $$$lst ≥ ri$$$ then he will not get a tea. Otherwise he will get it during max($$$lst$$$ + 1, $$$l_i$$$) second. And if he gets a tea then $$$lst$$$ will be replaced with the answer for this student.
[submission:159713776]
Let's use STL function lower_bound()
to solve this problem. First make vector of pair of <Total_Damage,Time_Stamp> and then use the lower_bound()
function to find the smallest Total Damage just greater than or equal to $$$c_j$$$ and then print the Time Stamp corresponding to that damage. Reference for lower_bound()
function
Time Complexity: $$$O(n+m\cdot log(n))$$$
NOTE: This problem could have been solved using binary search but wasn't needed since you know STL.
Time Complexity: $$$O(n+m\cdot log(m))$$$
[submission:160223611]
Rev. | Язык | Кто | Когда | Δ | Комментарий | |
---|---|---|---|---|---|---|
en12 | Eren-Jaeger | 2022-06-12 23:40:11 | 1 | (published) | ||
en11 | Eren-Jaeger | 2022-06-12 23:39:15 | 47 | |||
en10 | Eren-Jaeger | 2022-06-12 23:37:02 | 11 | Tiny change: ' function `fractal(' -> ' function `fractal(' | ||
en9 | Eren-Jaeger | 2022-06-12 23:33:27 | 488 | |||
en8 | Eren-Jaeger | 2022-06-12 23:29:34 | 879 | Tiny change: ')` for $(x1, y1)$ be' -> ')` for $(x_1, y1)$ be' | ||
en7 | Eren-Jaeger | 2022-06-12 23:14:00 | 987 | |||
en6 | Eren-Jaeger | 2022-06-12 23:08:48 | 1521 | |||
en5 | Eren-Jaeger | 2022-06-12 23:03:17 | 1923 | Tiny change: 'x + 1, r)$, where by' -> 'x + 1, r)$ , where by' | ||
en4 | Eren-Jaeger | 2022-06-12 22:50:10 | 411 | Tiny change: 'nt state. If the to' -> 'nt state. If the to' | ||
en3 | Eren-Jaeger | 2022-06-12 22:41:51 | 297 | Tiny change: 'roach 1:\n\nLet's us' -> 'roach 1:\nLet's us' | ||
en2 | Eren-Jaeger | 2022-06-12 22:31:42 | 524 | Tiny change: 'in-cpp/)\nNOTE: Th' -> 'in-cpp/)\n\nNOTE: Th' | ||
en1 | Eren-Jaeger | 2022-06-12 22:09:47 | 1223 | Initial revision (saved to drafts) |
Название |
---|