sameer_hack's blog

By sameer_hack, history, 6 years ago, In English

I am trying to solve this problem and I am not able to understand the editorial that why
dp[0][i]=min(dp[1][i-a]+sum-of-whites(i-a+1,i))
dp[1][i]=min(dp[0][i-a]+sum-of-blacks(i-a+1,i))
where a belongs to [x,y]
Editorial Link :- Editorial
Question Link :- Question

Full text and comments »

  • Vote: I like it
  • -6
  • Vote: I do not like it

By sameer_hack, history, 6 years ago, In English

I tried to solve this question using Binary Search. And I am not able to understand why one of my solutions is giving me the wrong answer while other got accepted.
Problem Link
Submission 1 (Wrong)
Submission 2 (Accepted)
Submission 3 (Accepted)

Full text and comments »

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

By sameer_hack, history, 7 years ago, In English

The person is also not that much good at maths but wants to improve his mathematical skills in 1 to 2 years practicing the book. If you have multiple books in mind for please list it in the order of preference i.e which should be studied first. Thanks in advance !! :)

Full text and comments »

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