Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

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

NIT Jamshedpur brings to you CODEMANIA, the competitive programming event of its tech fest OJASS’19 with prizes worth 36,000 INR.
We would like to invite you all to join the contest on codechef which will be held on 28th FEB 2019, 21:30 IST.
Codemania Prelims — Contest Link
This will be a 2.5 hours contest consisting of 6 problems. Problems are prepared by neeleshsinha , joker_in , vikas_kumar and sarwarkhan.

Codemania '19

Note: Prizes will be given to the winners of the Onsite round to be held at NIT Jamshedpur during Ojass-19 (5th to 7th April).
Please read the contest details before participating. To be eligible for the prizes, fill this form.
  • Проголосовать: нравится
  • +18
  • Проголосовать: не нравится

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

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

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

How to solve Reimer Tiemann.. https://www.codechef.com/CONA2019/problems/COMA19E

Ideas/Hints?

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

    HLD and binary search.

    You can read about it here.

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

      Isn't that O(Q(logn)^3), why were the constraint for Q so high (5*10^5)? or is there some observation to improve the time complexity?

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

        It can be done in O(Q(log(n))^2). For any query: First, find the chain number of possible answer O(log(n)^2). Then binary search in that chain to find the answer O(log(n)^2).

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

What is the approach for "help ramanujan"?