Note: The text editorials will be provided by the authors of the round. This video tutorial acts as an additional resource for those who prefer video over text, not as a substitute for the text editorial.
2050A — Line Breaks
Video
2050B — Transfusion
Video
2050C — Uninteresting Number
Video
2050D — Digital string maximization
Video
2050E — Three Strings
Video
2050F — Maximum modulo equality
Video
2050G — Tree Destruction
Video









im ngl if you managed to tle on this you lowkey deserve it just take the extra 10 seconds to optimize
I wasn't trying to be rude I'm just actually curious as to why it didn't work. I am doing these questions not in the contest but in my own pace out of interest. Idm that it was tle'd but it's more or less trying to understand my solutions time complexity. My mistake was I didn't return 0 but -1 it was a silly mistake.
oh sorry didnt mean to be rude, i just think that you should have extra complexity for no reason if its not any harder to implement or think about, but it seems you had another problem. happy coding!
Any idea on why this submission is causing a TLE for Problem D: 295113992. Could it be due to the i-- part? I don't think i-- is causing tle because the purpose of --i is to find a "better" digit that can be brought forward. This ensures that for the current position i, the best digit is brought to the front before proceeding but we bring forward k elements we will not reconsider them in constructing better digit. So number of element that can be brought forward also decrease for a given n
Firstly, this is D, not C. Secondly, I believe the TLE is from sorting (which takes nlogn) within the loop making
n^2logn
same story for skip
Lever So i-- is not an issue right? If I manage to optimize sorting part, the solution should work — not sure how but assuming ? I'm saying i-- is not a concern because, for example, If we're bringing forward 1e3 elements for each i, this operation will only be performed at most 200 times, given that n = max i.e. 2e5. For the first 200 iterations, we're bringing forward 1e3 better digits. After that, we can't repeat this process since there are no more elements left to bring forward.
Yeah, you can do by
Swapping repeatedly with cur,cur-1 until you're back to i for the best current position fit, as this would only be 9 at most, which is fine since that's still 9n this results in 1.8e6 which is fine, check my submission if needed
by doing this you dont need the i-- either
Shayan Bro, is there any way to do problem D with a custom comparator and exchange argument? I tried but failed.
I did it using custom comparator and exchanges . You can check out : https://mirror.codeforces.com/contest/2050/submission/295064096 Hope it helps.
thanks tan074
hmm