POJ 1942(组合数学)
来源:互联网 发布:苹果电脑双系统卸载mac 编辑:程序博客网 时间:2024/05/18 02:38
题目链接:http://poj.org/status
题意:简单的来讲,就是求C(n,m).
但是这题有毒..TLE2发也是醉了..
必须循环较小的一个,否则就会TLE。。
#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<cmath>#include<queue>using namespace std;const int INF=0x3f3f3f3f;const int Hashmaxn=100000;const int maxn=10010;typedef unsigned long long ULL;ULL n,m;ULL C(ULL n,ULL m){ULL res=1;for(ULL i=m+1,j=1;i<=n;i++,j++){res=res*i/j;}return res;}int main(){#ifndef ONLINE_JUDGEfreopen("test.in","r",stdin);freopen("test.out","w",stdout);#endifwhile(cin>>n>>m){if(!n&&!m) break;if(n>m)cout<<C(n+m,n)<<endl;elsecout<<C(n+m,m)<<endl;}return 0;}
0 0
- poj-1942-组合数学
- POJ 1942 组合数学
- POJ 1942(组合数学)
- poj 1942 走地图的组合数学
- poj 1850组合数学
- poj 1850(组合数学)
- POJ 3252 组合数学
- poj 3252组合数学
- POJ 3252 组合数学?
- POJ 3731 (组合数学)
- poj 3252 组合数学,数论
- Code POJ 1850 组合数学
- POJ 1715(组合数学)
- POJ 1850/ 1496 组合数学
- poj 1850 Code 组合数学
- poj 1850 Code (组合数学)
- POJ 1850-Code(组合数学)
- POJ 1850:Code 组合数学
- poj 1797 Heavy Transportation(通路中的最大承载量)
- zookeeper配置开机启动失效分析
- VB把excel数据导入ACCESS
- 渣渣的大数相比 - 我果然机智
- 读《大话设计模式》——适配器模式
- POJ 1942(组合数学)
- AccessibilityService之微信抢红包辅助功能实现
- 深度学习个人总结之四----自编码算法(AutoEncoder)
- Android 中activity中传递数据的方式
- C++复习(三)
- JVM结构概览与运行机制
- ZOJ-3872-Beauty of Array【数学】【12th浙江省赛】
- hdoj4944FSF’s game
- cloudsim 资料