mahmoud_osama08's blog

By mahmoud_osama08, history, 8 months ago, In English

Today we teach the ability to perform range queries in $$$\mathcal{O}(1)$$$, regardless of the query rekwaired.

Consider $$$Q = [l, r]$$$.

Iterate over all quadraubles $$$\left(a,b,c,d\right)$$$, add $$$Q[a]\times Q[b]\times Q[c] - Q[d]^2$$$

Now to solve single qwery, output $$$\text{Quadruble}[l][r^2][r-l^r][l+r^l]$$$.

The precomputation took $$$\mathcal{O}(1)$$$ time because $$$a,b,c,d\le 10^{18}$$$, a constant

You solve every query in $$$\mathcal{O}(1)$$$ cuz u immediately output the formula.

if you dont trust me, try it in this problem

you can see that my code is fastest ($$$0.00$$$ s)

  • Vote: I like it
  • -35
  • Vote: I do not like it

»
8 months ago, # |
  Vote: I like it +16 Vote: I do not like it

Get a life.

»
8 months ago, # |
Rev. 5   Vote: I like it -10 Vote: I do not like it

Deleted

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

One can process everything that the program might receive in "O(1)" time since it's always bounded. How to process it is an another story.