Sum Of Binomial Coefficent
All submissions for this problem are available.
Read problems statements in Mandarin Chinese and Russian.
As we all know, Binomial Coefficient C(n, r) is defined by the
Also define S(n) as follows.
Note that n will be provided to you as an input parameter.
Since S(n) can be very large, please print it modulo (109 + 7).
- The first line contains a single integer T representing the number of test cases.
- Each of the next T lines contains an integer n.
- For each test case, output a single line containing the value of S(n) modulo (109 + 7).
Input: 5 1 2 3 4 5 Output: 2 4 2 4 8
|Tags||combinatorics, digit-dp, hard, ltime19, tuananh93|
|Time Limit:||2 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.