10105 - Polynomial Coefficients
描述:杨辉三角与二项式定理
#include <cstdio>
int solve(int n,int m)
{
int sum=1;
for(int i=n; i>m; --i) sum*=i;
for(int i=2; i<=n-m; ++i) sum/=i;
return sum;
}
int main()
{
//freopen("a.txt","r",stdin);
int n,m,sum,k;
while(scanf("%d%d",&n,&m)!=EOF)
{
sum=1;
for(int i=0; i<m; i++)
{
scanf("%d",&k);
if(k)
{
sum*=solve(n,k);
n-=k;
}
}
printf("%d\n",sum);
}
return 0;
}
10105 - Polynomial Coefficients的更多相关文章
- UVA题目分类
题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...
- (Step1-500题)UVaOJ+算法竞赛入门经典+挑战编程+USACO
http://www.cnblogs.com/sxiszero/p/3618737.html 下面给出的题目共计560道,去掉重复的也有近500题,作为ACMer Training Step1,用1年 ...
- ACM训练计划step 1 [非原创]
(Step1-500题)UVaOJ+算法竞赛入门经典+挑战编程+USACO 下面给出的题目共计560道,去掉重复的也有近500题,作为ACMer Training Step1,用1年到1年半年时间完成 ...
- 算法竞赛入门经典+挑战编程+USACO
下面给出的题目共计560道,去掉重复的也有近500题,作为ACMer Training Step1,用1年到1年半年时间完成.打牢基础,厚积薄发. 一.UVaOJ http://uva.onlinej ...
- Convolution and polynomial multiplication
https://www.mathworks.com/help/matlab/ref/conv.html?s_tid=gn_loc_drop conv Convolution and polynomia ...
- WGS84坐标和UTM坐标的转换
如题.做了一个Demo,主要是把最后面的参考资料1里面的脚本改成了C语言版本的. 代码: #ifndef __COORCONV_H__ #define __COORCONV_H__ #include ...
- Complete the Sequence[HDU1121]
Complete the Sequence Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Ot ...
- 样条曲线的Fortran程序
subroutine basis_function_b_val ( tdata, tval, yval ) ! !******************************************* ...
- Matlab splinetx
function v = splinetx(x,y,u) %SPLINETX Textbook spline function. % v = splinetx(x,y,u) finds the pie ...
随机推荐
- Spring笔记 - Bean xml装配
命名空间表 aop Provides elements for declaring aspects and for automatically proxying @AspectJannotated c ...
- CentOS: make menuconfig error: curses.h: No such file or directory
the problem when use centos5 to build kernel or busybox step 1. Centos中关于 ncurses.h:no such file or ...
- Excel 公式(细节若干)
查找与引用: 1.如果需要找出匹配元素的位置而不是匹配元素本身,则应该使用 MATCH 函数而不是 LOOKUP 函数. 2.VLOOKUP的第一个参数允许使用通配符“*”来表示包含的意思,把*放在字 ...
- 刘德华夏日Fiesta演唱会上那个表演探戈舞的演员是谁啊?_百度知道
刘德华夏日Fiesta演唱会上那个表演探戈舞的演员是谁啊?_百度知道 刘德华夏日Fiesta演唱会上那个表演探戈舞的演员是谁啊? 2008-05-28 00:04 topofhill | ...
- freemarker自己定义标签报错(三)
freemarker自己定义标签 1.错误描写叙述 freemarker.core.ParseException: Encountered " " at line 14, colu ...
- 支付宝打造公共账号业务网关, RSA密钥对生成
作者: 玉龙 版权全部,同意转载. 请注明出处(创建金融_玉龙 http://www.weibo.com/u/1872245125) 原文地址: http://blog.csdn.net/ ...
- 08-使用for循环输出杨辉三角(循环)
/** * 使用循环输出杨辉三角 * * */ public class Test6 { public static void main(String[] args) { // 创建二维数组 int ...
- Javascript 进阶 封装
js中处处是对象,面向对象的第一步当然就是封装了,由于Js中没有类的概念,所以封装起来也比较麻烦,下面介绍两种js的封装. 1.使用约定优先的原则,将所有的私有变量以_开头 <script ty ...
- java.io.EOFException解决
主要错误提演示样例如以下: 严重: IOException while loading persisted sessions: java.io.EOFException 严重: Exception l ...
- EasyUI - 使用一般处理程序 HttpHandler (.ashx)
以easyui中的panel中,使用url加载数据为列. 效果: html代码: <div id="p" style="padding: 10px;"&g ...