排列组合 poj Paths on a grid
来源:互联网 发布:老干部网络意思 编辑:程序博客网 时间:2024/05/21 22:49
题目衔接:http://poj.org/problem?id=1942
题目分析:组合数学问题,但是由于题目给的数据的范围比较大,所以不能用动态规划做,直接暴力解决,用double存放结果
代码:
Memory: 744KTime: 0MSLanguage: G++Result: Accepted
#include <iostream>#include <cstdio>using namespace std;unsigned int result[2][maxn];double caculate(unsigned int m,unsigned int n){ double res=1; unsigned int i; for(i=n;i>=1;--i) res*=((double)(m-i+1)/i); return res;}int main(){unsigned int m,n;while((cin>>m>>n)&&(m||n))printf("%.0f\n",caculate(m+n,min(m,n)));return 0;}
- 排列组合 poj Paths on a grid
- poj 1942 : Paths on a Grid (排列组合)
- POJ 题目1942 Paths on a Grid(排列组合,水)
- poj1942 Paths on a Grid 【排列组合】
- poj 1942 Paths on a Grid 简单排列组合 + unsigned long long 使用方法
- poj 1942 Paths on a Grid
- POJ 1942 Paths on a Grid
- POJ 1942 Paths on a Grid .
- POJ 1942 Paths on a Grid
- poj 1942 Paths on a Grid
- POJ 1942 Paths on a Grid
- POJ 1942 Paths on a Grid
- POJ 1942 Paths on a Grid
- POJ 1942 Paths on a Grid
- POJ 1942 Paths on a Grid
- poj 1942Paths on a Grid
- POJ 1942--Paths on a Grid
- poj 1942 Paths on a Grid
- Swift与Keystone认证问题,Permission denied: '/root/keystone-signing'
- QT自带QTcpServer架构分析
- 获取货币汇率API
- rank()随机函数的使用
- 第4章 商业蜂窝通信系统的典范-GSM
- 排列组合 poj Paths on a grid
- Stardict 字典下载地址(也是一Ubuntu源)
- 蓝桥杯(概率题)
- Java的初始化顺序
- mysql-connector移植到mini2440
- Ubuntu JDK1.6 安装
- VS2010/MFC编程入门教程之目录和总结
- 归并排序
- 安卓模拟器上安装卸载apk文件教程