krish2004's blog

By krish2004, history, 2 days ago, In English

I cant understand why https://codeforces.com/contest/1987/submission/268352950 is not giving TLE but this is https://codeforces.com/contest/1987/submission/268340248. Both have same approach for the same question.

Tags tle, dp
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
2 days ago, # |
  Vote: I like it +3 Vote: I do not like it

you should pass the vectors inside the function via reference. ll DP(int i,int have,vll &cnt,vll &v1,ll n,vvll &dp)

  • »
    »
    2 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    oh okay. thanks

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Pass the vectors inside funcn by reference.