100mil's blog

By 100mil, history, 2 years ago, In English

Can someone help me as to why I am getting a memory limit exceeded result in problem F of last contest question:https://codeforces.com/contest/1675/problem/F my solution:https://codeforces.com/contest/1675/submission/156068401

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

| Write comment?
»
2 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

You're copying the temp and adj vectors many times during the dfs, that'll get you MLE

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

A small note for you:

These type of questions can be asked in the tutorial blog of that contest. Creating a new blog to ask about simple problems with your solution is disturbing for the community as all the posts appear in the homepage as long as it's active.

Don't take it personally. Thanks.