Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Question by Ibrahim Mesecan.
Сложность Бета
Pascal Triangle - 1
In Pascal Triangle, except the first and last elements of each row,
any element is equal to the sum of the above two elements.
pascal(n,r) = pascal(n-1,r-1) + pascal(n-1,r)
Question: Write a program that
calculates nth row rth element in Pascal Triangle.
Input specification
You will be given 2 numbers (n,r) where 0 ≤ n ≤ 30 and 0 ≤ r ≤ n
Output specification
Show one number: nth row rth element of the Pascal Triangle.
Sample Input I
5 0
|
Sample Input II
8 5
|
Sample Output I
1
|
Sample Output II
56
|
Для отправки решений необходимо выполнить вход.
|