NafisAlam's blog

By NafisAlam, history, 11 months ago, In English

Can someone explain to me why did I get MLE? 580C - Kefa and Park MLE : 216547229 AC : 216548333

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

»
11 months ago, # |
  Vote: I like it +6 Vote: I do not like it

You are passing the vector 'visited' by value, which means every time the function is called it creates a copy of this vector. Instead, call it by reference using vector<bool>& visited instead of vector<bool> visited in the function parameter (just like you did with the vector 'restaurants')