Только что прошел очередной этап opencup-а. Предлагаю обсудить задачи здесь.
В частности, хотелось бы узнать решения H и J.
# | 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 | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
Name |
---|
Can anybody share their solution of D, I and J?
I: Firstly, if we will use songs with numbered songi1, songi2, ..., songik, then the total satisfaction will be maximized, if fi1 ≤ fi2 ≤ ... ≤ fik or fi1 ≥ fi2 ≥ ... ≥ fik. We wil sort of fi. Let's dp(i,j) — first i songs assigned and j total length of songs.
dp(i, j) = max{dp(k, j - ti) + pi - (fi - fk)2} = max{dp(k, j - ti) - fk2 + 2fkfi} + pi - fi2 Then we can use convex hull trick optimization. Code
Thanks a lot for your solution.
Hi! I'm writer of problem I! Thanks for your solving!
Hi, I'm the writer of the problem C and H. How was the problems?
I posted the solution of the problem D here.
Hi, can you show me your code for problem H? I always get TL on test 25. My code
UPD I found your code
Some of testers use min-cost-flow, and I used Hungarian method. My solution takes 180ms in worst case.
You can show my codes for all problems from here.
I'm the writer of the problem J. I posted my brief editorial for this problem as a blog entry.