http://poj.org/problem?id=2249
Binomial Showdown
Time Limit:1000MS |
|
Memory Limit:65536K |
Description
In how many ways can you choose k elements out of n elements, not taking order into account?
Write a program to compute this number.
Input
The input will contain one or more test cases.
Each test case consists of one line containing two integers n (n>=1) and k (0<=k<=n).
Input is terminated by two zeroes for n and k.
Output
For each test case, print one line containing the required number. This number will always fit into an integer, i.e. it will be less than 231.
Warning: Don't underestimate the problem. The result will fit into an integer - but if all intermediate results arising during the computation will also fit into an integer depends on your algorithm. The test cases will go to the limit.
Sample Input
4 2
10 5
49 6
0 0
Sample Output
6
252
13983816
分享到:
相关推荐
poj 3219 Binomial Coefficients.md
C语言 poj npu 西工大 C语言Poj答案全完整打包,给有需要的朋友
poj大学c语言的作业及参考答案
POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类POJ分类
西北工业大学 c语言作业 poj 90道题 全套啊西北工业大学 c语言作业 poj 90道题 全套啊西北工业大学 c语言作业 poj 90道题 全套啊西北工业大学 c语言作业 poj 90道题 全套啊
第十二周CH,SX,详细源码,适用于高校的POJ习题
组合数学 ACM 和,POJ里用到组合数学的题目
北大POJ2586-Y2K Accounting Bug 解题报告+AC代码
poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题报告poj 解题...
北大POJ3239-Solution to the n Queens Puzzle 解题报告+AC代码
北大POJ2002-Squares 解题报告+AC代码
C语言写的,通过了.我第一个POJ通过的文件,纪念一下.POJ上对于格式要求还真是紧啊!
西工大本科生C语言POJ习题答案,共一百道,建议作为参考,早一点将POJ搞定,这一百道题占有一定的平时成绩,早点做完可以获得老师的好感,也许能获取更多的加分。
NULL 博文链接:https://128kj.iteye.com/blog/1705139
POJ第1861题源码 POJ第1861题源码 POJ第1861题源码
poj分类poj分类poj分类poj分类
poj一到7季的全部答案。包含题的截图,每题有相应的代码,直接粘贴就行了
北大POJ2676-Sudoku 解题报告+AC代码
北大POJ1804-Brainman【借助Mergesort求逆序数O(nlogn)】
北大POJ2159的源程序程序,Ancient Cipher