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

Автор BladeRunner, история, 7 недель назад, По-английски

You can now find the contest in the public gym, ICPC-de-Tryst 2024 (the ghost submissions can still be accessed in the older mashup).

Top 15
IITD Top 3
First Solves
Tutorial is loading...

Setter: BladeRunner

code
Tutorial is loading...

Setter: 33_arsenic_75, Preparation: islingr

code
Tutorial is loading...

Setter: sahilkumar_1

code
Tutorial is loading...

Setter: ajmeraraghav99

code
Tutorial is loading...

Setter: Azm1t

code
Tutorial is loading...

Setter: PROELECTRO444

code
Tutorial is loading...

Idea:PROELECTRO444 , BladeRunner Preparation: PROELECTRO444

code
Tutorial is loading...

Setter: islingr

code
Tutorial is loading...

Setter: Surver

code
Tutorial is loading...

Setter: BladeRunner

code
Tutorial is loading...

Setter: MridulAhi

code
Разбор задач ICPC-de-Tryst 2024
  • Проголосовать: нравится
  • +51
  • Проголосовать: не нравится

»
7 недель назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Auto comment: topic has been updated by BladeRunner (previous revision, new revision, compare).

»
7 недель назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Auto comment: topic has been updated by BladeRunner (previous revision, new revision, compare).

»
7 недель назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Why is this giving TLE for G : link. The logic is quite similar to the editorial and time complexity is N.log^2(N) .

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

    It is because of using map in the binary search function. Simply push $$$(a[i]-(pw-s),1)$$$ and $$$(a[i]+(pw-s)+1,-1)$$$ in a vector and sort it and rest is same.

    • »
      »
      »
      7 недель назад, # ^ |
        Проголосовать: нравится +4 Проголосовать: не нравится

      Does using map change the time complexity ? Because even after putting intervals in a vector, we are sorting it. Also this map solution got accepted : link

      Also, one more thing I would like to bring to your notice. Even O(N^2) solution got accepted for Problem E.link. I feel the test cases were weak for the problem.

      • »
        »
        »
        »
        7 недель назад, # ^ |
        Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится

        For your first question, it doesn't change the complexity but map has a higher constant factor so that might have caused issue, the solution that you attached of map creates some less map entries due to the min/max operation so got passed for that particular bottleneck test case (where $$$n$$$ achieved its largest possible value)

        For the second, we apologise for that and hope that not many teams got affected due to this and would ensure stronger test cases in future.