Блог пользователя shinghalrishabh

Автор shinghalrishabh, история, 5 лет назад, По-английски

In english tutorial of https://codeforces.net/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.net/contest/460/submission/76206660

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится