sabbirh654's blog

By sabbirh654, history, 3 years ago, In English

how to compute sum of primes till 2*10^9. spoj sumprim1: . I saw a dp approach. but could not understand it. kindly explain the solution intuitively and in an easy manner..

dp solution : [](https://mathematica.stackexchange.com/questions/80291/efficient-way-to-sum-all-the-primes-below-n-million-in-mathematica)

Full text and comments »

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

By sabbirh654, history, 4 years ago, In English

we all know that, the very known application of catalan number is, given a grid of n*n. one can move in that grid only right(R) and up(U) direction. how many ways to go from (0,0) to (n,n) so that the diagonal of that grid is not crossed. the solution is. (2n C n) — (2n C (n-1)). My question is : in the standard version, the restriction is to not crossing the diagonal. that means not crossing y = x line. what will be the answer if the equtaion is y = x + k instead of y = x? and the grid is of size n*m instead of n*n?

i have tried to figure it out using reflection trick. but it is not clear to me.even the standard version of this prolem is not clear to me. how reflection trick works here? what is the intuition behind it?

please explain this in a simple manner.. thanks.

Full text and comments »

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

By sabbirh654, history, 4 years ago, In English

how to solve this problem on timus using binary search? I read the discussions about this problem but can't figure it out. how to apply binary search here and how to calculate the height. please explain in some details. problem link :

Full text and comments »

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

By sabbirh654, history, 4 years ago, In English

how can I solve this problem? Any hints ? here is the problem link :

Full text and comments »

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

By sabbirh654, history, 4 years ago, In English

I was solving 479C-Exams but surprisingly i got RTE,which is unusual to me. A screenshot is given here.. https://i.imgur.com/tZgaJyC.png Error: exit code 3

My submission :

85745356

why this happen happen?how to fix it?

Full text and comments »

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

By sabbirh654, history, 5 years ago, In English

Problem Link: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=676

My problem with is Problem: I'm trying to understand this problem,but unable to understand it.please explain this problem with suitable example and the test cases mentioned in the problem. NB: I googled about this problem.but can't find any good blog.

Full text and comments »

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

By sabbirh654, history, 5 years ago, In English

https://mirror.codeforces.com/contest/309/problem/B i couldn't understand the editorial of this problem.i searched on google but couldn't get it at all. someone please explain the solution in a easy way with example?

Full text and comments »

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