Блог пользователя Shayan

Автор Shayan, 16 месяцев назад, По-английски

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
Разбор задач Codeforces Round 991 (Div. 3)
  • Проголосовать: нравится
  • +18
  • Проголосовать: не нравится

»
16 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

im ngl if you managed to tle on this you lowkey deserve it just take the extra 10 seconds to optimize

  • »
    »
    16 месяцев назад, скрыть # ^ |
    Rev. 3  
    Проголосовать: нравится 0 Проголосовать: не нравится

    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.

    • »
      »
      »
      16 месяцев назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      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!

»
16 месяцев назад, скрыть # |
Rev. 5  
Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    16 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    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

    • »
      »
      »
      16 месяцев назад, скрыть # ^ |
      Rev. 3  
      Проголосовать: нравится 0 Проголосовать: не нравится

      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.

      • »
        »
        »
        »
        16 месяцев назад, скрыть # ^ |
        Rev. 2  
        Проголосовать: нравится 0 Проголосовать: не нравится

        Yeah, you can do by

        Only open if stuck

        by doing this you dont need the i-- either

»
16 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Shayan Bro, is there any way to do problem D with a custom comparator and exchange argument? I tried but failed.

»
16 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

hmm