wuhudsm's blog

By wuhudsm, history, 2 months ago, In English

A

Idea:MathModel

Hints
Analysis
code(Python)

B

Idea:MathModel

solution
code

C

Idea:imranakki

solution
code(C++)

D

Idea:MathModel

short solution
Very Long Analysis
code

E

Idea:wuhudsm

The intended solution is $$$O(n)$$$.

solution
code(C++)

F

Idea:wuhudsm

solution
code

G

Idea:Timosh

solution
code
  • Vote: I like it
  • +14
  • Vote: I do not like it

»
2 months ago, # |
Rev. 2   Vote: I like it +9 Vote: I do not like it

E can likely be solved with SQRT tree in O(n log log n)/O(1)

which is a shame because I didn’t have that prepared and only have a block-disjoint sparse table of O(n log n/B)/O(B) which is unfortunately not fast enough (maybe it is fast enough in C++, idk)

Update: Unfortunately, the AI-translated natural divide and conquer approach passed, with room to spare, 288002439