Shikharraj's blog

By Shikharraj, history, 2 months ago, In English

Hello CF community,

I am stuck on problem (Connect). My solution is exceeding memory limit and I am not sure why.

My submission : 278951587

Chatgpt's Solution: 278954226

My code is similar to chatgpt's, therefore I am not able to find any reasonable differences.

Any suggestions what might be wrong with my code?

Thanks.

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

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

Try setting the vertex as visited when you add it to the queue, instead of doing it later.