shinghalrishabh's blog

By shinghalrishabh, history, 4 years ago, In English

In english tutorial of https://codeforces.com/contest/460/problem/A, it is given that answer can be calculated using formula

 , but I am not able to understand how we reached at this formula. Please help me in this.

Here is my accepted submission , but my solution will exceed time limit if value of n is very large. Fortunately in this question input size limit is very small, hence my solution works.

https://codeforces.com/contest/460/submission/76206660

Full text and comments »

By shinghalrishabh, history, 9 years ago, In English

How to find all occurences of each substring in the given string.Please give me some suggestions

Full text and comments »

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

By shinghalrishabh, 9 years ago, In English

((n+m)Cn) %mod here n and m can be upto 10^9 and mod is 10^6+3. Can someone help me in this calculating the correct answer

Full text and comments »

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