Hello everyone. I am stuck with upsolving problem B from SEERC-2019. Problem statement
Even after reading editorials and realizing that my solution seems correct, I keep getting WA#5 on codeforces. I am doing dp, like described in editorial, and sorting all quest before by $$$x_i$$$. I am using $$$dp[j][k]$$$ array and $$$tmp[j][k]$$$ array on every iteration because I need to use every quest at most one time. So I am doing optimization on $$$tmp$$$ array, and then copy its contents back to $$$dp$$$. Then answer should be at $$$dp[s_1][s_1]$$$.
I`ll be very glad if someone more experienced than me could help me find the test, where my solution fails or maybe just give me some hints.
Thank you!