Please read the new rule regarding the restriction on the use of AI tools. ×

sarwarkhan's blog

By sarwarkhan, history, 6 years ago, In English

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.
  • Vote: I like it
  • +18
  • Vote: I do not like it

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
6 years ago, # |
  Vote: I like it +3 Vote: I do not like it

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

Ideas/Hints?

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    HLD and binary search.

    You can read about it here.

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +2 Vote: I do not like it

      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 years ago, # ^ |
          Vote: I like it +7 Vote: I do not like it

        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 years ago, # |
  Vote: I like it 0 Vote: I do not like it

What is the approach for "help ramanujan"?