Aleph-null's blog

By Aleph-null, history, 2 months ago, In English

The problem in question is Hamiltonian wall and I wrote a solution to this that works, but I suspect that it is the wrong solution. My solution is this. The reason I suspect that my solution is incorrect is because, if in the DFS function I change the order of the two loops, I get the wrong answer(when that should not be happening). I would really appreciate if anybody could point out what is wrong with DFS function.

Thanks, if you need any clarification regarding some of the terms in my template or regarding my approach, feel free to comment down below EDIT: I removed the lengthy template

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it

By Aleph-null, history, 4 months ago, In English

This editorial problem E1, Erase and Extend, can someone please give a logical explanation as to how the optimal string is supposed to be a repetition of a prefix? The editorial takes a lot of leaps and the comments do not have any explanation. Thanks. (Ask me for further clarification if needed)

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Aleph-null, history, 4 months ago, In English

For problem this, the editorial suggests a naive way in which we break the chain and linearly kill all the monsters(then they present an optimization based on this), how do we know that this is the optimal way? Why can't I first kill monsters from one segment and then once the cascading effect stops, I jump to another monster which(say) has the highest b[i]/a[i] ratio? I need help in understanding this. Thanks in advance. (You can ask for further clarification from me if required)

Full text and comments »

  • Vote: I like it
  • +5
  • Vote: I do not like it

By Aleph-null, history, 4 months ago, In English

The problem in question is problem and I have solved this using another approach, but I want to know why this two pointer approach does not work. Thanks

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it

By Aleph-null, history, 6 months ago, In English

The following code despite being asymptotically fine, is still giving TLE on the 31st test case. I have tried everything, but I am not able to optimize this code further. I need inputs from more coders, any help would be appreciated. The problem link is this and my attempt is this (Incase the code is not readable, inform me I will format and edit in the code)

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it