How to solve this gym problem

Правка en1, от motatoes, 2018-04-18 22:47:38

Dear CF

I am trying to solve this problem from the gym, I have found that the solution to the problem is the sum of combinations:

nc(N, K) + nc(N, K+1) + nc(N, K+2) + ... + nc(N, N)

where nc(i, j) is the number of combinations i chose j

However the input sizes of N and K are very large and my submission times out. Can you please advise me about a suitable approach to solve this problem?

Теги combinations

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский motatoes 2018-04-18 22:47:38 540 Initial revision (published)